00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00044 #ifndef __vtkGraphLayoutView_h
00045 #define __vtkGraphLayoutView_h
00046
00047 #include "vtkRenderView.h"
00048
00049 class vtkEdgeLayoutStrategy;
00050 class vtkGraphLayoutStrategy;
00051 class vtkRenderedGraphRepresentation;
00052 class vtkViewTheme;
00053
00054 class VTK_VIEWS_EXPORT vtkGraphLayoutView : public vtkRenderView
00055 {
00056 public:
00057 static vtkGraphLayoutView *New();
00058 vtkTypeRevisionMacro(vtkGraphLayoutView, vtkRenderView);
00059 void PrintSelf(ostream& os, vtkIndent indent);
00060
00062
00063 void SetVertexLabelArrayName(const char* name);
00064 const char* GetVertexLabelArrayName();
00066
00068
00069 void SetEdgeLabelArrayName(const char* name);
00070 const char* GetEdgeLabelArrayName();
00072
00074
00075 void SetVertexLabelVisibility(bool vis);
00076 bool GetVertexLabelVisibility();
00077 vtkBooleanMacro(VertexLabelVisibility, bool);
00079
00081
00083 void SetHideVertexLabelsOnInteraction(bool vis);
00084 bool GetHideVertexLabelsOnInteraction();
00085 vtkBooleanMacro(HideVertexLabelsOnInteraction, bool);
00087
00089
00090 void SetEdgeVisibility(bool vis);
00091 bool GetEdgeVisibility();
00092 vtkBooleanMacro(EdgeVisibility, bool);
00094
00096
00097 void SetEdgeLabelVisibility(bool vis);
00098 bool GetEdgeLabelVisibility();
00099 vtkBooleanMacro(EdgeLabelVisibility, bool);
00101
00103
00105 void SetHideEdgeLabelsOnInteraction(bool vis);
00106 bool GetHideEdgeLabelsOnInteraction();
00107 vtkBooleanMacro(HideEdgeLabelsOnInteraction, bool);
00109
00111
00112 void SetVertexColorArrayName(const char* name);
00113 const char* GetVertexColorArrayName();
00115
00117
00118 void SetColorVertices(bool vis);
00119 bool GetColorVertices();
00120 vtkBooleanMacro(ColorVertices, bool);
00122
00124
00125 void SetEdgeColorArrayName(const char* name);
00126 const char* GetEdgeColorArrayName();
00128
00130
00131 void SetColorEdges(bool vis);
00132 bool GetColorEdges();
00133 vtkBooleanMacro(ColorEdges, bool);
00135
00137
00138 void SetEnabledEdgesArrayName(const char* name);
00139 const char* GetEnabledEdgesArrayName();
00141
00143
00144 void SetEnableEdgesByArray(bool vis);
00145 int GetEnableEdgesByArray();
00147
00149
00150 void SetEnabledVerticesArrayName(const char* name);
00151 const char* GetEnabledVerticesArrayName();
00153
00155
00156 void SetEnableVerticesByArray(bool vis);
00157 int GetEnableVerticesByArray();
00159
00161
00162 void SetScalingArrayName(const char* name);
00163 const char* GetScalingArrayName();
00165
00167
00168 void SetScaledGlyphs(bool arg);
00169 bool GetScaledGlyphs();
00170 vtkBooleanMacro(ScaledGlyphs, bool);
00172
00174
00186 void SetLayoutStrategy(const char* name);
00187 void SetLayoutStrategyToRandom()
00188 { this->SetLayoutStrategy("Random"); }
00189 void SetLayoutStrategyToForceDirected()
00190 { this->SetLayoutStrategy("Force Directed"); }
00191 void SetLayoutStrategyToSimple2D()
00192 { this->SetLayoutStrategy("Simple 2D"); }
00193 void SetLayoutStrategyToClustering2D()
00194 { this->SetLayoutStrategy("Clustering 2D"); }
00195 void SetLayoutStrategyToCommunity2D()
00196 { this->SetLayoutStrategy("Community 2D"); }
00197 void SetLayoutStrategyToFast2D()
00198 { this->SetLayoutStrategy("Fast 2D"); }
00199 void SetLayoutStrategyToPassThrough()
00200 { this->SetLayoutStrategy("Pass Through"); }
00201 void SetLayoutStrategyToCircular()
00202 { this->SetLayoutStrategy("Circular"); }
00203 void SetLayoutStrategyToTree()
00204 { this->SetLayoutStrategy("Tree"); }
00205 void SetLayoutStrategyToCosmicTree()
00206 { this->SetLayoutStrategy("Cosmic Tree"); }
00207 void SetLayoutStrategyToCone()
00208 { this->SetLayoutStrategy("Cone"); }
00209 void SetLayoutStrategyToSpanTree()
00210 { this->SetLayoutStrategy("Span Tree"); }
00211 const char* GetLayoutStrategyName();
00213
00215
00218 vtkGraphLayoutStrategy* GetLayoutStrategy();
00219 void SetLayoutStrategy(vtkGraphLayoutStrategy *s);
00221
00223
00227 void SetEdgeLayoutStrategy(const char* name);
00228 void SetEdgeLayoutStrategyToArcParallel()
00229 { this->SetEdgeLayoutStrategy("Arc Parallel"); }
00230 void SetEdgeLayoutStrategyToPassThrough()
00231 { this->SetEdgeLayoutStrategy("Pass Through"); }
00232 const char* GetEdgeLayoutStrategyName();
00234
00236
00239 vtkEdgeLayoutStrategy* GetEdgeLayoutStrategy();
00240 void SetEdgeLayoutStrategy(vtkEdgeLayoutStrategy *s);
00242
00246 void AddIconType(char *type, int index);
00247
00249 void ClearIconTypes();
00250
00253 void SetIconAlignment(int alignment);
00254
00256
00257 void SetIconVisibility(bool b);
00258 bool GetIconVisibility();
00259 vtkBooleanMacro(IconVisibility, bool);
00261
00263
00264 void SetIconArrayName(const char* name);
00265 const char* GetIconArrayName();
00267
00269
00270 void SetGlyphType(int type);
00271 int GetGlyphType();
00273
00275
00276 virtual void SetVertexLabelFontSize(const int size);
00277 virtual int GetVertexLabelFontSize();
00279
00281
00282 virtual void SetEdgeLabelFontSize(const int size);
00283 virtual int GetEdgeLabelFontSize();
00285
00287
00288 void SetEdgeScalarBarVisibility(bool vis);
00289 bool GetEdgeScalarBarVisibility();
00291
00293
00294 void SetVertexScalarBarVisibility(bool vis);
00295 bool GetVertexScalarBarVisibility();
00297
00299 void ZoomToSelection();
00300
00304 virtual int IsLayoutComplete();
00305
00310 virtual void UpdateLayout();
00311
00312 protected:
00313 vtkGraphLayoutView();
00314 ~vtkGraphLayoutView();
00315
00317
00319 virtual vtkDataRepresentation* CreateDefaultRepresentation(vtkAlgorithmOutput* conn);
00320 virtual vtkRenderedGraphRepresentation* GetGraphRepresentation();
00321
00322 virtual void ProcessEvents(vtkObject* caller, unsigned long eventId, void* callData);
00324
00325 private:
00326 vtkGraphLayoutView(const vtkGraphLayoutView&);
00327 void operator=(const vtkGraphLayoutView&);
00328 bool VertexLabelsRequested;
00329 bool EdgeLabelsRequested;
00330 bool Interacting;
00331 };
00332
00333 #endif