00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00040 #ifndef __vtkTreeAreaView_h
00041 #define __vtkTreeAreaView_h
00042
00043 #include "vtkSmartPointer.h"
00044 #include "vtkRenderView.h"
00045
00046 class vtkActor;
00047 class vtkActor2D;
00048 class vtkAlgorithmOutput;
00049 class vtkAreaLayout;
00050 class vtkAreaLayoutStrategy;
00051 class vtkConvertSelection;
00052 class vtkCoordinate;
00053 class vtkDynamic2DLabelMapper;
00054 class vtkEdgeCenters;
00055 class vtkExtractSelectedGraph;
00056 class vtkExtractSelectedPolyDataIds;
00057 class vtkGraph;
00058 class vtkGraphHierarchicalBundle;
00059 class vtkGraphMapper;
00060 class vtkTransferAttributes;
00061 class vtkKdTreeSelector;
00062 class vtkLabeledDataMapper;
00063 class vtkLookupTable;
00064 class vtkPolyDataAlgorithm;
00065 class vtkPolyDataMapper;
00066 class vtkSelection;
00067 class vtkSelectionLink;
00068 class vtkSplineFilter;
00069 class vtkTexture;
00070 class vtkTree;
00071 class vtkTreeFieldAggregator;
00072 class vtkTreeLevelsFilter;
00073 class vtkVertexDegree;
00074 class vtkViewTheme;
00075 class vtkHardwareSelector;
00076
00077 class VTK_VIEWS_EXPORT vtkTreeAreaView : public vtkRenderView
00078 {
00079 public:
00080 static vtkTreeAreaView *New();
00081 vtkTypeRevisionMacro(vtkTreeAreaView, vtkRenderView);
00082 void PrintSelf(ostream& os, vtkIndent indent);
00083
00085
00087 vtkDataRepresentation* SetTreeFromInputConnection(vtkAlgorithmOutput* conn);
00088 vtkDataRepresentation* SetTreeFromInput(vtkTree* input);
00089 vtkDataRepresentation* SetGraphFromInputConnection(vtkAlgorithmOutput* conn);
00090 vtkDataRepresentation* SetGraphFromInput(vtkGraph* input);
00092
00094
00095 void SetAreaLabelArrayName(const char* name);
00096 const char* GetAreaLabelArrayName();
00098
00100 void SetAreaSizeArrayName(const char* name);
00101
00104 void SetLabelPriorityArrayName(const char* name);
00105
00107
00108 void SetEdgeLabelArrayName(const char* name);
00109 const char* GetEdgeLabelArrayName();
00111
00113
00115 void SetAreaHoverArrayName(const char* name);
00116 const char* GetAreaHoverArrayName();
00118
00120
00121 void SetAreaLabelVisibility(bool vis);
00122 bool GetAreaLabelVisibility();
00123 void AreaLabelVisibilityOn();
00124 void AreaLabelVisibilityOff();
00126
00128
00129 void SetEdgeLabelVisibility(bool vis);
00130 bool GetEdgeLabelVisibility();
00131 void EdgeLabelVisibilityOn();
00132 void EdgeLabelVisibilityOff();
00134
00136 void SetAreaColorArrayName(const char* name);
00137
00139
00140 void SetColorVertices(bool vis);
00141 bool GetColorVertices();
00142 vtkBooleanMacro(ColorVertices, bool);
00144
00146
00147 void SetEdgeColorArrayName(const char* name);
00148 const char* GetEdgeColorArrayName();
00150
00152 void SetEdgeColorToSplineFraction();
00153
00155
00156 void SetShrinkPercentage(double value);
00157 double GetShrinkPercentage();
00159
00161
00162 void SetColorEdges(bool vis);
00163 bool GetColorEdges();
00164 vtkBooleanMacro(ColorEdges, bool);
00166
00168 void SetBundlingStrength(double strength);
00169
00171
00172 virtual vtkDataRepresentation* GetGraphRepresentation()
00173 { return this->GetRepresentation(1, 0); }
00174 virtual vtkDataRepresentation* GetTreeRepresentation()
00175 { return this->GetRepresentation(0, 0); }
00177
00179 virtual void SetupRenderWindow(vtkRenderWindow* win);
00180
00182 virtual void ApplyViewTheme(vtkViewTheme* theme);
00183
00185
00186 virtual void SetAreaLabelFontSize(const int size);
00187 virtual int GetAreaLabelFontSize();
00189
00191
00192 virtual void SetEdgeLabelFontSize(const int size);
00193 virtual int GetEdgeLabelFontSize();
00195
00197
00198 virtual void SetLayoutStrategy(vtkAreaLayoutStrategy* strategy);
00199 virtual vtkAreaLayoutStrategy* GetLayoutStrategy();
00201
00203
00206 virtual void SetAreaToPolyData(vtkPolyDataAlgorithm* areaToPoly);
00207 vtkGetObjectMacro(AreaToPolyData, vtkPolyDataAlgorithm);
00209
00211
00212 virtual void SetUseRectangularCoordinates(bool rect);
00213 virtual bool GetUseRectangularCoordinates();
00214 vtkBooleanMacro(UseRectangularCoordinates, bool);
00216
00218
00220 virtual void SetAreaLabelMapper(vtkLabeledDataMapper* mapper);
00221 vtkGetObjectMacro(AreaLabelMapper, vtkLabeledDataMapper);
00223
00224 protected:
00225 vtkTreeAreaView();
00226 ~vtkTreeAreaView();
00227
00229
00230 virtual void ProcessEvents(vtkObject* caller, unsigned long eventId,
00231 void* callData);
00233
00235
00236 virtual void AddInputConnection(int port, int item,
00237 vtkAlgorithmOutput* conn,
00238 vtkAlgorithmOutput* selectConn);
00240
00242
00243 virtual void RemoveInputConnection(int port, int item,
00244 vtkAlgorithmOutput* conn,
00245 vtkAlgorithmOutput* selectConn);
00247
00249 virtual void PrepareForRendering();
00250
00252 void MapToXYPlane(double displayX, double displayY, double &x, double &y);
00253
00254
00255
00256 vtkSmartPointer<vtkCoordinate> Coordinate;
00257 vtkSmartPointer<vtkGraphHierarchicalBundle> HBundle;
00258 vtkSmartPointer<vtkSplineFilter> Spline;
00259 vtkSmartPointer<vtkVertexDegree> VertexDegree;
00260 vtkSmartPointer<vtkVertexDegree> GraphVertexDegree;
00261 vtkSmartPointer<vtkEdgeCenters> EdgeCenters;
00262 vtkSmartPointer<vtkTreeFieldAggregator> TreeAggregation;
00263 vtkSmartPointer<vtkTransferAttributes> TransferAttributes;
00264 vtkSmartPointer<vtkTreeLevelsFilter> TreeLevels;
00265
00266
00267 vtkSmartPointer<vtkDynamic2DLabelMapper> EdgeLabelMapper;
00268 vtkSmartPointer<vtkActor2D> EdgeLabelActor;
00269 vtkSmartPointer<vtkPolyDataMapper> GraphEdgeMapper;
00270 vtkSmartPointer<vtkActor> GraphEdgeActor;
00271
00272
00273 vtkSmartPointer<vtkAreaLayout> AreaLayout;
00274 vtkSmartPointer<vtkPolyDataMapper> AreaMapper;
00275 vtkSmartPointer<vtkActor> AreaActor;
00276 vtkSmartPointer<vtkActor2D> AreaLabelActor;
00277 vtkPolyDataAlgorithm* AreaToPolyData;
00278 vtkLabeledDataMapper* AreaLabelMapper;
00279
00280
00281 vtkSmartPointer<vtkSelection> EmptySelection;
00282 vtkSmartPointer<vtkKdTreeSelector> KdTreeSelector;
00283 vtkSmartPointer<vtkHardwareSelector> HardwareSelector;
00284 vtkSmartPointer<vtkExtractSelectedGraph> ExtractSelectedGraph;
00285 vtkSmartPointer<vtkGraphHierarchicalBundle> SelectedGraphHBundle;
00286 vtkSmartPointer<vtkSplineFilter> SelectedGraphSpline;
00287 vtkSmartPointer<vtkActor> SelectedGraphActor;
00288 vtkSmartPointer<vtkPolyDataMapper> SelectedGraphMapper;
00289
00290
00291 vtkSmartPointer<vtkConvertSelection> ConvertSelection;
00292 vtkSmartPointer<vtkExtractSelectedPolyDataIds> ExtractSelectedAreas;
00293 vtkSmartPointer<vtkPolyDataMapper> SelectedAreaMapper;
00294 vtkSmartPointer<vtkActor> SelectedAreaActor;
00295
00296
00297 private:
00298 vtkTreeAreaView(const vtkTreeAreaView&);
00299 void operator=(const vtkTreeAreaView&);
00300 };
00301
00302 #endif