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 -------------------------------------------------------------------------*/ 00031 #ifndef __vtkRenderedTreeAreaRepresentation_h 00032 #define __vtkRenderedTreeAreaRepresentation_h 00033 00034 #include "vtkViewsInfovisModule.h" // For export macro 00035 #include "vtkRenderedRepresentation.h" 00036 00037 class vtkActor; 00038 class vtkActor2D; 00039 class vtkAreaLayout; 00040 class vtkAreaLayoutStrategy; 00041 class vtkConvertSelection; 00042 class vtkEdgeCenters; 00043 class vtkExtractSelectedPolyDataIds; 00044 class vtkLabeledDataMapper; 00045 class vtkPointSetToLabelHierarchy; 00046 class vtkPolyData; 00047 class vtkPolyDataAlgorithm; 00048 class vtkPolyDataMapper; 00049 class vtkScalarBarWidget; 00050 class vtkTextProperty; 00051 class vtkTreeFieldAggregator; 00052 class vtkTreeLevelsFilter; 00053 class vtkVertexDegree; 00054 class vtkWorldPointPicker; 00055 00056 class VTKVIEWSINFOVIS_EXPORT vtkRenderedTreeAreaRepresentation : public vtkRenderedRepresentation 00057 { 00058 public: 00059 static vtkRenderedTreeAreaRepresentation* New(); 00060 vtkTypeMacro(vtkRenderedTreeAreaRepresentation, vtkRenderedRepresentation); 00061 void PrintSelf(ostream& os, vtkIndent indent); 00062 00066 virtual void SetLabelRenderMode(int mode); 00067 00069 00070 virtual void SetAreaLabelArrayName(const char* name); 00071 virtual const char* GetAreaLabelArrayName(); 00073 00075 00076 virtual void SetAreaSizeArrayName(const char* name); 00077 virtual const char* GetAreaSizeArrayName(); 00079 00081 00083 virtual void SetAreaLabelPriorityArrayName(const char* name); 00084 virtual const char* GetAreaLabelPriorityArrayName(); 00086 00088 00089 virtual void SetGraphEdgeLabelArrayName(const char* name) 00090 { this->SetGraphEdgeLabelArrayName(name, 0); } 00091 virtual void SetGraphEdgeLabelArrayName(const char* name, int idx); 00092 virtual const char* GetGraphEdgeLabelArrayName() 00093 { return this->GetGraphEdgeLabelArrayName(0); } 00094 virtual const char* GetGraphEdgeLabelArrayName(int idx); 00096 00098 00099 virtual void SetGraphEdgeLabelTextProperty(vtkTextProperty* tp) 00100 { this->SetGraphEdgeLabelTextProperty(tp, 0); } 00101 virtual void SetGraphEdgeLabelTextProperty(vtkTextProperty* tp, int idx); 00102 virtual vtkTextProperty* GetGraphEdgeLabelTextProperty() 00103 { return this->GetGraphEdgeLabelTextProperty(0); } 00104 virtual vtkTextProperty* GetGraphEdgeLabelTextProperty(int idx); 00106 00108 00110 vtkSetStringMacro(AreaHoverArrayName); 00111 vtkGetStringMacro(AreaHoverArrayName); 00113 00115 00116 virtual void SetAreaLabelVisibility(bool vis); 00117 virtual bool GetAreaLabelVisibility(); 00118 vtkBooleanMacro(AreaLabelVisibility, bool); 00120 00122 00123 virtual void SetAreaLabelTextProperty(vtkTextProperty* tp); 00124 virtual vtkTextProperty* GetAreaLabelTextProperty(); 00126 00128 00129 virtual void SetGraphEdgeLabelVisibility(bool vis) 00130 { this->SetGraphEdgeLabelVisibility(vis, 0); } 00131 virtual void SetGraphEdgeLabelVisibility(bool vis, int idx); 00132 virtual bool GetGraphEdgeLabelVisibility() 00133 { return this->GetGraphEdgeLabelVisibility(0); } 00134 virtual bool GetGraphEdgeLabelVisibility(int idx); 00135 vtkBooleanMacro(GraphEdgeLabelVisibility, bool); 00137 00139 00140 void SetAreaColorArrayName(const char* name); 00141 const char* GetAreaColorArrayName(); 00143 00145 00146 virtual void SetColorAreasByArray(bool vis); 00147 virtual bool GetColorAreasByArray(); 00148 vtkBooleanMacro(ColorAreasByArray, bool); 00150 00152 00153 virtual void SetGraphEdgeColorArrayName(const char* name) 00154 { this->SetGraphEdgeColorArrayName(name, 0); } 00155 virtual void SetGraphEdgeColorArrayName(const char* name, int idx); 00156 virtual const char* GetGraphEdgeColorArrayName() 00157 { return this->GetGraphEdgeColorArrayName(0); } 00158 virtual const char* GetGraphEdgeColorArrayName(int idx); 00160 00162 00163 virtual void SetGraphEdgeColorToSplineFraction() 00164 { this->SetGraphEdgeColorToSplineFraction(0); } 00165 virtual void SetGraphEdgeColorToSplineFraction(int idx); 00167 00169 00170 virtual void SetColorGraphEdgesByArray(bool vis) 00171 { this->SetColorGraphEdgesByArray(vis, 0); } 00172 virtual void SetColorGraphEdgesByArray(bool vis, int idx); 00173 virtual bool GetColorGraphEdgesByArray() 00174 { return this->GetColorGraphEdgesByArray(0); } 00175 virtual bool GetColorGraphEdgesByArray(int idx); 00176 vtkBooleanMacro(ColorGraphEdgesByArray, bool); 00178 00180 00182 virtual void SetGraphHoverArrayName(const char* name) 00183 { this->SetGraphHoverArrayName(name, 0); } 00184 virtual void SetGraphHoverArrayName(const char* name, int idx); 00185 virtual const char* GetGraphHoverArrayName() 00186 { return this->GetGraphHoverArrayName(0); } 00187 virtual const char* GetGraphHoverArrayName(int idx); 00189 00191 00192 virtual void SetShrinkPercentage(double value); 00193 virtual double GetShrinkPercentage(); 00195 00197 00198 virtual void SetGraphBundlingStrength(double strength) 00199 { this->SetGraphBundlingStrength(strength, 0); } 00200 virtual void SetGraphBundlingStrength(double strength, int idx); 00201 virtual double GetGraphBundlingStrength() 00202 { return this->GetGraphBundlingStrength(0); } 00203 virtual double GetGraphBundlingStrength(int idx); 00205 00207 00210 virtual void SetGraphSplineType(int type, int idx); 00211 virtual int GetGraphSplineType(int idx); 00213 00215 00216 virtual void SetAreaLayoutStrategy(vtkAreaLayoutStrategy* strategy); 00217 virtual vtkAreaLayoutStrategy* GetAreaLayoutStrategy(); 00219 00221 00224 virtual void SetAreaToPolyData(vtkPolyDataAlgorithm* areaToPoly); 00225 vtkGetObjectMacro(AreaToPolyData, vtkPolyDataAlgorithm); 00227 00229 00230 vtkSetMacro(UseRectangularCoordinates, bool); 00231 vtkGetMacro(UseRectangularCoordinates, bool); 00232 vtkBooleanMacro(UseRectangularCoordinates, bool); 00234 00236 00238 virtual void SetAreaLabelMapper(vtkLabeledDataMapper* mapper); 00239 vtkGetObjectMacro(AreaLabelMapper, vtkLabeledDataMapper); 00241 00243 virtual void ApplyViewTheme(vtkViewTheme* theme); 00244 00246 00247 virtual void SetEdgeScalarBarVisibility(bool b); 00248 virtual bool GetEdgeScalarBarVisibility(); 00250 00251 protected: 00252 vtkRenderedTreeAreaRepresentation(); 00253 ~vtkRenderedTreeAreaRepresentation(); 00254 00256 00257 virtual bool AddToView(vtkView* view); 00258 virtual bool RemoveFromView(vtkView* view); 00260 00261 virtual vtkSelection* ConvertSelection(vtkView* view, vtkSelection* sel); 00262 00263 virtual int FillInputPortInformation(int port, vtkInformation* info); 00264 00265 virtual int RequestData( 00266 vtkInformation*, 00267 vtkInformationVector**, 00268 vtkInformationVector*); 00269 00270 virtual void PrepareForRendering(vtkRenderView* view); 00271 00272 bool ValidIndex(int idx); 00273 00274 void UpdateHoverHighlight(vtkView* view, int x, int y); 00275 00276 virtual vtkUnicodeString GetHoverTextInternal(vtkSelection* sel); 00277 00278 //BTX 00279 class Internals; 00280 Internals* Implementation; 00281 //ETX 00282 00283 //BTX 00284 vtkSmartPointer<vtkWorldPointPicker> Picker; 00285 vtkSmartPointer<vtkApplyColors> ApplyColors; 00286 vtkSmartPointer<vtkTreeLevelsFilter> TreeLevels; 00287 vtkSmartPointer<vtkVertexDegree> VertexDegree; 00288 vtkSmartPointer<vtkTreeFieldAggregator> TreeAggregation; 00289 vtkSmartPointer<vtkAreaLayout> AreaLayout; 00290 vtkSmartPointer<vtkPolyDataMapper> AreaMapper; 00291 vtkSmartPointer<vtkActor> AreaActor; 00292 vtkSmartPointer<vtkActor2D> AreaLabelActor; 00293 vtkSmartPointer<vtkPolyData> HighlightData; 00294 vtkSmartPointer<vtkPolyDataMapper> HighlightMapper; 00295 vtkSmartPointer<vtkActor> HighlightActor; 00296 vtkPolyDataAlgorithm* AreaToPolyData; 00297 vtkLabeledDataMapper* AreaLabelMapper; 00298 vtkSmartPointer<vtkScalarBarWidget> EdgeScalarBar; 00299 vtkSmartPointer<vtkPointSetToLabelHierarchy> AreaLabelHierarchy; 00300 vtkSmartPointer<vtkPolyData> EmptyPolyData; 00301 //ETX 00302 00303 vtkSetStringMacro(AreaSizeArrayNameInternal); 00304 vtkGetStringMacro(AreaSizeArrayNameInternal); 00305 char* AreaSizeArrayNameInternal; 00306 vtkSetStringMacro(AreaColorArrayNameInternal); 00307 vtkGetStringMacro(AreaColorArrayNameInternal); 00308 char* AreaColorArrayNameInternal; 00309 vtkSetStringMacro(AreaLabelArrayNameInternal); 00310 vtkGetStringMacro(AreaLabelArrayNameInternal); 00311 char* AreaLabelArrayNameInternal; 00312 vtkSetStringMacro(AreaLabelPriorityArrayNameInternal); 00313 vtkGetStringMacro(AreaLabelPriorityArrayNameInternal); 00314 char* AreaLabelPriorityArrayNameInternal; 00315 vtkSetStringMacro(GraphEdgeColorArrayNameInternal); 00316 vtkGetStringMacro(GraphEdgeColorArrayNameInternal); 00317 char* GraphEdgeColorArrayNameInternal; 00318 vtkGetStringMacro(AreaHoverTextInternal); 00319 vtkSetStringMacro(AreaHoverTextInternal); 00320 char* AreaHoverTextInternal; 00321 char* AreaHoverArrayName; 00322 00323 bool UseRectangularCoordinates; 00324 00325 private: 00326 vtkRenderedTreeAreaRepresentation(const vtkRenderedTreeAreaRepresentation&); // Not implemented 00327 void operator=(const vtkRenderedTreeAreaRepresentation&); // Not implemented 00328 }; 00329 00330 #endif 00331