VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkGraphLayoutView.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 -------------------------------------------------------------------------*/ 00047 #ifndef __vtkGraphLayoutView_h 00048 #define __vtkGraphLayoutView_h 00049 00050 #include "vtkViewsInfovisModule.h" // For export macro 00051 #include "vtkRenderView.h" 00052 00053 class vtkEdgeLayoutStrategy; 00054 class vtkGraphLayoutStrategy; 00055 class vtkRenderedGraphRepresentation; 00056 class vtkViewTheme; 00057 00058 class VTKVIEWSINFOVIS_EXPORT vtkGraphLayoutView : public vtkRenderView 00059 { 00060 public: 00061 static vtkGraphLayoutView *New(); 00062 vtkTypeMacro(vtkGraphLayoutView, vtkRenderView); 00063 void PrintSelf(ostream& os, vtkIndent indent); 00064 00066 00067 void SetVertexLabelArrayName(const char* name); 00068 const char* GetVertexLabelArrayName(); 00070 00072 00073 void SetEdgeLabelArrayName(const char* name); 00074 const char* GetEdgeLabelArrayName(); 00076 00078 00079 void SetVertexLabelVisibility(bool vis); 00080 bool GetVertexLabelVisibility(); 00081 vtkBooleanMacro(VertexLabelVisibility, bool); 00083 00085 00087 void SetHideVertexLabelsOnInteraction(bool vis); 00088 bool GetHideVertexLabelsOnInteraction(); 00089 vtkBooleanMacro(HideVertexLabelsOnInteraction, bool); 00091 00093 00094 void SetEdgeVisibility(bool vis); 00095 bool GetEdgeVisibility(); 00096 vtkBooleanMacro(EdgeVisibility, bool); 00098 00100 00101 void SetEdgeLabelVisibility(bool vis); 00102 bool GetEdgeLabelVisibility(); 00103 vtkBooleanMacro(EdgeLabelVisibility, bool); 00105 00107 00109 void SetHideEdgeLabelsOnInteraction(bool vis); 00110 bool GetHideEdgeLabelsOnInteraction(); 00111 vtkBooleanMacro(HideEdgeLabelsOnInteraction, bool); 00113 00115 00117 void SetVertexColorArrayName(const char* name); 00118 const char* GetVertexColorArrayName(); 00120 00122 00123 void SetColorVertices(bool vis); 00124 bool GetColorVertices(); 00125 vtkBooleanMacro(ColorVertices, bool); 00127 00129 00130 void SetEdgeColorArrayName(const char* name); 00131 const char* GetEdgeColorArrayName(); 00133 00135 00136 void SetColorEdges(bool vis); 00137 bool GetColorEdges(); 00138 vtkBooleanMacro(ColorEdges, bool); 00140 00142 00143 void SetEdgeSelection(bool vis); 00144 bool GetEdgeSelection(); 00145 vtkBooleanMacro(EdgeSelection, bool); 00147 00149 00150 void SetEnabledEdgesArrayName(const char* name); 00151 const char* GetEnabledEdgesArrayName(); 00153 00155 00156 void SetEnableEdgesByArray(bool vis); 00157 int GetEnableEdgesByArray(); 00159 00161 00162 void SetEnabledVerticesArrayName(const char* name); 00163 const char* GetEnabledVerticesArrayName(); 00165 00167 00168 void SetEnableVerticesByArray(bool vis); 00169 int GetEnableVerticesByArray(); 00171 00173 00174 void SetScalingArrayName(const char* name); 00175 const char* GetScalingArrayName(); 00177 00179 00180 void SetScaledGlyphs(bool arg); 00181 bool GetScaledGlyphs(); 00182 vtkBooleanMacro(ScaledGlyphs, bool); 00184 00186 00198 void SetLayoutStrategy(const char* name); 00199 void SetLayoutStrategyToRandom() 00200 { this->SetLayoutStrategy("Random"); } 00201 void SetLayoutStrategyToForceDirected() 00202 { this->SetLayoutStrategy("Force Directed"); } 00203 void SetLayoutStrategyToSimple2D() 00204 { this->SetLayoutStrategy("Simple 2D"); } 00205 void SetLayoutStrategyToClustering2D() 00206 { this->SetLayoutStrategy("Clustering 2D"); } 00207 void SetLayoutStrategyToCommunity2D() 00208 { this->SetLayoutStrategy("Community 2D"); } 00209 void SetLayoutStrategyToFast2D() 00210 { this->SetLayoutStrategy("Fast 2D"); } 00211 void SetLayoutStrategyToPassThrough() 00212 { this->SetLayoutStrategy("Pass Through"); } 00213 void SetLayoutStrategyToCircular() 00214 { this->SetLayoutStrategy("Circular"); } 00215 void SetLayoutStrategyToTree() 00216 { this->SetLayoutStrategy("Tree"); } 00217 void SetLayoutStrategyToCosmicTree() 00218 { this->SetLayoutStrategy("Cosmic Tree"); } 00219 void SetLayoutStrategyToCone() 00220 { this->SetLayoutStrategy("Cone"); } 00221 void SetLayoutStrategyToSpanTree() 00222 { this->SetLayoutStrategy("Span Tree"); } 00223 const char* GetLayoutStrategyName(); 00225 00227 00230 vtkGraphLayoutStrategy* GetLayoutStrategy(); 00231 void SetLayoutStrategy(vtkGraphLayoutStrategy *s); 00233 00235 00239 void SetEdgeLayoutStrategy(const char* name); 00240 void SetEdgeLayoutStrategyToArcParallel() 00241 { this->SetEdgeLayoutStrategy("Arc Parallel"); } 00242 void SetEdgeLayoutStrategyToPassThrough() 00243 { this->SetEdgeLayoutStrategy("Pass Through"); } 00244 const char* GetEdgeLayoutStrategyName(); 00246 00248 00251 vtkEdgeLayoutStrategy* GetEdgeLayoutStrategy(); 00252 void SetEdgeLayoutStrategy(vtkEdgeLayoutStrategy *s); 00254 00258 void AddIconType(char *type, int index); 00259 00261 void ClearIconTypes(); 00262 00265 void SetIconAlignment(int alignment); 00266 00268 00269 void SetIconVisibility(bool b); 00270 bool GetIconVisibility(); 00271 vtkBooleanMacro(IconVisibility, bool); 00273 00275 00276 void SetIconArrayName(const char* name); 00277 const char* GetIconArrayName(); 00279 00281 00282 void SetGlyphType(int type); 00283 int GetGlyphType(); 00285 00287 00288 virtual void SetVertexLabelFontSize(const int size); 00289 virtual int GetVertexLabelFontSize(); 00291 00293 00294 virtual void SetEdgeLabelFontSize(const int size); 00295 virtual int GetEdgeLabelFontSize(); 00297 00299 00300 void SetEdgeScalarBarVisibility(bool vis); 00301 bool GetEdgeScalarBarVisibility(); 00303 00305 00306 void SetVertexScalarBarVisibility(bool vis); 00307 bool GetVertexScalarBarVisibility(); 00309 00311 void ZoomToSelection(); 00312 00316 virtual int IsLayoutComplete(); 00317 00322 virtual void UpdateLayout(); 00323 00324 protected: 00325 vtkGraphLayoutView(); 00326 ~vtkGraphLayoutView(); 00327 00329 00331 virtual vtkDataRepresentation* CreateDefaultRepresentation(vtkAlgorithmOutput* conn); 00332 virtual vtkRenderedGraphRepresentation* GetGraphRepresentation(); 00333 // Called to process events. Overrides behavior in vtkRenderView. 00334 virtual void ProcessEvents(vtkObject* caller, unsigned long eventId, void* callData); 00336 00337 private: 00338 vtkGraphLayoutView(const vtkGraphLayoutView&); // Not implemented. 00339 void operator=(const vtkGraphLayoutView&); // Not implemented. 00340 bool VertexLabelsRequested; 00341 bool EdgeLabelsRequested; 00342 bool Interacting; 00343 }; 00344 00345 #endif