VTK  9.3.20240327
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
141 #ifndef vtkGraphLayoutView_h
142 #define vtkGraphLayoutView_h
143 
144 #include "vtkRenderView.h"
145 #include "vtkViewsInfovisModule.h" // For export macro
146 
147 VTK_ABI_NAMESPACE_BEGIN
151 class vtkViewTheme;
152 
153 class VTKVIEWSINFOVIS_EXPORT vtkGraphLayoutView : public vtkRenderView
154 {
155 public:
158  void PrintSelf(ostream& os, vtkIndent indent) override;
159 
161 
164  void SetVertexLabelArrayName(const char* name);
165  const char* GetVertexLabelArrayName();
167 
169 
172  void SetEdgeLabelArrayName(const char* name);
173  const char* GetEdgeLabelArrayName();
175 
177 
180  void SetVertexLabelVisibility(bool vis);
182  vtkBooleanMacro(VertexLabelVisibility, bool);
184 
186 
191  vtkBooleanMacro(HideVertexLabelsOnInteraction, bool);
193 
195 
198  void SetEdgeVisibility(bool vis);
200  vtkBooleanMacro(EdgeVisibility, bool);
202 
204 
207  void SetEdgeLabelVisibility(bool vis);
209  vtkBooleanMacro(EdgeLabelVisibility, bool);
211 
213 
218  vtkBooleanMacro(HideEdgeLabelsOnInteraction, bool);
220 
222 
226  void SetVertexColorArrayName(const char* name);
227  const char* GetVertexColorArrayName();
229 
231 
234  void SetColorVertices(bool vis);
236  vtkBooleanMacro(ColorVertices, bool);
238 
240 
243  void SetEdgeColorArrayName(const char* name);
244  const char* GetEdgeColorArrayName();
246 
248 
251  void SetColorEdges(bool vis);
253  vtkBooleanMacro(ColorEdges, bool);
255 
257 
260  void SetEdgeSelection(bool vis);
262  vtkBooleanMacro(EdgeSelection, bool);
264 
266 
269  void SetEnabledEdgesArrayName(const char* name);
272 
274 
277  void SetEnableEdgesByArray(bool vis);
280 
282 
288 
290 
293  void SetEnableVerticesByArray(bool vis);
296 
298 
301  void SetScalingArrayName(const char* name);
302  const char* GetScalingArrayName();
304 
306 
309  void SetScaledGlyphs(bool arg);
311  vtkBooleanMacro(ScaledGlyphs, bool);
313 
315 
333  void SetLayoutStrategy(const char* name);
334  void SetLayoutStrategyToRandom() { this->SetLayoutStrategy("Random"); }
335  void SetLayoutStrategyToForceDirected() { this->SetLayoutStrategy("Force Directed"); }
336  void SetLayoutStrategyToSimple2D() { this->SetLayoutStrategy("Simple 2D"); }
337  void SetLayoutStrategyToClustering2D() { this->SetLayoutStrategy("Clustering 2D"); }
338  void SetLayoutStrategyToCommunity2D() { this->SetLayoutStrategy("Community 2D"); }
339  void SetLayoutStrategyToFast2D() { this->SetLayoutStrategy("Fast 2D"); }
340  void SetLayoutStrategyToPassThrough() { this->SetLayoutStrategy("Pass Through"); }
341  void SetLayoutStrategyToCircular() { this->SetLayoutStrategy("Circular"); }
342  void SetLayoutStrategyToTree() { this->SetLayoutStrategy("Tree"); }
343  void SetLayoutStrategyToCosmicTree() { this->SetLayoutStrategy("Cosmic Tree"); }
344  void SetLayoutStrategyToCone() { this->SetLayoutStrategy("Cone"); }
345  void SetLayoutStrategyToSpanTree() { this->SetLayoutStrategy("Span Tree"); }
346  const char* GetLayoutStrategyName();
348 
350 
358 
360 
367  void SetEdgeLayoutStrategy(const char* name);
368  void SetEdgeLayoutStrategyToArcParallel() { this->SetEdgeLayoutStrategy("Arc Parallel"); }
369  void SetEdgeLayoutStrategyToPassThrough() { this->SetEdgeLayoutStrategy("Pass Through"); }
372 
374 
382 
388  void AddIconType(const char* type, int index);
389 
394 
399  void SetIconAlignment(int alignment);
400 
402 
405  void SetIconVisibility(bool b);
407  vtkBooleanMacro(IconVisibility, bool);
409 
411 
414  void SetIconArrayName(const char* name);
415  const char* GetIconArrayName();
417 
419 
422  void SetGlyphType(int type);
425 
427 
430  virtual void SetVertexLabelFontSize(int size);
431  virtual int GetVertexLabelFontSize();
433 
435 
438  virtual void SetEdgeLabelFontSize(int size);
439  virtual int GetEdgeLabelFontSize();
441 
443 
449 
451 
457 
462 
469  virtual int IsLayoutComplete();
470 
481  virtual void UpdateLayout();
482 
483 protected:
486 
488 
494  // Called to process events. Overrides behavior in vtkRenderView.
495  void ProcessEvents(vtkObject* caller, unsigned long eventId, void* callData) override;
497 
498 private:
499  vtkGraphLayoutView(const vtkGraphLayoutView&) = delete;
500  void operator=(const vtkGraphLayoutView&) = delete;
501  bool VertexLabelsRequested;
502  bool EdgeLabelsRequested;
503 };
504 
505 VTK_ABI_NAMESPACE_END
506 #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.
virtual void SetVertexLabelFontSize(int size)
The size of the font used for vertex labeling.
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)
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.
virtual void SetEdgeLabelFontSize(int size)
The size of the font used for edge labeling.
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.
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:108
abstract base class for most VTK objects
Definition: vtkObject.h:161
A view containing a renderer.
Definition: vtkRenderView.h:69
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:123
@ type
Definition: vtkX3D.h:516
@ name
Definition: vtkX3D.h:219
@ size
Definition: vtkX3D.h:253
@ index
Definition: vtkX3D.h:246