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 -------------------------------------------------------------------------*/
48 #ifndef vtkGraphLayoutView_h
49 #define vtkGraphLayoutView_h
50 
51 #include "vtkViewsInfovisModule.h" // For export macro
52 #include "vtkRenderView.h"
53 
57 class vtkViewTheme;
58 
59 class VTKVIEWSINFOVIS_EXPORT vtkGraphLayoutView : public vtkRenderView
60 {
61 public:
62  static vtkGraphLayoutView *New();
64  void PrintSelf(ostream& os, vtkIndent indent) override;
65 
67 
70  void SetVertexLabelArrayName(const char* name);
71  const char* GetVertexLabelArrayName();
73 
75 
78  void SetEdgeLabelArrayName(const char* name);
79  const char* GetEdgeLabelArrayName();
81 
83 
86  void SetVertexLabelVisibility(bool vis);
87  bool GetVertexLabelVisibility();
88  vtkBooleanMacro(VertexLabelVisibility, bool);
90 
92 
95  void SetHideVertexLabelsOnInteraction(bool vis);
96  bool GetHideVertexLabelsOnInteraction();
97  vtkBooleanMacro(HideVertexLabelsOnInteraction, bool);
99 
101 
104  void SetEdgeVisibility(bool vis);
105  bool GetEdgeVisibility();
106  vtkBooleanMacro(EdgeVisibility, bool);
108 
110 
113  void SetEdgeLabelVisibility(bool vis);
114  bool GetEdgeLabelVisibility();
115  vtkBooleanMacro(EdgeLabelVisibility, bool);
117 
119 
122  void SetHideEdgeLabelsOnInteraction(bool vis);
123  bool GetHideEdgeLabelsOnInteraction();
124  vtkBooleanMacro(HideEdgeLabelsOnInteraction, bool);
126 
128 
132  void SetVertexColorArrayName(const char* name);
133  const char* GetVertexColorArrayName();
135 
137 
140  void SetColorVertices(bool vis);
141  bool GetColorVertices();
142  vtkBooleanMacro(ColorVertices, bool);
144 
146 
149  void SetEdgeColorArrayName(const char* name);
150  const char* GetEdgeColorArrayName();
152 
154 
157  void SetColorEdges(bool vis);
158  bool GetColorEdges();
159  vtkBooleanMacro(ColorEdges, bool);
161 
163 
166  void SetEdgeSelection(bool vis);
167  bool GetEdgeSelection();
168  vtkBooleanMacro(EdgeSelection, bool);
170 
172 
175  void SetEnabledEdgesArrayName(const char* name);
176  const char* GetEnabledEdgesArrayName();
178 
180 
183  void SetEnableEdgesByArray(bool vis);
184  int GetEnableEdgesByArray();
186 
188 
191  void SetEnabledVerticesArrayName(const char* name);
192  const char* GetEnabledVerticesArrayName();
194 
196 
199  void SetEnableVerticesByArray(bool vis);
200  int GetEnableVerticesByArray();
202 
204 
207  void SetScalingArrayName(const char* name);
208  const char* GetScalingArrayName();
210 
212 
215  void SetScaledGlyphs(bool arg);
216  bool GetScaledGlyphs();
217  vtkBooleanMacro(ScaledGlyphs, bool);
219 
221 
239  void SetLayoutStrategy(const char* name);
241  { this->SetLayoutStrategy("Random"); }
243  { this->SetLayoutStrategy("Force Directed"); }
245  { this->SetLayoutStrategy("Simple 2D"); }
247  { this->SetLayoutStrategy("Clustering 2D"); }
249  { this->SetLayoutStrategy("Community 2D"); }
251  { this->SetLayoutStrategy("Fast 2D"); }
253  { this->SetLayoutStrategy("Pass Through"); }
255  { this->SetLayoutStrategy("Circular"); }
257  { this->SetLayoutStrategy("Tree"); }
259  { this->SetLayoutStrategy("Cosmic Tree"); }
261  { this->SetLayoutStrategy("Cone"); }
263  { this->SetLayoutStrategy("Span Tree"); }
264  const char* GetLayoutStrategyName();
266 
268 
273  vtkGraphLayoutStrategy* GetLayoutStrategy();
274  void SetLayoutStrategy(vtkGraphLayoutStrategy *s);
276 
278 
285  void SetEdgeLayoutStrategy(const char* name);
287  { this->SetEdgeLayoutStrategy("Arc Parallel"); }
289  { this->SetEdgeLayoutStrategy("Pass Through"); }
290  const char* GetEdgeLayoutStrategyName();
292 
294 
299  vtkEdgeLayoutStrategy* GetEdgeLayoutStrategy();
300  void SetEdgeLayoutStrategy(vtkEdgeLayoutStrategy *s);
302 
308  void AddIconType(const char *type, int index);
309 
313  void ClearIconTypes();
314 
319  void SetIconAlignment(int alignment);
320 
322 
325  void SetIconVisibility(bool b);
326  bool GetIconVisibility();
327  vtkBooleanMacro(IconVisibility, bool);
329 
331 
334  void SetIconArrayName(const char* name);
335  const char* GetIconArrayName();
337 
339 
342  void SetGlyphType(int type);
343  int GetGlyphType();
345 
347 
350  virtual void SetVertexLabelFontSize(const int size);
351  virtual int GetVertexLabelFontSize();
353 
355 
358  virtual void SetEdgeLabelFontSize(const int size);
359  virtual int GetEdgeLabelFontSize();
361 
363 
366  void SetEdgeScalarBarVisibility(bool vis);
367  bool GetEdgeScalarBarVisibility();
369 
371 
374  void SetVertexScalarBarVisibility(bool vis);
375  bool GetVertexScalarBarVisibility();
377 
381  void ZoomToSelection();
382 
389  virtual int IsLayoutComplete();
390 
401  virtual void UpdateLayout();
402 
403 protected:
405  ~vtkGraphLayoutView() override;
406 
408 
413  virtual vtkRenderedGraphRepresentation* GetGraphRepresentation();
414  // Called to process events. Overrides behavior in vtkRenderView.
415  void ProcessEvents(vtkObject* caller, unsigned long eventId, void* callData) override;
417 
418 private:
419  vtkGraphLayoutView(const vtkGraphLayoutView&) = delete;
420  void operator=(const vtkGraphLayoutView&) = delete;
421  bool VertexLabelsRequested;
422  bool EdgeLabelsRequested;
423 };
424 
425 #endif
vtkGraphLayoutView::SetLayoutStrategyToRandom
void SetLayoutStrategyToRandom()
Definition: vtkGraphLayoutView.h:240
vtkRenderView
A view containing a renderer.
Definition: vtkRenderView.h:61
vtkX3D::type
Definition: vtkX3D.h:516
vtkGraphLayoutView::SetLayoutStrategyToClustering2D
void SetLayoutStrategyToClustering2D()
Definition: vtkGraphLayoutView.h:246
vtkGraphLayoutStrategy
abstract superclass for all graph layout strategies
Definition: vtkGraphLayoutStrategy.h:45
vtkGraphLayoutView::SetLayoutStrategyToCommunity2D
void SetLayoutStrategyToCommunity2D()
Definition: vtkGraphLayoutView.h:248
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:59
vtkGraphLayoutView::SetLayoutStrategyToForceDirected
void SetLayoutStrategyToForceDirected()
Definition: vtkGraphLayoutView.h:242
vtkRenderView.h
vtkRenderedGraphRepresentation
Definition: vtkRenderedGraphRepresentation.h:70
vtkGraphLayoutView::SetEdgeLayoutStrategyToPassThrough
void SetEdgeLayoutStrategyToPassThrough()
Definition: vtkGraphLayoutView.h:288
vtkGraphLayoutView::SetLayoutStrategyToCircular
void SetLayoutStrategyToCircular()
Definition: vtkGraphLayoutView.h:254
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:59
vtkGraphLayoutView::SetLayoutStrategyToPassThrough
void SetLayoutStrategyToPassThrough()
Definition: vtkGraphLayoutView.h:252
vtkViewTheme
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:48
vtkDataRepresentation
The superclass for all representations.
Definition: vtkDataRepresentation.h:69
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkRenderView::New
static vtkRenderView * New()
vtkX3D::size
Definition: vtkX3D.h:253
vtkGraphLayoutView::SetLayoutStrategyToTree
void SetLayoutStrategyToTree()
Definition: vtkGraphLayoutView.h:256
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:260
vtkGraphLayoutView::SetLayoutStrategyToFast2D
void SetLayoutStrategyToFast2D()
Definition: vtkGraphLayoutView.h:250
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:39
vtkGraphLayoutView::SetEdgeLayoutStrategyToArcParallel
void SetEdgeLayoutStrategyToArcParallel()
Definition: vtkGraphLayoutView.h:286
vtkGraphLayoutView::SetLayoutStrategyToSimple2D
void SetLayoutStrategyToSimple2D()
Definition: vtkGraphLayoutView.h:244
vtkGraphLayoutView::SetLayoutStrategyToCosmicTree
void SetLayoutStrategyToCosmicTree()
Definition: vtkGraphLayoutView.h:258
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:262
vtkX3D::index
Definition: vtkX3D.h:246