VTK  9.0.1
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 "vtkRenderView.h"
46 #include "vtkViewsInfovisModule.h" // For export macro
47 
51 class vtkViewTheme;
52 
53 class VTKVIEWSINFOVIS_EXPORT vtkGraphLayoutView : public vtkRenderView
54 {
55 public:
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);
82  vtkBooleanMacro(VertexLabelVisibility, bool);
84 
86 
91  vtkBooleanMacro(HideVertexLabelsOnInteraction, bool);
93 
95 
98  void SetEdgeVisibility(bool vis);
100  vtkBooleanMacro(EdgeVisibility, bool);
102 
104 
107  void SetEdgeLabelVisibility(bool vis);
109  vtkBooleanMacro(EdgeLabelVisibility, bool);
111 
113 
118  vtkBooleanMacro(HideEdgeLabelsOnInteraction, bool);
120 
122 
126  void SetVertexColorArrayName(const char* name);
127  const char* GetVertexColorArrayName();
129 
131 
134  void SetColorVertices(bool vis);
136  vtkBooleanMacro(ColorVertices, bool);
138 
140 
143  void SetEdgeColorArrayName(const char* name);
144  const char* GetEdgeColorArrayName();
146 
148 
151  void SetColorEdges(bool vis);
153  vtkBooleanMacro(ColorEdges, bool);
155 
157 
160  void SetEdgeSelection(bool vis);
162  vtkBooleanMacro(EdgeSelection, bool);
164 
166 
169  void SetEnabledEdgesArrayName(const char* name);
172 
174 
177  void SetEnableEdgesByArray(bool vis);
180 
182 
188 
190 
193  void SetEnableVerticesByArray(bool vis);
196 
198 
201  void SetScalingArrayName(const char* name);
202  const char* GetScalingArrayName();
204 
206 
209  void SetScaledGlyphs(bool arg);
211  vtkBooleanMacro(ScaledGlyphs, bool);
213 
215 
233  void SetLayoutStrategy(const char* name);
234  void SetLayoutStrategyToRandom() { this->SetLayoutStrategy("Random"); }
235  void SetLayoutStrategyToForceDirected() { this->SetLayoutStrategy("Force Directed"); }
236  void SetLayoutStrategyToSimple2D() { this->SetLayoutStrategy("Simple 2D"); }
237  void SetLayoutStrategyToClustering2D() { this->SetLayoutStrategy("Clustering 2D"); }
238  void SetLayoutStrategyToCommunity2D() { this->SetLayoutStrategy("Community 2D"); }
239  void SetLayoutStrategyToFast2D() { this->SetLayoutStrategy("Fast 2D"); }
240  void SetLayoutStrategyToPassThrough() { this->SetLayoutStrategy("Pass Through"); }
241  void SetLayoutStrategyToCircular() { this->SetLayoutStrategy("Circular"); }
242  void SetLayoutStrategyToTree() { this->SetLayoutStrategy("Tree"); }
243  void SetLayoutStrategyToCosmicTree() { this->SetLayoutStrategy("Cosmic Tree"); }
244  void SetLayoutStrategyToCone() { this->SetLayoutStrategy("Cone"); }
245  void SetLayoutStrategyToSpanTree() { this->SetLayoutStrategy("Span Tree"); }
246  const char* GetLayoutStrategyName();
248 
250 
258 
260 
267  void SetEdgeLayoutStrategy(const char* name);
268  void SetEdgeLayoutStrategyToArcParallel() { this->SetEdgeLayoutStrategy("Arc Parallel"); }
269  void SetEdgeLayoutStrategyToPassThrough() { this->SetEdgeLayoutStrategy("Pass Through"); }
272 
274 
282 
288  void AddIconType(const char* type, int index);
289 
294 
299  void SetIconAlignment(int alignment);
300 
302 
305  void SetIconVisibility(bool b);
307  vtkBooleanMacro(IconVisibility, bool);
309 
311 
314  void SetIconArrayName(const char* name);
315  const char* GetIconArrayName();
317 
319 
322  void SetGlyphType(int type);
325 
327 
330  virtual void SetVertexLabelFontSize(const int size);
331  virtual int GetVertexLabelFontSize();
333 
335 
338  virtual void SetEdgeLabelFontSize(const int size);
339  virtual int GetEdgeLabelFontSize();
341 
343 
349 
351 
357 
362 
369  virtual int IsLayoutComplete();
370 
381  virtual void UpdateLayout();
382 
383 protected:
386 
388 
394  // Called to process events. Overrides behavior in vtkRenderView.
395  void ProcessEvents(vtkObject* caller, unsigned long eventId, void* callData) override;
397 
398 private:
399  vtkGraphLayoutView(const vtkGraphLayoutView&) = delete;
400  void operator=(const vtkGraphLayoutView&) = delete;
401  bool VertexLabelsRequested;
402  bool EdgeLabelsRequested;
403 };
404 
405 #endif
vtkGraphLayoutView::GetHideEdgeLabelsOnInteraction
bool GetHideEdgeLabelsOnInteraction()
vtkGraphLayoutView::GetHideVertexLabelsOnInteraction
bool GetHideVertexLabelsOnInteraction()
vtkGraphLayoutView::SetScaledGlyphs
void SetScaledGlyphs(bool arg)
Whether to use scaled glyphs or not.
vtkGraphLayoutView::SetVertexLabelFontSize
virtual void SetVertexLabelFontSize(const int size)
The size of the font used for vertex labeling.
vtkGraphLayoutView::GetGlyphType
int GetGlyphType()
vtkGraphLayoutView::New
static vtkGraphLayoutView * New()
vtkGraphLayoutView::SetEdgeVisibility
void SetEdgeVisibility(bool vis)
Whether to show the edges at all.
vtkGraphLayoutView::SetLayoutStrategyToRandom
void SetLayoutStrategyToRandom()
Definition: vtkGraphLayoutView.h:234
vtkRenderView
A view containing a renderer.
Definition: vtkRenderView.h:59
vtkGraphLayoutView::SetEdgeLabelFontSize
virtual void SetEdgeLabelFontSize(const int size)
The size of the font used for edge labeling.
vtkGraphLayoutView::SetHideVertexLabelsOnInteraction
void SetHideVertexLabelsOnInteraction(bool vis)
Whether to hide vertex labels during mouse interactions.
vtkGraphLayoutView::ZoomToSelection
void ZoomToSelection()
Reset the camera based on the bounds of the selected region.
vtkGraphLayoutView::AddIconType
void AddIconType(const char *type, int index)
Associate the icon at index "index" in the vtkTexture to all vertices containing "type" as a value in...
vtkX3D::type
@ type
Definition: vtkX3D.h:522
vtkGraphLayoutView::GetVertexLabelVisibility
bool GetVertexLabelVisibility()
vtkGraphLayoutView::SetEdgeLayoutStrategy
void SetEdgeLayoutStrategy(const char *name)
The layout strategy to use when performing the edge layout.
vtkGraphLayoutView::SetLayoutStrategyToClustering2D
void SetLayoutStrategyToClustering2D()
Definition: vtkGraphLayoutView.h:237
vtkGraphLayoutStrategy
abstract superclass for all graph layout strategies
Definition: vtkGraphLayoutStrategy.h:46
vtkGraphLayoutView::SetLayoutStrategyToCommunity2D
void SetLayoutStrategyToCommunity2D()
Definition: vtkGraphLayoutView.h:238
vtkGraphLayoutView::GetColorEdges
bool GetColorEdges()
vtkGraphLayoutView::SetScalingArrayName
void SetScalingArrayName(const char *name)
The array used for scaling (if ScaledGlyphs is ON)
vtkGraphLayoutView::SetIconAlignment
void SetIconAlignment(int alignment)
Specify where the icons should be placed in relation to the vertex.
vtkGraphLayoutView::SetColorVertices
void SetColorVertices(bool vis)
Whether to color vertices.
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:54
vtkGraphLayoutView::SetLayoutStrategyToForceDirected
void SetLayoutStrategyToForceDirected()
Definition: vtkGraphLayoutView.h:235
vtkGraphLayoutView::IsLayoutComplete
virtual int IsLayoutComplete()
Is the graph layout complete? This method is useful for when the strategy is iterative and the applic...
vtkGraphLayoutView::GetVertexScalarBarVisibility
bool GetVertexScalarBarVisibility()
vtkGraphLayoutView::SetHideEdgeLabelsOnInteraction
void SetHideEdgeLabelsOnInteraction(bool vis)
Whether to hide edge labels during mouse interactions.
vtkGraphLayoutView::SetVertexScalarBarVisibility
void SetVertexScalarBarVisibility(bool vis)
Whether the scalar bar for vertices is visible.
vtkGraphLayoutView::GetIconVisibility
bool GetIconVisibility()
vtkGraphLayoutView::SetEdgeLabelArrayName
void SetEdgeLabelArrayName(const char *name)
The array to use for edge labeling.
vtkRenderView.h
vtkRenderedGraphRepresentation
Definition: vtkRenderedGraphRepresentation.h:65
vtkGraphLayoutView::GetScalingArrayName
const char * GetScalingArrayName()
vtkGraphLayoutView::SetEdgeLayoutStrategyToPassThrough
void SetEdgeLayoutStrategyToPassThrough()
Definition: vtkGraphLayoutView.h:269
vtkGraphLayoutView::SetLayoutStrategyToCircular
void SetLayoutStrategyToCircular()
Definition: vtkGraphLayoutView.h:241
vtkGraphLayoutView::ClearIconTypes
void ClearIconTypes()
Clear all icon mappings.
vtkGraphLayoutView
Lays out and displays a graph.
Definition: vtkGraphLayoutView.h:54
vtkGraphLayoutView::GetEdgeLabelFontSize
virtual int GetEdgeLabelFontSize()
vtkGraphLayoutView::UpdateLayout
virtual void UpdateLayout()
This method is useful for when the strategy is iterative and the application wants to show the iterat...
vtkGraphLayoutView::SetLayoutStrategyToPassThrough
void SetLayoutStrategyToPassThrough()
Definition: vtkGraphLayoutView.h:240
vtkGraphLayoutView::SetEnabledVerticesArrayName
void SetEnabledVerticesArrayName(const char *name)
The array to use for coloring vertices.
vtkGraphLayoutView::GetEdgeLayoutStrategy
vtkEdgeLayoutStrategy * GetEdgeLayoutStrategy()
The layout strategy to use when performing the edge layout.
vtkGraphLayoutView::SetEnableEdgesByArray
void SetEnableEdgesByArray(bool vis)
Whether to color edges.
vtkViewTheme
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:43
vtkGraphLayoutView::GetEdgeVisibility
bool GetEdgeVisibility()
vtkGraphLayoutView::SetEnabledEdgesArrayName
void SetEnabledEdgesArrayName(const char *name)
The array to use for coloring edges.
vtkGraphLayoutView::SetEdgeColorArrayName
void SetEdgeColorArrayName(const char *name)
The array to use for coloring edges.
vtkDataRepresentation
The superclass for all representations.
Definition: vtkDataRepresentation.h:67
vtkGraphLayoutView::GetEnableVerticesByArray
int GetEnableVerticesByArray()
vtkGraphLayoutView::GetGraphRepresentation
virtual vtkRenderedGraphRepresentation * GetGraphRepresentation()
vtkGraphLayoutView::GetEnabledEdgesArrayName
const char * GetEnabledEdgesArrayName()
vtkGraphLayoutView::SetVertexColorArrayName
void SetVertexColorArrayName(const char *name)
The array to use for coloring vertices.
vtkGraphLayoutView::SetIconArrayName
void SetIconArrayName(const char *name)
The array used for assigning icons.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkGraphLayoutView::SetLayoutStrategy
void SetLayoutStrategy(vtkGraphLayoutStrategy *s)
vtkGraphLayoutView::~vtkGraphLayoutView
~vtkGraphLayoutView() override
vtkGraphLayoutView::GetEdgeLabelVisibility
bool GetEdgeLabelVisibility()
vtkGraphLayoutView::GetEdgeSelection
bool GetEdgeSelection()
vtkGraphLayoutView::SetGlyphType
void SetGlyphType(int type)
The type of glyph to use for the vertices.
vtkGraphLayoutView::SetLayoutStrategy
void SetLayoutStrategy(const char *name)
The layout strategy to use when performing the graph layout.
vtkGraphLayoutView::GetEdgeScalarBarVisibility
bool GetEdgeScalarBarVisibility()
vtkGraphLayoutView::SetVertexLabelArrayName
void SetVertexLabelArrayName(const char *name)
The array to use for vertex labeling.
vtkX3D::size
@ size
Definition: vtkX3D.h:259
vtkGraphLayoutView::SetLayoutStrategyToTree
void SetLayoutStrategyToTree()
Definition: vtkGraphLayoutView.h:242
vtkGraphLayoutView::GetVertexColorArrayName
const char * GetVertexColorArrayName()
vtkGraphLayoutView::GetEdgeColorArrayName
const char * GetEdgeColorArrayName()
vtkGraphLayoutView::GetVertexLabelArrayName
const char * GetVertexLabelArrayName()
vtkGraphLayoutView::GetEnabledVerticesArrayName
const char * GetEnabledVerticesArrayName()
vtkX3D::name
@ name
Definition: vtkX3D.h:225
vtkGraphLayoutView::SetLayoutStrategyToCone
void SetLayoutStrategyToCone()
Definition: vtkGraphLayoutView.h:244
vtkGraphLayoutView::GetIconArrayName
const char * GetIconArrayName()
vtkGraphLayoutView::GetEnableEdgesByArray
int GetEnableEdgesByArray()
vtkGraphLayoutView::SetEdgeLabelVisibility
void SetEdgeLabelVisibility(bool vis)
Whether to show edge labels.
vtkGraphLayoutView::SetIconVisibility
void SetIconVisibility(bool b)
Whether icons are visible (default off).
vtkGraphLayoutView::GetLayoutStrategy
vtkGraphLayoutStrategy * GetLayoutStrategy()
The layout strategy to use when performing the graph layout.
vtkGraphLayoutView::SetEdgeLayoutStrategy
void SetEdgeLayoutStrategy(vtkEdgeLayoutStrategy *s)
vtkGraphLayoutView::SetLayoutStrategyToFast2D
void SetLayoutStrategyToFast2D()
Definition: vtkGraphLayoutView.h:239
vtkGraphLayoutView::SetEdgeScalarBarVisibility
void SetEdgeScalarBarVisibility(bool vis)
Whether the scalar bar for edges is visible.
vtkGraphLayoutView::vtkGraphLayoutView
vtkGraphLayoutView()
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:37
vtkGraphLayoutView::SetEdgeLayoutStrategyToArcParallel
void SetEdgeLayoutStrategyToArcParallel()
Definition: vtkGraphLayoutView.h:268
vtkGraphLayoutView::SetColorEdges
void SetColorEdges(bool vis)
Whether to color edges.
vtkGraphLayoutView::GetVertexLabelFontSize
virtual int GetVertexLabelFontSize()
vtkGraphLayoutView::SetLayoutStrategyToSimple2D
void SetLayoutStrategyToSimple2D()
Definition: vtkGraphLayoutView.h:236
vtkGraphLayoutView::GetEdgeLabelArrayName
const char * GetEdgeLabelArrayName()
vtkGraphLayoutView::SetLayoutStrategyToCosmicTree
void SetLayoutStrategyToCosmicTree()
Definition: vtkGraphLayoutView.h:243
vtkEdgeLayoutStrategy
abstract superclass for all edge layout strategies
Definition: vtkEdgeLayoutStrategy.h:37
vtkGraphLayoutView::SetLayoutStrategyToSpanTree
void SetLayoutStrategyToSpanTree()
Definition: vtkGraphLayoutView.h:245
vtkGraphLayoutView::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkGraphLayoutView::ProcessEvents
void ProcessEvents(vtkObject *caller, unsigned long eventId, void *callData) override
Called to process events.
vtkX3D::index
@ index
Definition: vtkX3D.h:252
vtkGraphLayoutView::GetColorVertices
bool GetColorVertices()
vtkGraphLayoutView::SetEnableVerticesByArray
void SetEnableVerticesByArray(bool vis)
Whether to color vertices.
vtkGraphLayoutView::GetLayoutStrategyName
const char * GetLayoutStrategyName()
vtkGraphLayoutView::SetVertexLabelVisibility
void SetVertexLabelVisibility(bool vis)
Whether to show vertex labels.
vtkGraphLayoutView::GetScaledGlyphs
bool GetScaledGlyphs()
vtkGraphLayoutView::CreateDefaultRepresentation
vtkDataRepresentation * CreateDefaultRepresentation(vtkAlgorithmOutput *conn) override
Overrides behavior in vtkView to create a vtkRenderedGraphRepresentation by default.
vtkGraphLayoutView::GetEdgeLayoutStrategyName
const char * GetEdgeLayoutStrategyName()
vtkGraphLayoutView::SetEdgeSelection
void SetEdgeSelection(bool vis)
Whether edges are selectable.