VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkRenderedTreeAreaRepresentation.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00015 /*------------------------------------------------------------------------- 00016 Copyright 2008 Sandia Corporation. 00017 Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, 00018 the U.S. Government retains certain rights in this software. 00019 -------------------------------------------------------------------------*/ 00028 #ifndef __vtkRenderedTreeAreaRepresentation_h 00029 #define __vtkRenderedTreeAreaRepresentation_h 00030 00031 #include "vtkRenderedRepresentation.h" 00032 00033 class vtkActor; 00034 class vtkActor2D; 00035 class vtkAreaLayout; 00036 class vtkAreaLayoutStrategy; 00037 class vtkConvertSelection; 00038 class vtkEdgeCenters; 00039 class vtkExtractSelectedPolyDataIds; 00040 class vtkLabeledDataMapper; 00041 class vtkPointSetToLabelHierarchy; 00042 class vtkPolyData; 00043 class vtkPolyDataAlgorithm; 00044 class vtkPolyDataMapper; 00045 class vtkScalarBarWidget; 00046 class vtkTextProperty; 00047 class vtkTreeFieldAggregator; 00048 class vtkTreeLevelsFilter; 00049 class vtkVertexDegree; 00050 class vtkWorldPointPicker; 00051 00052 class VTK_VIEWS_EXPORT vtkRenderedTreeAreaRepresentation : public vtkRenderedRepresentation 00053 { 00054 public: 00055 static vtkRenderedTreeAreaRepresentation* New(); 00056 vtkTypeMacro(vtkRenderedTreeAreaRepresentation, vtkRenderedRepresentation); 00057 void PrintSelf(ostream& os, vtkIndent indent); 00058 00062 virtual void SetLabelRenderMode(int mode); 00063 00065 00066 virtual void SetAreaLabelArrayName(const char* name); 00067 virtual const char* GetAreaLabelArrayName(); 00069 00071 00072 virtual void SetAreaSizeArrayName(const char* name); 00073 virtual const char* GetAreaSizeArrayName(); 00075 00077 00079 virtual void SetAreaLabelPriorityArrayName(const char* name); 00080 virtual const char* GetAreaLabelPriorityArrayName(); 00082 00084 00085 virtual void SetGraphEdgeLabelArrayName(const char* name) 00086 { this->SetGraphEdgeLabelArrayName(name, 0); } 00087 virtual void SetGraphEdgeLabelArrayName(const char* name, int idx); 00088 virtual const char* GetGraphEdgeLabelArrayName() 00089 { return this->GetGraphEdgeLabelArrayName(0); } 00090 virtual const char* GetGraphEdgeLabelArrayName(int idx); 00092 00094 00095 virtual void SetGraphEdgeLabelTextProperty(vtkTextProperty* tp) 00096 { this->SetGraphEdgeLabelTextProperty(tp, 0); } 00097 virtual void SetGraphEdgeLabelTextProperty(vtkTextProperty* tp, int idx); 00098 virtual vtkTextProperty* GetGraphEdgeLabelTextProperty() 00099 { return this->GetGraphEdgeLabelTextProperty(0); } 00100 virtual vtkTextProperty* GetGraphEdgeLabelTextProperty(int idx); 00102 00104 00106 vtkSetStringMacro(AreaHoverArrayName); 00107 vtkGetStringMacro(AreaHoverArrayName); 00109 00111 00112 virtual void SetAreaLabelVisibility(bool vis); 00113 virtual bool GetAreaLabelVisibility(); 00114 vtkBooleanMacro(AreaLabelVisibility, bool); 00116 00118 00119 virtual void SetAreaLabelTextProperty(vtkTextProperty* tp); 00120 virtual vtkTextProperty* GetAreaLabelTextProperty(); 00122 00124 00125 virtual void SetGraphEdgeLabelVisibility(bool vis) 00126 { this->SetGraphEdgeLabelVisibility(vis, 0); } 00127 virtual void SetGraphEdgeLabelVisibility(bool vis, int idx); 00128 virtual bool GetGraphEdgeLabelVisibility() 00129 { return this->GetGraphEdgeLabelVisibility(0); } 00130 virtual bool GetGraphEdgeLabelVisibility(int idx); 00131 vtkBooleanMacro(GraphEdgeLabelVisibility, bool); 00133 00135 00136 void SetAreaColorArrayName(const char* name); 00137 const char* GetAreaColorArrayName(); 00139 00141 00142 virtual void SetColorAreasByArray(bool vis); 00143 virtual bool GetColorAreasByArray(); 00144 vtkBooleanMacro(ColorAreasByArray, bool); 00146 00148 00149 virtual void SetGraphEdgeColorArrayName(const char* name) 00150 { this->SetGraphEdgeColorArrayName(name, 0); } 00151 virtual void SetGraphEdgeColorArrayName(const char* name, int idx); 00152 virtual const char* GetGraphEdgeColorArrayName() 00153 { return this->GetGraphEdgeColorArrayName(0); } 00154 virtual const char* GetGraphEdgeColorArrayName(int idx); 00156 00158 00159 virtual void SetGraphEdgeColorToSplineFraction() 00160 { this->SetGraphEdgeColorToSplineFraction(0); } 00161 virtual void SetGraphEdgeColorToSplineFraction(int idx); 00163 00165 00166 virtual void SetColorGraphEdgesByArray(bool vis) 00167 { this->SetColorGraphEdgesByArray(vis, 0); } 00168 virtual void SetColorGraphEdgesByArray(bool vis, int idx); 00169 virtual bool GetColorGraphEdgesByArray() 00170 { return this->GetColorGraphEdgesByArray(0); } 00171 virtual bool GetColorGraphEdgesByArray(int idx); 00172 vtkBooleanMacro(ColorGraphEdgesByArray, bool); 00174 00176 00178 virtual void SetGraphHoverArrayName(const char* name) 00179 { this->SetGraphHoverArrayName(name, 0); } 00180 virtual void SetGraphHoverArrayName(const char* name, int idx); 00181 virtual const char* GetGraphHoverArrayName() 00182 { return this->GetGraphHoverArrayName(0); } 00183 virtual const char* GetGraphHoverArrayName(int idx); 00185 00187 00188 virtual void SetShrinkPercentage(double value); 00189 virtual double GetShrinkPercentage(); 00191 00193 00194 virtual void SetGraphBundlingStrength(double strength) 00195 { this->SetGraphBundlingStrength(strength, 0); } 00196 virtual void SetGraphBundlingStrength(double strength, int idx); 00197 virtual double GetGraphBundlingStrength() 00198 { return this->GetGraphBundlingStrength(0); } 00199 virtual double GetGraphBundlingStrength(int idx); 00201 00203 00206 virtual void SetGraphSplineType(int type, int idx); 00207 virtual int GetGraphSplineType(int idx); 00209 00211 00212 virtual void SetAreaLayoutStrategy(vtkAreaLayoutStrategy* strategy); 00213 virtual vtkAreaLayoutStrategy* GetAreaLayoutStrategy(); 00215 00217 00220 virtual void SetAreaToPolyData(vtkPolyDataAlgorithm* areaToPoly); 00221 vtkGetObjectMacro(AreaToPolyData, vtkPolyDataAlgorithm); 00223 00225 00226 vtkSetMacro(UseRectangularCoordinates, bool); 00227 vtkGetMacro(UseRectangularCoordinates, bool); 00228 vtkBooleanMacro(UseRectangularCoordinates, bool); 00230 00232 00234 virtual void SetAreaLabelMapper(vtkLabeledDataMapper* mapper); 00235 vtkGetObjectMacro(AreaLabelMapper, vtkLabeledDataMapper); 00237 00239 virtual void ApplyViewTheme(vtkViewTheme* theme); 00240 00242 00243 virtual void SetEdgeScalarBarVisibility(bool b); 00244 virtual bool GetEdgeScalarBarVisibility(); 00246 00247 protected: 00248 vtkRenderedTreeAreaRepresentation(); 00249 ~vtkRenderedTreeAreaRepresentation(); 00250 00252 00253 virtual bool AddToView(vtkView* view); 00254 virtual bool RemoveFromView(vtkView* view); 00256 00257 virtual vtkSelection* ConvertSelection(vtkView* view, vtkSelection* sel); 00258 00259 virtual int FillInputPortInformation(int port, vtkInformation* info); 00260 00261 virtual int RequestData( 00262 vtkInformation*, 00263 vtkInformationVector**, 00264 vtkInformationVector*); 00265 00266 virtual void PrepareForRendering(vtkRenderView* view); 00267 00268 bool ValidIndex(int idx); 00269 00270 void UpdateHoverHighlight(vtkView* view, int x, int y); 00271 00272 virtual vtkUnicodeString GetHoverTextInternal(vtkSelection* sel); 00273 00274 //BTX 00275 class Internals; 00276 Internals* Implementation; 00277 //ETX 00278 00279 //BTX 00280 vtkSmartPointer<vtkWorldPointPicker> Picker; 00281 vtkSmartPointer<vtkApplyColors> ApplyColors; 00282 vtkSmartPointer<vtkTreeLevelsFilter> TreeLevels; 00283 vtkSmartPointer<vtkVertexDegree> VertexDegree; 00284 vtkSmartPointer<vtkTreeFieldAggregator> TreeAggregation; 00285 vtkSmartPointer<vtkAreaLayout> AreaLayout; 00286 vtkSmartPointer<vtkPolyDataMapper> AreaMapper; 00287 vtkSmartPointer<vtkActor> AreaActor; 00288 vtkSmartPointer<vtkActor2D> AreaLabelActor; 00289 vtkSmartPointer<vtkPolyData> HighlightData; 00290 vtkSmartPointer<vtkPolyDataMapper> HighlightMapper; 00291 vtkSmartPointer<vtkActor> HighlightActor; 00292 vtkPolyDataAlgorithm* AreaToPolyData; 00293 vtkLabeledDataMapper* AreaLabelMapper; 00294 vtkSmartPointer<vtkScalarBarWidget> EdgeScalarBar; 00295 vtkSmartPointer<vtkPointSetToLabelHierarchy> AreaLabelHierarchy; 00296 vtkSmartPointer<vtkPolyData> EmptyPolyData; 00297 //ETX 00298 00299 vtkSetStringMacro(AreaSizeArrayNameInternal); 00300 vtkGetStringMacro(AreaSizeArrayNameInternal); 00301 char* AreaSizeArrayNameInternal; 00302 vtkSetStringMacro(AreaColorArrayNameInternal); 00303 vtkGetStringMacro(AreaColorArrayNameInternal); 00304 char* AreaColorArrayNameInternal; 00305 vtkSetStringMacro(AreaLabelArrayNameInternal); 00306 vtkGetStringMacro(AreaLabelArrayNameInternal); 00307 char* AreaLabelArrayNameInternal; 00308 vtkSetStringMacro(AreaLabelPriorityArrayNameInternal); 00309 vtkGetStringMacro(AreaLabelPriorityArrayNameInternal); 00310 char* AreaLabelPriorityArrayNameInternal; 00311 vtkSetStringMacro(GraphEdgeColorArrayNameInternal); 00312 vtkGetStringMacro(GraphEdgeColorArrayNameInternal); 00313 char* GraphEdgeColorArrayNameInternal; 00314 vtkGetStringMacro(AreaHoverTextInternal); 00315 vtkSetStringMacro(AreaHoverTextInternal); 00316 char* AreaHoverTextInternal; 00317 char* AreaHoverArrayName; 00318 00319 bool UseRectangularCoordinates; 00320 00321 private: 00322 vtkRenderedTreeAreaRepresentation(const vtkRenderedTreeAreaRepresentation&); // Not implemented 00323 void operator=(const vtkRenderedTreeAreaRepresentation&); // Not implemented 00324 }; 00325 00326 #endif 00327