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 -------------------------------------------------------------------------*/
42 #ifndef vtkGraphLayoutView_h
43 #define vtkGraphLayoutView_h
44 
45 #include "vtkViewsInfovisModule.h" // For export macro
46 #include "vtkRenderView.h"
47 
51 class vtkViewTheme;
52 
53 class VTKVIEWSINFOVIS_EXPORT vtkGraphLayoutView : public vtkRenderView
54 {
55 public:
56  static vtkGraphLayoutView *New();
58  void PrintSelf(ostream& os, vtkIndent indent) override;
59 
61 
64  void SetVertexLabelArrayName(const char* name);
65  const char* GetVertexLabelArrayName();
67 
69 
72  void SetEdgeLabelArrayName(const char* name);
73  const char* GetEdgeLabelArrayName();
75 
77 
80  void SetVertexLabelVisibility(bool vis);
81  bool GetVertexLabelVisibility();
82  vtkBooleanMacro(VertexLabelVisibility, bool);
84 
86 
89  void SetHideVertexLabelsOnInteraction(bool vis);
90  bool GetHideVertexLabelsOnInteraction();
91  vtkBooleanMacro(HideVertexLabelsOnInteraction, bool);
93 
95 
98  void SetEdgeVisibility(bool vis);
99  bool GetEdgeVisibility();
100  vtkBooleanMacro(EdgeVisibility, bool);
102 
104 
107  void SetEdgeLabelVisibility(bool vis);
108  bool GetEdgeLabelVisibility();
109  vtkBooleanMacro(EdgeLabelVisibility, bool);
111 
113 
116  void SetHideEdgeLabelsOnInteraction(bool vis);
117  bool GetHideEdgeLabelsOnInteraction();
118  vtkBooleanMacro(HideEdgeLabelsOnInteraction, bool);
120 
122 
126  void SetVertexColorArrayName(const char* name);
127  const char* GetVertexColorArrayName();
129 
131 
134  void SetColorVertices(bool vis);
135  bool GetColorVertices();
136  vtkBooleanMacro(ColorVertices, bool);
138 
140 
143  void SetEdgeColorArrayName(const char* name);
144  const char* GetEdgeColorArrayName();
146 
148 
151  void SetColorEdges(bool vis);
152  bool GetColorEdges();
153  vtkBooleanMacro(ColorEdges, bool);
155 
157 
160  void SetEdgeSelection(bool vis);
161  bool GetEdgeSelection();
162  vtkBooleanMacro(EdgeSelection, bool);
164 
166 
169  void SetEnabledEdgesArrayName(const char* name);
170  const char* GetEnabledEdgesArrayName();
172 
174 
177  void SetEnableEdgesByArray(bool vis);
178  int GetEnableEdgesByArray();
180 
182 
185  void SetEnabledVerticesArrayName(const char* name);
186  const char* GetEnabledVerticesArrayName();
188 
190 
193  void SetEnableVerticesByArray(bool vis);
194  int GetEnableVerticesByArray();
196 
198 
201  void SetScalingArrayName(const char* name);
202  const char* GetScalingArrayName();
204 
206 
209  void SetScaledGlyphs(bool arg);
210  bool GetScaledGlyphs();
211  vtkBooleanMacro(ScaledGlyphs, bool);
213 
215 
233  void SetLayoutStrategy(const char* name);
235  { this->SetLayoutStrategy("Random"); }
237  { this->SetLayoutStrategy("Force Directed"); }
239  { this->SetLayoutStrategy("Simple 2D"); }
241  { this->SetLayoutStrategy("Clustering 2D"); }
243  { this->SetLayoutStrategy("Community 2D"); }
245  { this->SetLayoutStrategy("Fast 2D"); }
247  { this->SetLayoutStrategy("Pass Through"); }
249  { this->SetLayoutStrategy("Circular"); }
251  { this->SetLayoutStrategy("Tree"); }
253  { this->SetLayoutStrategy("Cosmic Tree"); }
255  { this->SetLayoutStrategy("Cone"); }
257  { this->SetLayoutStrategy("Span Tree"); }
258  const char* GetLayoutStrategyName();
260 
262 
267  vtkGraphLayoutStrategy* GetLayoutStrategy();
268  void SetLayoutStrategy(vtkGraphLayoutStrategy *s);
270 
272 
279  void SetEdgeLayoutStrategy(const char* name);
281  { this->SetEdgeLayoutStrategy("Arc Parallel"); }
283  { this->SetEdgeLayoutStrategy("Pass Through"); }
284  const char* GetEdgeLayoutStrategyName();
286 
288 
293  vtkEdgeLayoutStrategy* GetEdgeLayoutStrategy();
294  void SetEdgeLayoutStrategy(vtkEdgeLayoutStrategy *s);
296 
302  void AddIconType(const char *type, int index);
303 
307  void ClearIconTypes();
308 
313  void SetIconAlignment(int alignment);
314 
316 
319  void SetIconVisibility(bool b);
320  bool GetIconVisibility();
321  vtkBooleanMacro(IconVisibility, bool);
323 
325 
328  void SetIconArrayName(const char* name);
329  const char* GetIconArrayName();
331 
333 
336  void SetGlyphType(int type);
337  int GetGlyphType();
339 
341 
344  virtual void SetVertexLabelFontSize(const int size);
345  virtual int GetVertexLabelFontSize();
347 
349 
352  virtual void SetEdgeLabelFontSize(const int size);
353  virtual int GetEdgeLabelFontSize();
355 
357 
360  void SetEdgeScalarBarVisibility(bool vis);
361  bool GetEdgeScalarBarVisibility();
363 
365 
368  void SetVertexScalarBarVisibility(bool vis);
369  bool GetVertexScalarBarVisibility();
371 
375  void ZoomToSelection();
376 
383  virtual int IsLayoutComplete();
384 
395  virtual void UpdateLayout();
396 
397 protected:
399  ~vtkGraphLayoutView() override;
400 
402 
407  virtual vtkRenderedGraphRepresentation* GetGraphRepresentation();
408  // Called to process events. Overrides behavior in vtkRenderView.
409  void ProcessEvents(vtkObject* caller, unsigned long eventId, void* callData) override;
411 
412 private:
413  vtkGraphLayoutView(const vtkGraphLayoutView&) = delete;
414  void operator=(const vtkGraphLayoutView&) = delete;
415  bool VertexLabelsRequested;
416  bool EdgeLabelsRequested;
417 };
418 
419 #endif
vtkGraphLayoutView::SetLayoutStrategyToRandom
void SetLayoutStrategyToRandom()
Definition: vtkGraphLayoutView.h:234
vtkRenderView
A view containing a renderer.
Definition: vtkRenderView.h:58
vtkX3D::type
Definition: vtkX3D.h:516
vtkGraphLayoutView::SetLayoutStrategyToClustering2D
void SetLayoutStrategyToClustering2D()
Definition: vtkGraphLayoutView.h:240
vtkGraphLayoutStrategy
abstract superclass for all graph layout strategies
Definition: vtkGraphLayoutStrategy.h:45
vtkGraphLayoutView::SetLayoutStrategyToCommunity2D
void SetLayoutStrategyToCommunity2D()
Definition: vtkGraphLayoutView.h:242
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:53
vtkGraphLayoutView::SetLayoutStrategyToForceDirected
void SetLayoutStrategyToForceDirected()
Definition: vtkGraphLayoutView.h:236
vtkRenderView.h
vtkRenderedGraphRepresentation
Definition: vtkRenderedGraphRepresentation.h:64
vtkGraphLayoutView::SetEdgeLayoutStrategyToPassThrough
void SetEdgeLayoutStrategyToPassThrough()
Definition: vtkGraphLayoutView.h:282
vtkGraphLayoutView::SetLayoutStrategyToCircular
void SetLayoutStrategyToCircular()
Definition: vtkGraphLayoutView.h:248
vtkRenderView::ProcessEvents
void ProcessEvents(vtkObject *caller, unsigned long eventId, void *callData) override
Called to process events.
vtkGraphLayoutView
Lays out and displays a graph.
Definition: vtkGraphLayoutView.h:53
vtkGraphLayoutView::SetLayoutStrategyToPassThrough
void SetLayoutStrategyToPassThrough()
Definition: vtkGraphLayoutView.h:246
vtkViewTheme
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:42
vtkDataRepresentation
The superclass for all representations.
Definition: vtkDataRepresentation.h:66
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkRenderView::New
static vtkRenderView * New()
vtkX3D::size
Definition: vtkX3D.h:253
vtkGraphLayoutView::SetLayoutStrategyToTree
void SetLayoutStrategyToTree()
Definition: vtkGraphLayoutView.h:250
vtkRenderView::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkX3D::name
Definition: vtkX3D.h:219
vtkGraphLayoutView::SetLayoutStrategyToCone
void SetLayoutStrategyToCone()
Definition: vtkGraphLayoutView.h:254
vtkGraphLayoutView::SetLayoutStrategyToFast2D
void SetLayoutStrategyToFast2D()
Definition: vtkGraphLayoutView.h:244
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:36
vtkGraphLayoutView::SetEdgeLayoutStrategyToArcParallel
void SetEdgeLayoutStrategyToArcParallel()
Definition: vtkGraphLayoutView.h:280
vtkGraphLayoutView::SetLayoutStrategyToSimple2D
void SetLayoutStrategyToSimple2D()
Definition: vtkGraphLayoutView.h:238
vtkGraphLayoutView::SetLayoutStrategyToCosmicTree
void SetLayoutStrategyToCosmicTree()
Definition: vtkGraphLayoutView.h:252
vtkView::CreateDefaultRepresentation
virtual vtkDataRepresentation * CreateDefaultRepresentation(vtkAlgorithmOutput *conn)
Create a default vtkDataRepresentation for the given vtkAlgorithmOutput.
vtkEdgeLayoutStrategy
abstract superclass for all edge layout strategies
Definition: vtkEdgeLayoutStrategy.h:36
vtkGraphLayoutView::SetLayoutStrategyToSpanTree
void SetLayoutStrategyToSpanTree()
Definition: vtkGraphLayoutView.h:256
vtkX3D::index
Definition: vtkX3D.h:246