00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00047 #ifndef __vtkGraphLayoutView_h
00048 #define __vtkGraphLayoutView_h
00049
00050 #include "vtkSmartPointer.h"
00051 #include "vtkRenderView.h"
00052
00053 class vtkActor;
00054 class vtkActor2D;
00055 class vtkCircularLayoutStrategy;
00056 class vtkClustering2DLayoutStrategy;
00057 class vtkCoordinate;
00058 class vtkCommunity2DLayoutStrategy;
00059 class vtkConstrained2DLayoutStrategy;
00060 class vtkDynamic2DLabelMapper;
00061 class vtkEdgeCenters;
00062 class vtkExtractSelectedGraph;
00063 class vtkFast2DLayoutStrategy;
00064 class vtkForceDirectedLayoutStrategy;
00065 class vtkGraphLayout;
00066 class vtkGraphLayoutStrategy;
00067 class vtkGraphMapper;
00068 class vtkGraphToPolyData;
00069 class vtkKdTreeSelector;
00070 class vtkLookupTable;
00071 class vtkPassThroughLayoutStrategy;
00072 class vtkPolyDataMapper;
00073 class vtkRandomLayoutStrategy;
00074 class vtkSelectionLink;
00075 class vtkSimple2DLayoutStrategy;
00076 class vtkTexture;
00077 class vtkVertexDegree;
00078 class vtkVertexGlyphFilter;
00079 class vtkViewTheme;
00080 class vtkVisibleCellSelector;
00081
00082
00083
00084 class VTK_VIEWS_EXPORT vtkGraphLayoutView : public vtkRenderView
00085 {
00086 public:
00087 static vtkGraphLayoutView *New();
00088 vtkTypeRevisionMacro(vtkGraphLayoutView, vtkRenderView);
00089 void PrintSelf(ostream& os, vtkIndent indent);
00090
00092
00093 void SetVertexLabelArrayName(const char* name);
00094 const char* GetVertexLabelArrayName();
00096
00098
00099 void SetEdgeLabelArrayName(const char* name);
00100 const char* GetEdgeLabelArrayName();
00102
00104
00105 void SetVertexLabelVisibility(bool vis);
00106 bool GetVertexLabelVisibility();
00107 void VertexLabelVisibilityOn();
00108 void VertexLabelVisibilityOff();
00110
00112
00113 void SetEdgeLabelVisibility(bool vis);
00114 bool GetEdgeLabelVisibility();
00115 void EdgeLabelVisibilityOn();
00116 void EdgeLabelVisibilityOff();
00118
00120
00121 void SetVertexColorArrayName(const char* name);
00122 const char* GetVertexColorArrayName();
00124
00126
00127 void SetColorVertices(bool vis);
00128 bool GetColorVertices();
00129 void ColorVerticesOn();
00130 void ColorVerticesOff();
00132
00134
00135 void SetEdgeColorArrayName(const char* name);
00136 const char* GetEdgeColorArrayName();
00138
00140
00141 void SetColorEdges(bool vis);
00142 bool GetColorEdges();
00143 void ColorEdgesOn();
00144 void ColorEdgesOff();
00146
00148
00149 void SetScalingArrayName(const char* name);
00150 const char* GetScalingArrayName();
00152
00154
00155 void SetScaledGlyphs(bool arg);
00156 bool GetScaledGlyphs();
00157 vtkBooleanMacro(ScaledGlyphs, bool);
00159
00161
00170 void SetLayoutStrategy(const char* name);
00171 void SetLayoutStrategyToRandom() { this->SetLayoutStrategy("Random"); }
00172 void SetLayoutStrategyToForceDirected() { this->SetLayoutStrategy("Force Directed"); }
00173 void SetLayoutStrategyToSimple2D() { this->SetLayoutStrategy("Simple 2D"); }
00174 void SetLayoutStrategyToClustering2D() { this->SetLayoutStrategy("Cluster 2D"); }
00175 void SetLayoutStrategyToCommunity2D() { this->SetLayoutStrategy("Community 2D"); }
00176 void SetLayoutStrategyToFast2D() { this->SetLayoutStrategy("Fast 2D"); }
00177 void SetLayoutStrategyToPassThrough() { this->SetLayoutStrategy("Pass Through"); }
00178 void SetLayoutStrategyToCircular() { this->SetLayoutStrategy("Circular"); }
00179 const char* GetLayoutStrategyName() { return this->GetLayoutStrategyNameInternal(); }
00181
00183
00186 vtkGetObjectMacro(LayoutStrategy,vtkGraphLayoutStrategy);
00187 void SetLayoutStrategy(vtkGraphLayoutStrategy *s);
00189
00194 void SetIterationsPerLayout(int iterations);
00195
00197 void SetIconTexture(vtkTexture *texture);
00198
00202 void AddIconType(char *type, int index);
00203
00205 void ClearIconTypes();
00206
00208 void SetIconSize(int *size);
00209
00212 void SetIconAlignment(int alignment);
00213
00215
00216 void SetIconVisibility(bool b);
00217 bool GetIconVisibility();
00218 vtkBooleanMacro(IconVisibility, bool);
00220
00222
00223 void SetIconArrayName(const char* name);
00224 const char* GetIconArrayName();
00226
00228
00229 void SetSelectionArrayName(const char* name);
00230 const char* GetSelectionArrayName();
00232
00234 virtual void SetupRenderWindow(vtkRenderWindow* win);
00235
00237 virtual void ApplyViewTheme(vtkViewTheme* theme);
00238
00240
00241 virtual void SetVertexLabelFontSize(const int size);
00242 virtual int GetVertexLabelFontSize();
00244
00246
00247 virtual void SetEdgeLabelFontSize(const int size);
00248 virtual int GetEdgeLabelFontSize();
00250
00254 virtual int IsLayoutComplete();
00255
00260 virtual void UpdateLayout();
00261
00262 protected:
00263 vtkGraphLayoutView();
00264 ~vtkGraphLayoutView();
00265
00267
00268 virtual void ProcessEvents(vtkObject* caller, unsigned long eventId,
00269 void* callData);
00271
00274 virtual void AddInputConnection(vtkAlgorithmOutput* conn);
00275
00277 virtual void RemoveInputConnection(vtkAlgorithmOutput* conn);
00278
00280 virtual void SetSelectionLink(vtkSelectionLink* link);
00281
00283 virtual void PrepareForRendering();
00284
00286 void MapToXYPlane(double displayX, double displayY, double &x, double &y);
00287
00289
00290 vtkGetStringMacro(LayoutStrategyNameInternal);
00291 vtkSetStringMacro(LayoutStrategyNameInternal);
00292 char* LayoutStrategyNameInternal;
00294
00296 vtkGraphLayoutStrategy* LayoutStrategy;
00297
00299
00300 vtkGetStringMacro(SelectionArrayNameInternal);
00301 vtkSetStringMacro(SelectionArrayNameInternal);
00302 char* SelectionArrayNameInternal;
00304
00306
00307 vtkGetStringMacro(IconArrayNameInternal);
00308 vtkSetStringMacro(IconArrayNameInternal);
00309 char* IconArrayNameInternal;
00311
00312
00313
00314 vtkSmartPointer<vtkCoordinate> Coordinate;
00315
00316
00317 vtkSmartPointer<vtkGraphLayout> GraphLayout;
00318 vtkSmartPointer<vtkRandomLayoutStrategy> RandomStrategy;
00319 vtkSmartPointer<vtkForceDirectedLayoutStrategy> ForceDirectedStrategy;
00320 vtkSmartPointer<vtkSimple2DLayoutStrategy> Simple2DStrategy;
00321 vtkSmartPointer<vtkClustering2DLayoutStrategy> Clustering2DStrategy;
00322 vtkSmartPointer<vtkCommunity2DLayoutStrategy> Community2DStrategy;
00323 vtkSmartPointer<vtkConstrained2DLayoutStrategy> Constrained2DStrategy;
00324 vtkSmartPointer<vtkFast2DLayoutStrategy> Fast2DStrategy;
00325 vtkSmartPointer<vtkPassThroughLayoutStrategy> PassThroughStrategy;
00326 vtkSmartPointer<vtkCircularLayoutStrategy> CircularStrategy;
00327 vtkSmartPointer<vtkVertexDegree> VertexDegree;
00328 vtkSmartPointer<vtkEdgeCenters> EdgeCenters;
00329 vtkSmartPointer<vtkActor> GraphActor;
00330 vtkSmartPointer<vtkGraphMapper> GraphMapper;
00331 vtkSmartPointer<vtkDynamic2DLabelMapper> VertexLabelMapper;
00332 vtkSmartPointer<vtkActor2D> VertexLabelActor;
00333 vtkSmartPointer<vtkDynamic2DLabelMapper> EdgeLabelMapper;
00334 vtkSmartPointer<vtkActor2D> EdgeLabelActor;
00335
00336
00337 vtkSmartPointer<vtkKdTreeSelector> KdTreeSelector;
00338 vtkSmartPointer<vtkVisibleCellSelector> VisibleCellSelector;
00339 vtkSmartPointer<vtkExtractSelectedGraph> ExtractSelectedGraph;
00340 vtkSmartPointer<vtkActor> SelectedGraphActor;
00341 vtkSmartPointer<vtkGraphMapper> SelectedGraphMapper;
00342
00343
00344 private:
00345 vtkGraphLayoutView(const vtkGraphLayoutView&);
00346 void operator=(const vtkGraphLayoutView&);
00347 };
00348
00349 #endif