VTK  9.2.6
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 -------------------------------------------------------------------------*/
157 #ifndef vtkGraphLayoutView_h
158 #define vtkGraphLayoutView_h
159 
160 #include "vtkRenderView.h"
161 #include "vtkViewsInfovisModule.h" // For export macro
162 
166 class vtkViewTheme;
167 
168 class VTKVIEWSINFOVIS_EXPORT vtkGraphLayoutView : public vtkRenderView
169 {
170 public:
173  void PrintSelf(ostream& os, vtkIndent indent) override;
174 
176 
179  void SetVertexLabelArrayName(const char* name);
180  const char* GetVertexLabelArrayName();
182 
184 
187  void SetEdgeLabelArrayName(const char* name);
188  const char* GetEdgeLabelArrayName();
190 
192 
195  void SetVertexLabelVisibility(bool vis);
197  vtkBooleanMacro(VertexLabelVisibility, bool);
199 
201 
206  vtkBooleanMacro(HideVertexLabelsOnInteraction, bool);
208 
210 
213  void SetEdgeVisibility(bool vis);
215  vtkBooleanMacro(EdgeVisibility, bool);
217 
219 
222  void SetEdgeLabelVisibility(bool vis);
224  vtkBooleanMacro(EdgeLabelVisibility, bool);
226 
228 
233  vtkBooleanMacro(HideEdgeLabelsOnInteraction, bool);
235 
237 
241  void SetVertexColorArrayName(const char* name);
242  const char* GetVertexColorArrayName();
244 
246 
249  void SetColorVertices(bool vis);
251  vtkBooleanMacro(ColorVertices, bool);
253 
255 
258  void SetEdgeColorArrayName(const char* name);
259  const char* GetEdgeColorArrayName();
261 
263 
266  void SetColorEdges(bool vis);
268  vtkBooleanMacro(ColorEdges, bool);
270 
272 
275  void SetEdgeSelection(bool vis);
277  vtkBooleanMacro(EdgeSelection, bool);
279 
281 
284  void SetEnabledEdgesArrayName(const char* name);
287 
289 
292  void SetEnableEdgesByArray(bool vis);
295 
297 
303 
305 
308  void SetEnableVerticesByArray(bool vis);
311 
313 
316  void SetScalingArrayName(const char* name);
317  const char* GetScalingArrayName();
319 
321 
324  void SetScaledGlyphs(bool arg);
326  vtkBooleanMacro(ScaledGlyphs, bool);
328 
330 
348  void SetLayoutStrategy(const char* name);
349  void SetLayoutStrategyToRandom() { this->SetLayoutStrategy("Random"); }
350  void SetLayoutStrategyToForceDirected() { this->SetLayoutStrategy("Force Directed"); }
351  void SetLayoutStrategyToSimple2D() { this->SetLayoutStrategy("Simple 2D"); }
352  void SetLayoutStrategyToClustering2D() { this->SetLayoutStrategy("Clustering 2D"); }
353  void SetLayoutStrategyToCommunity2D() { this->SetLayoutStrategy("Community 2D"); }
354  void SetLayoutStrategyToFast2D() { this->SetLayoutStrategy("Fast 2D"); }
355  void SetLayoutStrategyToPassThrough() { this->SetLayoutStrategy("Pass Through"); }
356  void SetLayoutStrategyToCircular() { this->SetLayoutStrategy("Circular"); }
357  void SetLayoutStrategyToTree() { this->SetLayoutStrategy("Tree"); }
358  void SetLayoutStrategyToCosmicTree() { this->SetLayoutStrategy("Cosmic Tree"); }
359  void SetLayoutStrategyToCone() { this->SetLayoutStrategy("Cone"); }
360  void SetLayoutStrategyToSpanTree() { this->SetLayoutStrategy("Span Tree"); }
361  const char* GetLayoutStrategyName();
363 
365 
373 
375 
382  void SetEdgeLayoutStrategy(const char* name);
383  void SetEdgeLayoutStrategyToArcParallel() { this->SetEdgeLayoutStrategy("Arc Parallel"); }
384  void SetEdgeLayoutStrategyToPassThrough() { this->SetEdgeLayoutStrategy("Pass Through"); }
387 
389 
397 
403  void AddIconType(const char* type, int index);
404 
409 
414  void SetIconAlignment(int alignment);
415 
417 
420  void SetIconVisibility(bool b);
422  vtkBooleanMacro(IconVisibility, bool);
424 
426 
429  void SetIconArrayName(const char* name);
430  const char* GetIconArrayName();
432 
434 
437  void SetGlyphType(int type);
440 
442 
445  virtual void SetVertexLabelFontSize(const int size);
446  virtual int GetVertexLabelFontSize();
448 
450 
453  virtual void SetEdgeLabelFontSize(const int size);
454  virtual int GetEdgeLabelFontSize();
456 
458 
464 
466 
472 
477 
484  virtual int IsLayoutComplete();
485 
496  virtual void UpdateLayout();
497 
498 protected:
501 
503 
509  // Called to process events. Overrides behavior in vtkRenderView.
510  void ProcessEvents(vtkObject* caller, unsigned long eventId, void* callData) override;
512 
513 private:
514  vtkGraphLayoutView(const vtkGraphLayoutView&) = delete;
515  void operator=(const vtkGraphLayoutView&) = delete;
516  bool VertexLabelsRequested;
517  bool EdgeLabelsRequested;
518 };
519 
520 #endif
Proxy object to connect input/output ports.
The superclass for all representations.
abstract superclass for all edge layout strategies
abstract superclass for all graph layout strategies
Lays out and displays a graph.
bool GetVertexLabelVisibility()
Whether to show vertex labels.
void SetLayoutStrategyToSpanTree()
The layout strategy to use when performing the graph layout.
void SetEdgeLayoutStrategy(vtkEdgeLayoutStrategy *s)
The layout strategy to use when performing the edge layout.
void SetScaledGlyphs(bool arg)
Whether to use scaled glyphs or not.
void SetScalingArrayName(const char *name)
The array used for scaling (if ScaledGlyphs is ON)
virtual void SetVertexLabelFontSize(const int size)
The size of the font used for vertex labeling.
void SetEdgeLayoutStrategyToPassThrough()
The layout strategy to use when performing the edge layout.
bool GetEdgeLabelVisibility()
Whether to show edge labels.
void SetLayoutStrategyToClustering2D()
The layout strategy to use when performing the graph layout.
void SetEdgeLayoutStrategy(const char *name)
The layout strategy to use when performing the edge layout.
bool GetColorEdges()
Whether to color edges.
void SetGlyphType(int type)
The type of glyph to use for the vertices.
void SetEnabledVerticesArrayName(const char *name)
The array to use for coloring vertices.
const char * GetLayoutStrategyName()
The layout strategy to use when performing the graph layout.
static vtkGraphLayoutView * New()
void SetEdgeLayoutStrategyToArcParallel()
The layout strategy to use when performing the edge layout.
bool GetEdgeSelection()
Whether edges are selectable.
virtual vtkRenderedGraphRepresentation * GetGraphRepresentation()
Overrides behavior in vtkView to create a vtkRenderedGraphRepresentation by default.
void SetVertexColorArrayName(const char *name)
The array to use for coloring vertices.
const char * GetScalingArrayName()
The array used for scaling (if ScaledGlyphs is ON)
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...
bool GetIconVisibility()
Whether icons are visible (default off).
bool GetScaledGlyphs()
Whether to use scaled glyphs or not.
int GetEnableEdgesByArray()
Whether to color edges.
void ProcessEvents(vtkObject *caller, unsigned long eventId, void *callData) override
Overrides behavior in vtkView to create a vtkRenderedGraphRepresentation by default.
void SetColorEdges(bool vis)
Whether to color edges.
bool GetColorVertices()
Whether to color vertices.
vtkEdgeLayoutStrategy * GetEdgeLayoutStrategy()
The layout strategy to use when performing the edge layout.
const char * GetVertexLabelArrayName()
The array to use for vertex labeling.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual int IsLayoutComplete()
Is the graph layout complete? This method is useful for when the strategy is iterative and the applic...
void SetLayoutStrategyToRandom()
The layout strategy to use when performing the graph layout.
const char * GetEnabledVerticesArrayName()
The array to use for coloring vertices.
int GetGlyphType()
The type of glyph to use for the vertices.
void SetLayoutStrategyToCone()
The layout strategy to use when performing the graph layout.
const char * GetIconArrayName()
The array used for assigning icons.
void SetEdgeColorArrayName(const char *name)
The array to use for coloring edges.
vtkDataRepresentation * CreateDefaultRepresentation(vtkAlgorithmOutput *conn) override
Overrides behavior in vtkView to create a vtkRenderedGraphRepresentation by default.
void SetLayoutStrategyToCosmicTree()
The layout strategy to use when performing the graph layout.
void SetLayoutStrategyToTree()
The layout strategy to use when performing the graph layout.
void SetLayoutStrategy(const char *name)
The layout strategy to use when performing the graph layout.
void SetLayoutStrategyToPassThrough()
The layout strategy to use when performing the graph layout.
int GetEnableVerticesByArray()
Whether to color vertices.
void SetVertexLabelArrayName(const char *name)
The array to use for vertex labeling.
bool GetHideVertexLabelsOnInteraction()
Whether to hide vertex labels during mouse interactions.
void SetIconArrayName(const char *name)
The array used for assigning icons.
~vtkGraphLayoutView() override
vtkGraphLayoutStrategy * GetLayoutStrategy()
The layout strategy to use when performing the graph layout.
void SetEdgeLabelVisibility(bool vis)
Whether to show edge labels.
void SetHideEdgeLabelsOnInteraction(bool vis)
Whether to hide edge labels during mouse interactions.
bool GetEdgeVisibility()
Whether to show the edges at all.
bool GetVertexScalarBarVisibility()
Whether the scalar bar for vertices is visible.
void SetLayoutStrategyToSimple2D()
The layout strategy to use when performing the graph layout.
bool GetHideEdgeLabelsOnInteraction()
Whether to hide edge labels during mouse interactions.
virtual int GetVertexLabelFontSize()
The size of the font used for vertex labeling.
void SetEdgeSelection(bool vis)
Whether edges are selectable.
void SetEnableEdgesByArray(bool vis)
Whether to color edges.
void SetEdgeVisibility(bool vis)
Whether to show the edges at all.
void SetEnableVerticesByArray(bool vis)
Whether to color vertices.
void SetLayoutStrategyToCircular()
The layout strategy to use when performing the graph layout.
virtual int GetEdgeLabelFontSize()
The size of the font used for edge labeling.
void SetEdgeScalarBarVisibility(bool vis)
Whether the scalar bar for edges is visible.
const char * GetEnabledEdgesArrayName()
The array to use for coloring edges.
void SetEdgeLabelArrayName(const char *name)
The array to use for edge labeling.
const char * GetVertexColorArrayName()
The array to use for coloring vertices.
void SetLayoutStrategyToForceDirected()
The layout strategy to use when performing the graph layout.
void ZoomToSelection()
Reset the camera based on the bounds of the selected region.
virtual void UpdateLayout()
This method is useful for when the strategy is iterative and the application wants to show the iterat...
void SetIconVisibility(bool b)
Whether icons are visible (default off).
void SetVertexScalarBarVisibility(bool vis)
Whether the scalar bar for vertices is visible.
virtual void SetEdgeLabelFontSize(const int size)
The size of the font used for edge labeling.
void SetLayoutStrategyToCommunity2D()
The layout strategy to use when performing the graph layout.
void SetColorVertices(bool vis)
Whether to color vertices.
bool GetEdgeScalarBarVisibility()
Whether the scalar bar for edges is visible.
const char * GetEdgeColorArrayName()
The array to use for coloring edges.
const char * GetEdgeLabelArrayName()
The array to use for edge labeling.
void SetLayoutStrategyToFast2D()
The layout strategy to use when performing the graph layout.
void SetIconAlignment(int alignment)
Specify where the icons should be placed in relation to the vertex.
void ClearIconTypes()
Clear all icon mappings.
void SetLayoutStrategy(vtkGraphLayoutStrategy *s)
The layout strategy to use when performing the graph layout.
void SetVertexLabelVisibility(bool vis)
Whether to show vertex labels.
const char * GetEdgeLayoutStrategyName()
The layout strategy to use when performing the edge layout.
void SetEnabledEdgesArrayName(const char *name)
The array to use for coloring edges.
void SetHideVertexLabelsOnInteraction(bool vis)
Whether to hide vertex labels during mouse interactions.
a simple class to control print indentation
Definition: vtkIndent.h:119
abstract base class for most VTK objects
Definition: vtkObject.h:82
A view containing a renderer.
Definition: vtkRenderView.h:84
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:138
@ type
Definition: vtkX3D.h:522
@ name
Definition: vtkX3D.h:225
@ size
Definition: vtkX3D.h:259
@ index
Definition: vtkX3D.h:252