VTK
vtkGraphLayoutView.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkGraphLayoutView.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 /*-------------------------------------------------------------------------
16  Copyright 2008 Sandia Corporation.
17  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18  the U.S. Government retains certain rights in this software.
19 -------------------------------------------------------------------------*/
47 #ifndef vtkGraphLayoutView_h
48 #define vtkGraphLayoutView_h
49 
50 #include "vtkViewsInfovisModule.h" // For export macro
51 #include "vtkRenderView.h"
52 
56 class vtkViewTheme;
57 
59 {
60 public:
61  static vtkGraphLayoutView *New();
63  void PrintSelf(ostream& os, vtkIndent indent);
64 
66 
67  void SetVertexLabelArrayName(const char* name);
68  const char* GetVertexLabelArrayName();
70 
72 
73  void SetEdgeLabelArrayName(const char* name);
74  const char* GetEdgeLabelArrayName();
76 
78 
79  void SetVertexLabelVisibility(bool vis);
80  bool GetVertexLabelVisibility();
81  vtkBooleanMacro(VertexLabelVisibility, bool);
83 
85 
87  void SetHideVertexLabelsOnInteraction(bool vis);
88  bool GetHideVertexLabelsOnInteraction();
89  vtkBooleanMacro(HideVertexLabelsOnInteraction, bool);
91 
93 
94  void SetEdgeVisibility(bool vis);
95  bool GetEdgeVisibility();
96  vtkBooleanMacro(EdgeVisibility, bool);
98 
100 
101  void SetEdgeLabelVisibility(bool vis);
102  bool GetEdgeLabelVisibility();
103  vtkBooleanMacro(EdgeLabelVisibility, bool);
105 
107 
109  void SetHideEdgeLabelsOnInteraction(bool vis);
110  bool GetHideEdgeLabelsOnInteraction();
111  vtkBooleanMacro(HideEdgeLabelsOnInteraction, bool);
113 
115 
117  void SetVertexColorArrayName(const char* name);
118  const char* GetVertexColorArrayName();
120 
122 
123  void SetColorVertices(bool vis);
124  bool GetColorVertices();
125  vtkBooleanMacro(ColorVertices, bool);
127 
129 
130  void SetEdgeColorArrayName(const char* name);
131  const char* GetEdgeColorArrayName();
133 
135 
136  void SetColorEdges(bool vis);
137  bool GetColorEdges();
138  vtkBooleanMacro(ColorEdges, bool);
140 
142 
143  void SetEdgeSelection(bool vis);
144  bool GetEdgeSelection();
145  vtkBooleanMacro(EdgeSelection, bool);
147 
149 
150  void SetEnabledEdgesArrayName(const char* name);
151  const char* GetEnabledEdgesArrayName();
153 
155 
156  void SetEnableEdgesByArray(bool vis);
157  int GetEnableEdgesByArray();
159 
161 
162  void SetEnabledVerticesArrayName(const char* name);
163  const char* GetEnabledVerticesArrayName();
165 
167 
168  void SetEnableVerticesByArray(bool vis);
169  int GetEnableVerticesByArray();
171 
173 
174  void SetScalingArrayName(const char* name);
175  const char* GetScalingArrayName();
177 
179 
180  void SetScaledGlyphs(bool arg);
181  bool GetScaledGlyphs();
182  vtkBooleanMacro(ScaledGlyphs, bool);
184 
186 
198  void SetLayoutStrategy(const char* name);
200  { this->SetLayoutStrategy("Random"); }
202  { this->SetLayoutStrategy("Force Directed"); }
204  { this->SetLayoutStrategy("Simple 2D"); }
206  { this->SetLayoutStrategy("Clustering 2D"); }
208  { this->SetLayoutStrategy("Community 2D"); }
210  { this->SetLayoutStrategy("Fast 2D"); }
212  { this->SetLayoutStrategy("Pass Through"); }
214  { this->SetLayoutStrategy("Circular"); }
216  { this->SetLayoutStrategy("Tree"); }
218  { this->SetLayoutStrategy("Cosmic Tree"); }
220  { this->SetLayoutStrategy("Cone"); }
222  { this->SetLayoutStrategy("Span Tree"); }
223  const char* GetLayoutStrategyName();
225 
227 
230  vtkGraphLayoutStrategy* GetLayoutStrategy();
231  void SetLayoutStrategy(vtkGraphLayoutStrategy *s);
233 
235 
239  void SetEdgeLayoutStrategy(const char* name);
241  { this->SetEdgeLayoutStrategy("Arc Parallel"); }
243  { this->SetEdgeLayoutStrategy("Pass Through"); }
244  const char* GetEdgeLayoutStrategyName();
246 
248 
251  vtkEdgeLayoutStrategy* GetEdgeLayoutStrategy();
252  void SetEdgeLayoutStrategy(vtkEdgeLayoutStrategy *s);
254 
258  void AddIconType(char *type, int index);
259 
261  void ClearIconTypes();
262 
265  void SetIconAlignment(int alignment);
266 
268 
269  void SetIconVisibility(bool b);
270  bool GetIconVisibility();
271  vtkBooleanMacro(IconVisibility, bool);
273 
275 
276  void SetIconArrayName(const char* name);
277  const char* GetIconArrayName();
279 
281 
282  void SetGlyphType(int type);
283  int GetGlyphType();
285 
287 
288  virtual void SetVertexLabelFontSize(const int size);
289  virtual int GetVertexLabelFontSize();
291 
293 
294  virtual void SetEdgeLabelFontSize(const int size);
295  virtual int GetEdgeLabelFontSize();
297 
299 
300  void SetEdgeScalarBarVisibility(bool vis);
301  bool GetEdgeScalarBarVisibility();
303 
305 
306  void SetVertexScalarBarVisibility(bool vis);
307  bool GetVertexScalarBarVisibility();
309 
311  void ZoomToSelection();
312 
316  virtual int IsLayoutComplete();
317 
322  virtual void UpdateLayout();
323 
324 protected:
327 
329 
332  virtual vtkRenderedGraphRepresentation* GetGraphRepresentation();
333  // Called to process events. Overrides behavior in vtkRenderView.
334  virtual void ProcessEvents(vtkObject* caller, unsigned long eventId, void* callData);
336 
337 private:
338  vtkGraphLayoutView(const vtkGraphLayoutView&); // Not implemented.
339  void operator=(const vtkGraphLayoutView&); // Not implemented.
340  bool VertexLabelsRequested;
341  bool EdgeLabelsRequested;
342  bool Interacting;
343 };
344 
345 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:61
Lays out and displays a graph.
static vtkRenderView * New()
void SetEdgeLayoutStrategyToArcParallel()
Proxy object to connect input/output ports.
abstract superclass for all graph layout strategies
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:47
a simple class to control print indentation
Definition: vtkIndent.h:38
The superclass for all representations.
virtual void ProcessEvents(vtkObject *caller, unsigned long eventId, void *callData)
void SetLayoutStrategyToClustering2D()
void SetLayoutStrategyToForceDirected()
void SetEdgeLayoutStrategyToPassThrough()
A view containing a renderer.
Definition: vtkRenderView.h:63
abstract superclass for all edge layout strategies
void PrintSelf(ostream &os, vtkIndent indent)
#define VTKVIEWSINFOVIS_EXPORT
virtual vtkDataRepresentation * CreateDefaultRepresentation(vtkAlgorithmOutput *conn)