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 "vtkRenderView.h" 00051 00052 class vtkEdgeLayoutStrategy; 00053 class vtkGraphLayoutStrategy; 00054 class vtkRenderedGraphRepresentation; 00055 class vtkViewTheme; 00056 00057 class VTK_VIEWS_EXPORT vtkGraphLayoutView : public vtkRenderView 00058 { 00059 public: 00060 static vtkGraphLayoutView *New(); 00061 vtkTypeMacro(vtkGraphLayoutView, vtkRenderView); 00062 void PrintSelf(ostream& os, vtkIndent indent); 00063 00065 00066 void SetVertexLabelArrayName(const char* name); 00067 const char* GetVertexLabelArrayName(); 00069 00071 00072 void SetEdgeLabelArrayName(const char* name); 00073 const char* GetEdgeLabelArrayName(); 00075 00077 00078 void SetVertexLabelVisibility(bool vis); 00079 bool GetVertexLabelVisibility(); 00080 vtkBooleanMacro(VertexLabelVisibility, bool); 00082 00084 00086 void SetHideVertexLabelsOnInteraction(bool vis); 00087 bool GetHideVertexLabelsOnInteraction(); 00088 vtkBooleanMacro(HideVertexLabelsOnInteraction, bool); 00090 00092 00093 void SetEdgeVisibility(bool vis); 00094 bool GetEdgeVisibility(); 00095 vtkBooleanMacro(EdgeVisibility, bool); 00097 00099 00100 void SetEdgeLabelVisibility(bool vis); 00101 bool GetEdgeLabelVisibility(); 00102 vtkBooleanMacro(EdgeLabelVisibility, bool); 00104 00106 00108 void SetHideEdgeLabelsOnInteraction(bool vis); 00109 bool GetHideEdgeLabelsOnInteraction(); 00110 vtkBooleanMacro(HideEdgeLabelsOnInteraction, bool); 00112 00114 00116 void SetVertexColorArrayName(const char* name); 00117 const char* GetVertexColorArrayName(); 00119 00121 00122 void SetColorVertices(bool vis); 00123 bool GetColorVertices(); 00124 vtkBooleanMacro(ColorVertices, bool); 00126 00128 00129 void SetEdgeColorArrayName(const char* name); 00130 const char* GetEdgeColorArrayName(); 00132 00134 00135 void SetColorEdges(bool vis); 00136 bool GetColorEdges(); 00137 vtkBooleanMacro(ColorEdges, bool); 00139 00141 00142 void SetEdgeSelection(bool vis); 00143 bool GetEdgeSelection(); 00144 vtkBooleanMacro(EdgeSelection, bool); 00146 00148 00149 void SetEnabledEdgesArrayName(const char* name); 00150 const char* GetEnabledEdgesArrayName(); 00152 00154 00155 void SetEnableEdgesByArray(bool vis); 00156 int GetEnableEdgesByArray(); 00158 00160 00161 void SetEnabledVerticesArrayName(const char* name); 00162 const char* GetEnabledVerticesArrayName(); 00164 00166 00167 void SetEnableVerticesByArray(bool vis); 00168 int GetEnableVerticesByArray(); 00170 00172 00173 void SetScalingArrayName(const char* name); 00174 const char* GetScalingArrayName(); 00176 00178 00179 void SetScaledGlyphs(bool arg); 00180 bool GetScaledGlyphs(); 00181 vtkBooleanMacro(ScaledGlyphs, bool); 00183 00185 00197 void SetLayoutStrategy(const char* name); 00198 void SetLayoutStrategyToRandom() 00199 { this->SetLayoutStrategy("Random"); } 00200 void SetLayoutStrategyToForceDirected() 00201 { this->SetLayoutStrategy("Force Directed"); } 00202 void SetLayoutStrategyToSimple2D() 00203 { this->SetLayoutStrategy("Simple 2D"); } 00204 void SetLayoutStrategyToClustering2D() 00205 { this->SetLayoutStrategy("Clustering 2D"); } 00206 void SetLayoutStrategyToCommunity2D() 00207 { this->SetLayoutStrategy("Community 2D"); } 00208 void SetLayoutStrategyToFast2D() 00209 { this->SetLayoutStrategy("Fast 2D"); } 00210 void SetLayoutStrategyToPassThrough() 00211 { this->SetLayoutStrategy("Pass Through"); } 00212 void SetLayoutStrategyToCircular() 00213 { this->SetLayoutStrategy("Circular"); } 00214 void SetLayoutStrategyToTree() 00215 { this->SetLayoutStrategy("Tree"); } 00216 void SetLayoutStrategyToCosmicTree() 00217 { this->SetLayoutStrategy("Cosmic Tree"); } 00218 void SetLayoutStrategyToCone() 00219 { this->SetLayoutStrategy("Cone"); } 00220 void SetLayoutStrategyToSpanTree() 00221 { this->SetLayoutStrategy("Span Tree"); } 00222 const char* GetLayoutStrategyName(); 00224 00226 00229 vtkGraphLayoutStrategy* GetLayoutStrategy(); 00230 void SetLayoutStrategy(vtkGraphLayoutStrategy *s); 00232 00234 00238 void SetEdgeLayoutStrategy(const char* name); 00239 void SetEdgeLayoutStrategyToArcParallel() 00240 { this->SetEdgeLayoutStrategy("Arc Parallel"); } 00241 void SetEdgeLayoutStrategyToPassThrough() 00242 { this->SetEdgeLayoutStrategy("Pass Through"); } 00243 const char* GetEdgeLayoutStrategyName(); 00245 00247 00250 vtkEdgeLayoutStrategy* GetEdgeLayoutStrategy(); 00251 void SetEdgeLayoutStrategy(vtkEdgeLayoutStrategy *s); 00253 00257 void AddIconType(char *type, int index); 00258 00260 void ClearIconTypes(); 00261 00264 void SetIconAlignment(int alignment); 00265 00267 00268 void SetIconVisibility(bool b); 00269 bool GetIconVisibility(); 00270 vtkBooleanMacro(IconVisibility, bool); 00272 00274 00275 void SetIconArrayName(const char* name); 00276 const char* GetIconArrayName(); 00278 00280 00281 void SetGlyphType(int type); 00282 int GetGlyphType(); 00284 00286 00287 virtual void SetVertexLabelFontSize(const int size); 00288 virtual int GetVertexLabelFontSize(); 00290 00292 00293 virtual void SetEdgeLabelFontSize(const int size); 00294 virtual int GetEdgeLabelFontSize(); 00296 00298 00299 void SetEdgeScalarBarVisibility(bool vis); 00300 bool GetEdgeScalarBarVisibility(); 00302 00304 00305 void SetVertexScalarBarVisibility(bool vis); 00306 bool GetVertexScalarBarVisibility(); 00308 00310 void ZoomToSelection(); 00311 00315 virtual int IsLayoutComplete(); 00316 00321 virtual void UpdateLayout(); 00322 00323 protected: 00324 vtkGraphLayoutView(); 00325 ~vtkGraphLayoutView(); 00326 00328 00330 virtual vtkDataRepresentation* CreateDefaultRepresentation(vtkAlgorithmOutput* conn); 00331 virtual vtkRenderedGraphRepresentation* GetGraphRepresentation(); 00332 // Called to process events. Overrides behavior in vtkRenderView. 00333 virtual void ProcessEvents(vtkObject* caller, unsigned long eventId, void* callData); 00335 00336 private: 00337 vtkGraphLayoutView(const vtkGraphLayoutView&); // Not implemented. 00338 void operator=(const vtkGraphLayoutView&); // Not implemented. 00339 bool VertexLabelsRequested; 00340 bool EdgeLabelsRequested; 00341 bool Interacting; 00342 }; 00343 00344 #endif