VTK  9.3.1
vtkGraphLayoutView.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright 2008 Sandia Corporation
3 // SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
32 #ifndef vtkGraphLayoutView_h
33 #define vtkGraphLayoutView_h
34 
35 #include "vtkRenderView.h"
36 #include "vtkViewsInfovisModule.h" // For export macro
37 
38 VTK_ABI_NAMESPACE_BEGIN
42 class vtkViewTheme;
43 
44 class VTKVIEWSINFOVIS_EXPORT vtkGraphLayoutView : public vtkRenderView
45 {
46 public:
47  static vtkGraphLayoutView* New();
49  void PrintSelf(ostream& os, vtkIndent indent) override;
50 
52 
55  void SetVertexLabelArrayName(const char* name);
56  const char* GetVertexLabelArrayName();
58 
60 
63  void SetEdgeLabelArrayName(const char* name);
64  const char* GetEdgeLabelArrayName();
66 
68 
71  void SetVertexLabelVisibility(bool vis);
72  bool GetVertexLabelVisibility();
73  vtkBooleanMacro(VertexLabelVisibility, bool);
75 
77 
80  void SetHideVertexLabelsOnInteraction(bool vis);
81  bool GetHideVertexLabelsOnInteraction();
82  vtkBooleanMacro(HideVertexLabelsOnInteraction, bool);
84 
86 
89  void SetEdgeVisibility(bool vis);
90  bool GetEdgeVisibility();
91  vtkBooleanMacro(EdgeVisibility, bool);
93 
95 
98  void SetEdgeLabelVisibility(bool vis);
99  bool GetEdgeLabelVisibility();
100  vtkBooleanMacro(EdgeLabelVisibility, bool);
102 
104 
107  void SetHideEdgeLabelsOnInteraction(bool vis);
108  bool GetHideEdgeLabelsOnInteraction();
109  vtkBooleanMacro(HideEdgeLabelsOnInteraction, bool);
111 
113 
117  void SetVertexColorArrayName(const char* name);
118  const char* GetVertexColorArrayName();
120 
122 
125  void SetColorVertices(bool vis);
126  bool GetColorVertices();
127  vtkBooleanMacro(ColorVertices, bool);
129 
131 
134  void SetEdgeColorArrayName(const char* name);
135  const char* GetEdgeColorArrayName();
137 
139 
142  void SetColorEdges(bool vis);
143  bool GetColorEdges();
144  vtkBooleanMacro(ColorEdges, bool);
146 
148 
151  void SetEdgeSelection(bool vis);
152  bool GetEdgeSelection();
153  vtkBooleanMacro(EdgeSelection, bool);
155 
157 
160  void SetEnabledEdgesArrayName(const char* name);
161  const char* GetEnabledEdgesArrayName();
163 
165 
168  void SetEnableEdgesByArray(bool vis);
169  int GetEnableEdgesByArray();
171 
173 
176  void SetEnabledVerticesArrayName(const char* name);
177  const char* GetEnabledVerticesArrayName();
179 
181 
184  void SetEnableVerticesByArray(bool vis);
185  int GetEnableVerticesByArray();
187 
189 
192  void SetScalingArrayName(const char* name);
193  const char* GetScalingArrayName();
195 
197 
200  void SetScaledGlyphs(bool arg);
201  bool GetScaledGlyphs();
202  vtkBooleanMacro(ScaledGlyphs, bool);
204 
206 
224  void SetLayoutStrategy(const char* name);
225  void SetLayoutStrategyToRandom() { this->SetLayoutStrategy("Random"); }
226  void SetLayoutStrategyToForceDirected() { this->SetLayoutStrategy("Force Directed"); }
227  void SetLayoutStrategyToSimple2D() { this->SetLayoutStrategy("Simple 2D"); }
228  void SetLayoutStrategyToClustering2D() { this->SetLayoutStrategy("Clustering 2D"); }
229  void SetLayoutStrategyToCommunity2D() { this->SetLayoutStrategy("Community 2D"); }
230  void SetLayoutStrategyToFast2D() { this->SetLayoutStrategy("Fast 2D"); }
231  void SetLayoutStrategyToPassThrough() { this->SetLayoutStrategy("Pass Through"); }
232  void SetLayoutStrategyToCircular() { this->SetLayoutStrategy("Circular"); }
233  void SetLayoutStrategyToTree() { this->SetLayoutStrategy("Tree"); }
234  void SetLayoutStrategyToCosmicTree() { this->SetLayoutStrategy("Cosmic Tree"); }
235  void SetLayoutStrategyToCone() { this->SetLayoutStrategy("Cone"); }
236  void SetLayoutStrategyToSpanTree() { this->SetLayoutStrategy("Span Tree"); }
237  const char* GetLayoutStrategyName();
239 
241 
246  vtkGraphLayoutStrategy* GetLayoutStrategy();
247  void SetLayoutStrategy(vtkGraphLayoutStrategy* s);
249 
251 
258  void SetEdgeLayoutStrategy(const char* name);
259  void SetEdgeLayoutStrategyToArcParallel() { this->SetEdgeLayoutStrategy("Arc Parallel"); }
260  void SetEdgeLayoutStrategyToPassThrough() { this->SetEdgeLayoutStrategy("Pass Through"); }
261  const char* GetEdgeLayoutStrategyName();
263 
265 
270  vtkEdgeLayoutStrategy* GetEdgeLayoutStrategy();
271  void SetEdgeLayoutStrategy(vtkEdgeLayoutStrategy* s);
273 
279  void AddIconType(const char* type, int index);
280 
284  void ClearIconTypes();
285 
290  void SetIconAlignment(int alignment);
291 
293 
296  void SetIconVisibility(bool b);
297  bool GetIconVisibility();
298  vtkBooleanMacro(IconVisibility, bool);
300 
302 
305  void SetIconArrayName(const char* name);
306  const char* GetIconArrayName();
308 
310 
313  void SetGlyphType(int type);
314  int GetGlyphType();
316 
318 
321  virtual void SetVertexLabelFontSize(int size);
322  virtual int GetVertexLabelFontSize();
324 
326 
329  virtual void SetEdgeLabelFontSize(int size);
330  virtual int GetEdgeLabelFontSize();
332 
334 
337  void SetEdgeScalarBarVisibility(bool vis);
338  bool GetEdgeScalarBarVisibility();
340 
342 
345  void SetVertexScalarBarVisibility(bool vis);
346  bool GetVertexScalarBarVisibility();
348 
352  void ZoomToSelection();
353 
360  virtual int IsLayoutComplete();
361 
372  virtual void UpdateLayout();
373 
374 protected:
376  ~vtkGraphLayoutView() override;
377 
379 
384  virtual vtkRenderedGraphRepresentation* GetGraphRepresentation();
385  // Called to process events. Overrides behavior in vtkRenderView.
386  void ProcessEvents(vtkObject* caller, unsigned long eventId, void* callData) override;
388 
389 private:
390  vtkGraphLayoutView(const vtkGraphLayoutView&) = delete;
391  void operator=(const vtkGraphLayoutView&) = delete;
392  bool VertexLabelsRequested;
393  bool EdgeLabelsRequested;
394 };
395 
396 VTK_ABI_NAMESPACE_END
397 #endif
void SetLayoutStrategyToCosmicTree()
The layout strategy to use when performing the graph layout.
abstract base class for most VTK objects
Definition: vtkObject.h:51
Lays out and displays a graph.
void SetLayoutStrategyToTree()
The layout strategy to use when performing the graph layout.
static vtkRenderView * New()
void SetLayoutStrategyToSimple2D()
The layout strategy to use when performing the graph layout.
void SetLayoutStrategyToRandom()
The layout strategy to use when performing the graph layout.
void SetEdgeLayoutStrategyToArcParallel()
The layout strategy to use when performing the edge layout.
Proxy object to connect input/output ports.
abstract superclass for all graph layout strategies
void SetLayoutStrategyToSpanTree()
The layout strategy to use when performing the graph layout.
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:33
a simple class to control print indentation
Definition: vtkIndent.h:28
void ProcessEvents(vtkObject *caller, unsigned long eventId, void *callData) override
Called to process events.
void SetLayoutStrategyToCone()
The layout strategy to use when performing the graph layout.
The superclass for all representations.
void SetLayoutStrategyToCircular()
The layout strategy to use when performing the graph layout.
void SetLayoutStrategyToFast2D()
The layout strategy to use when performing the graph layout.
void SetLayoutStrategyToClustering2D()
The layout strategy to use when performing the graph layout.
void SetLayoutStrategyToForceDirected()
The layout strategy to use when performing the graph layout.
void SetEdgeLayoutStrategyToPassThrough()
The layout strategy to use when performing the edge layout.
A view containing a renderer.
Definition: vtkRenderView.h:49
abstract superclass for all edge layout strategies
void SetLayoutStrategyToPassThrough()
The layout strategy to use when performing the graph layout.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetLayoutStrategyToCommunity2D()
The layout strategy to use when performing the graph layout.
virtual vtkDataRepresentation * CreateDefaultRepresentation(vtkAlgorithmOutput *conn)
Create a default vtkDataRepresentation for the given vtkAlgorithmOutput.