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 "vtkRenderView.h"
51 
55 class vtkViewTheme;
56 
58 {
59 public:
60  static vtkGraphLayoutView *New();
62  void PrintSelf(ostream& os, vtkIndent indent);
63 
65 
66  void SetVertexLabelArrayName(const char* name);
67  const char* GetVertexLabelArrayName();
69 
71 
72  void SetEdgeLabelArrayName(const char* name);
73  const char* GetEdgeLabelArrayName();
75 
77 
78  void SetVertexLabelVisibility(bool vis);
79  bool GetVertexLabelVisibility();
80  vtkBooleanMacro(VertexLabelVisibility, bool);
82 
84 
86  void SetHideVertexLabelsOnInteraction(bool vis);
87  bool GetHideVertexLabelsOnInteraction();
88  vtkBooleanMacro(HideVertexLabelsOnInteraction, bool);
90 
92 
93  void SetEdgeVisibility(bool vis);
94  bool GetEdgeVisibility();
95  vtkBooleanMacro(EdgeVisibility, bool);
97 
99 
100  void SetEdgeLabelVisibility(bool vis);
101  bool GetEdgeLabelVisibility();
102  vtkBooleanMacro(EdgeLabelVisibility, bool);
104 
106 
108  void SetHideEdgeLabelsOnInteraction(bool vis);
109  bool GetHideEdgeLabelsOnInteraction();
110  vtkBooleanMacro(HideEdgeLabelsOnInteraction, bool);
112 
114 
116  void SetVertexColorArrayName(const char* name);
117  const char* GetVertexColorArrayName();
119 
121 
122  void SetColorVertices(bool vis);
123  bool GetColorVertices();
124  vtkBooleanMacro(ColorVertices, bool);
126 
128 
129  void SetEdgeColorArrayName(const char* name);
130  const char* GetEdgeColorArrayName();
132 
134 
135  void SetColorEdges(bool vis);
136  bool GetColorEdges();
137  vtkBooleanMacro(ColorEdges, bool);
139 
141 
142  void SetEdgeSelection(bool vis);
143  bool GetEdgeSelection();
144  vtkBooleanMacro(EdgeSelection, bool);
146 
148 
149  void SetEnabledEdgesArrayName(const char* name);
150  const char* GetEnabledEdgesArrayName();
152 
154 
155  void SetEnableEdgesByArray(bool vis);
156  int GetEnableEdgesByArray();
158 
160 
161  void SetEnabledVerticesArrayName(const char* name);
162  const char* GetEnabledVerticesArrayName();
164 
166 
167  void SetEnableVerticesByArray(bool vis);
168  int GetEnableVerticesByArray();
170 
172 
173  void SetScalingArrayName(const char* name);
174  const char* GetScalingArrayName();
176 
178 
179  void SetScaledGlyphs(bool arg);
180  bool GetScaledGlyphs();
181  vtkBooleanMacro(ScaledGlyphs, bool);
183 
185 
197  void SetLayoutStrategy(const char* name);
199  { this->SetLayoutStrategy("Random"); }
201  { this->SetLayoutStrategy("Force Directed"); }
203  { this->SetLayoutStrategy("Simple 2D"); }
205  { this->SetLayoutStrategy("Clustering 2D"); }
207  { this->SetLayoutStrategy("Community 2D"); }
209  { this->SetLayoutStrategy("Fast 2D"); }
211  { this->SetLayoutStrategy("Pass Through"); }
213  { this->SetLayoutStrategy("Circular"); }
215  { this->SetLayoutStrategy("Tree"); }
217  { this->SetLayoutStrategy("Cosmic Tree"); }
219  { this->SetLayoutStrategy("Cone"); }
221  { this->SetLayoutStrategy("Span Tree"); }
222  const char* GetLayoutStrategyName();
224 
226 
229  vtkGraphLayoutStrategy* GetLayoutStrategy();
230  void SetLayoutStrategy(vtkGraphLayoutStrategy *s);
232 
234 
238  void SetEdgeLayoutStrategy(const char* name);
240  { this->SetEdgeLayoutStrategy("Arc Parallel"); }
242  { this->SetEdgeLayoutStrategy("Pass Through"); }
243  const char* GetEdgeLayoutStrategyName();
245 
247 
250  vtkEdgeLayoutStrategy* GetEdgeLayoutStrategy();
251  void SetEdgeLayoutStrategy(vtkEdgeLayoutStrategy *s);
253 
257  void AddIconType(char *type, int index);
258 
260  void ClearIconTypes();
261 
264  void SetIconAlignment(int alignment);
265 
267 
268  void SetIconVisibility(bool b);
269  bool GetIconVisibility();
270  vtkBooleanMacro(IconVisibility, bool);
272 
274 
275  void SetIconArrayName(const char* name);
276  const char* GetIconArrayName();
278 
280 
281  void SetGlyphType(int type);
282  int GetGlyphType();
284 
286 
287  virtual void SetVertexLabelFontSize(const int size);
288  virtual int GetVertexLabelFontSize();
290 
292 
293  virtual void SetEdgeLabelFontSize(const int size);
294  virtual int GetEdgeLabelFontSize();
296 
298 
299  void SetEdgeScalarBarVisibility(bool vis);
300  bool GetEdgeScalarBarVisibility();
302 
304 
305  void SetVertexScalarBarVisibility(bool vis);
306  bool GetVertexScalarBarVisibility();
308 
310  void ZoomToSelection();
311 
315  virtual int IsLayoutComplete();
316 
321  virtual void UpdateLayout();
322 
323 protected:
326 
328 
331  virtual vtkRenderedGraphRepresentation* GetGraphRepresentation();
332  // Called to process events. Overrides behavior in vtkRenderView.
333  virtual void ProcessEvents(vtkObject* caller, unsigned long eventId, void* callData);
335 
336 private:
337  vtkGraphLayoutView(const vtkGraphLayoutView&); // Not implemented.
338  void operator=(const vtkGraphLayoutView&); // Not implemented.
339  bool VertexLabelsRequested;
340  bool EdgeLabelsRequested;
341  bool Interacting;
342 };
343 
344 #endif