VTK  9.1.0
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 -------------------------------------------------------------------------*/
151 #ifndef vtkGraphLayoutView_h
152 #define vtkGraphLayoutView_h
153 
154 #include "vtkRenderView.h"
155 #include "vtkViewsInfovisModule.h" // For export macro
156 
160 class vtkViewTheme;
161 
162 class VTKVIEWSINFOVIS_EXPORT vtkGraphLayoutView : public vtkRenderView
163 {
164 public:
167  void PrintSelf(ostream& os, vtkIndent indent) override;
168 
170 
173  void SetVertexLabelArrayName(const char* name);
174  const char* GetVertexLabelArrayName();
176 
178 
181  void SetEdgeLabelArrayName(const char* name);
182  const char* GetEdgeLabelArrayName();
184 
186 
189  void SetVertexLabelVisibility(bool vis);
191  vtkBooleanMacro(VertexLabelVisibility, bool);
193 
195 
200  vtkBooleanMacro(HideVertexLabelsOnInteraction, bool);
202 
204 
207  void SetEdgeVisibility(bool vis);
209  vtkBooleanMacro(EdgeVisibility, bool);
211 
213 
216  void SetEdgeLabelVisibility(bool vis);
218  vtkBooleanMacro(EdgeLabelVisibility, bool);
220 
222 
227  vtkBooleanMacro(HideEdgeLabelsOnInteraction, bool);
229 
231 
235  void SetVertexColorArrayName(const char* name);
236  const char* GetVertexColorArrayName();
238 
240 
243  void SetColorVertices(bool vis);
245  vtkBooleanMacro(ColorVertices, bool);
247 
249 
252  void SetEdgeColorArrayName(const char* name);
253  const char* GetEdgeColorArrayName();
255 
257 
260  void SetColorEdges(bool vis);
262  vtkBooleanMacro(ColorEdges, bool);
264 
266 
269  void SetEdgeSelection(bool vis);
271  vtkBooleanMacro(EdgeSelection, bool);
273 
275 
278  void SetEnabledEdgesArrayName(const char* name);
281 
283 
286  void SetEnableEdgesByArray(bool vis);
289 
291 
297 
299 
302  void SetEnableVerticesByArray(bool vis);
305 
307 
310  void SetScalingArrayName(const char* name);
311  const char* GetScalingArrayName();
313 
315 
318  void SetScaledGlyphs(bool arg);
320  vtkBooleanMacro(ScaledGlyphs, bool);
322 
324 
342  void SetLayoutStrategy(const char* name);
343  void SetLayoutStrategyToRandom() { this->SetLayoutStrategy("Random"); }
344  void SetLayoutStrategyToForceDirected() { this->SetLayoutStrategy("Force Directed"); }
345  void SetLayoutStrategyToSimple2D() { this->SetLayoutStrategy("Simple 2D"); }
346  void SetLayoutStrategyToClustering2D() { this->SetLayoutStrategy("Clustering 2D"); }
347  void SetLayoutStrategyToCommunity2D() { this->SetLayoutStrategy("Community 2D"); }
348  void SetLayoutStrategyToFast2D() { this->SetLayoutStrategy("Fast 2D"); }
349  void SetLayoutStrategyToPassThrough() { this->SetLayoutStrategy("Pass Through"); }
350  void SetLayoutStrategyToCircular() { this->SetLayoutStrategy("Circular"); }
351  void SetLayoutStrategyToTree() { this->SetLayoutStrategy("Tree"); }
352  void SetLayoutStrategyToCosmicTree() { this->SetLayoutStrategy("Cosmic Tree"); }
353  void SetLayoutStrategyToCone() { this->SetLayoutStrategy("Cone"); }
354  void SetLayoutStrategyToSpanTree() { this->SetLayoutStrategy("Span Tree"); }
355  const char* GetLayoutStrategyName();
357 
359 
367 
369 
376  void SetEdgeLayoutStrategy(const char* name);
377  void SetEdgeLayoutStrategyToArcParallel() { this->SetEdgeLayoutStrategy("Arc Parallel"); }
378  void SetEdgeLayoutStrategyToPassThrough() { this->SetEdgeLayoutStrategy("Pass Through"); }
381 
383 
391 
397  void AddIconType(const char* type, int index);
398 
403 
408  void SetIconAlignment(int alignment);
409 
411 
414  void SetIconVisibility(bool b);
416  vtkBooleanMacro(IconVisibility, bool);
418 
420 
423  void SetIconArrayName(const char* name);
424  const char* GetIconArrayName();
426 
428 
431  void SetGlyphType(int type);
434 
436 
439  virtual void SetVertexLabelFontSize(const int size);
440  virtual int GetVertexLabelFontSize();
442 
444 
447  virtual void SetEdgeLabelFontSize(const int size);
448  virtual int GetEdgeLabelFontSize();
450 
452 
458 
460 
466 
471 
478  virtual int IsLayoutComplete();
479 
490  virtual void UpdateLayout();
491 
492 protected:
495 
497 
503  // Called to process events. Overrides behavior in vtkRenderView.
504  void ProcessEvents(vtkObject* caller, unsigned long eventId, void* callData) override;
506 
507 private:
508  vtkGraphLayoutView(const vtkGraphLayoutView&) = delete;
509  void operator=(const vtkGraphLayoutView&) = delete;
510  bool VertexLabelsRequested;
511  bool EdgeLabelsRequested;
512 };
513 
514 #endif
vtkGraphLayoutView::GetHideEdgeLabelsOnInteraction
bool GetHideEdgeLabelsOnInteraction()
Whether to hide edge labels during mouse interactions.
vtkGraphLayoutView::GetHideVertexLabelsOnInteraction
bool GetHideVertexLabelsOnInteraction()
Whether to hide vertex labels during mouse interactions.
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()
The type of glyph to use for the vertices.
vtkGraphLayoutView::New
static vtkGraphLayoutView * New()
vtkGraphLayoutView::SetEdgeVisibility
void SetEdgeVisibility(bool vis)
Whether to show the edges at all.
vtkGraphLayoutView::SetLayoutStrategyToRandom
void SetLayoutStrategyToRandom()
The layout strategy to use when performing the graph layout.
Definition: vtkGraphLayoutView.h:343
vtkRenderView
A view containing a renderer.
Definition: vtkRenderView.h:84
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()
Whether to show vertex labels.
vtkGraphLayoutView::SetEdgeLayoutStrategy
void SetEdgeLayoutStrategy(const char *name)
The layout strategy to use when performing the edge layout.
vtkGraphLayoutView::SetLayoutStrategyToClustering2D
void SetLayoutStrategyToClustering2D()
The layout strategy to use when performing the graph layout.
Definition: vtkGraphLayoutView.h:346
vtkGraphLayoutStrategy
abstract superclass for all graph layout strategies
Definition: vtkGraphLayoutStrategy.h:105
vtkGraphLayoutView::SetLayoutStrategyToCommunity2D
void SetLayoutStrategyToCommunity2D()
The layout strategy to use when performing the graph layout.
Definition: vtkGraphLayoutView.h:347
vtkGraphLayoutView::GetColorEdges
bool GetColorEdges()
Whether to color edges.
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:82
vtkGraphLayoutView::SetLayoutStrategyToForceDirected
void SetLayoutStrategyToForceDirected()
The layout strategy to use when performing the graph layout.
Definition: vtkGraphLayoutView.h:344
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()
Whether the scalar bar for vertices is visible.
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()
Whether icons are visible (default off).
vtkGraphLayoutView::SetEdgeLabelArrayName
void SetEdgeLabelArrayName(const char *name)
The array to use for edge labeling.
vtkRenderView.h
vtkRenderedGraphRepresentation
Definition: vtkRenderedGraphRepresentation.h:134
vtkGraphLayoutView::GetScalingArrayName
const char * GetScalingArrayName()
The array used for scaling (if ScaledGlyphs is ON)
vtkGraphLayoutView::SetEdgeLayoutStrategyToPassThrough
void SetEdgeLayoutStrategyToPassThrough()
The layout strategy to use when performing the edge layout.
Definition: vtkGraphLayoutView.h:378
vtkGraphLayoutView::SetLayoutStrategyToCircular
void SetLayoutStrategyToCircular()
The layout strategy to use when performing the graph layout.
Definition: vtkGraphLayoutView.h:350
vtkGraphLayoutView::ClearIconTypes
void ClearIconTypes()
Clear all icon mappings.
vtkGraphLayoutView
Lays out and displays a graph.
Definition: vtkGraphLayoutView.h:163
vtkGraphLayoutView::GetEdgeLabelFontSize
virtual int GetEdgeLabelFontSize()
The size of the font used for edge labeling.
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()
The layout strategy to use when performing the graph layout.
Definition: vtkGraphLayoutView.h:349
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:132
vtkGraphLayoutView::GetEdgeVisibility
bool GetEdgeVisibility()
Whether to show the edges at all.
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:92
vtkGraphLayoutView::GetEnableVerticesByArray
int GetEnableVerticesByArray()
Whether to color vertices.
vtkGraphLayoutView::GetGraphRepresentation
virtual vtkRenderedGraphRepresentation * GetGraphRepresentation()
Overrides behavior in vtkView to create a vtkRenderedGraphRepresentation by default.
vtkGraphLayoutView::GetEnabledEdgesArrayName
const char * GetEnabledEdgesArrayName()
The array to use for coloring edges.
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:113
vtkGraphLayoutView::SetLayoutStrategy
void SetLayoutStrategy(vtkGraphLayoutStrategy *s)
The layout strategy to use when performing the graph layout.
vtkGraphLayoutView::~vtkGraphLayoutView
~vtkGraphLayoutView() override
vtkGraphLayoutView::GetEdgeLabelVisibility
bool GetEdgeLabelVisibility()
Whether to show edge labels.
vtkGraphLayoutView::GetEdgeSelection
bool GetEdgeSelection()
Whether edges are selectable.
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()
Whether the scalar bar for edges is visible.
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()
The layout strategy to use when performing the graph layout.
Definition: vtkGraphLayoutView.h:351
vtkGraphLayoutView::GetVertexColorArrayName
const char * GetVertexColorArrayName()
The array to use for coloring vertices.
vtkGraphLayoutView::GetEdgeColorArrayName
const char * GetEdgeColorArrayName()
The array to use for coloring edges.
vtkGraphLayoutView::GetVertexLabelArrayName
const char * GetVertexLabelArrayName()
The array to use for vertex labeling.
vtkGraphLayoutView::GetEnabledVerticesArrayName
const char * GetEnabledVerticesArrayName()
The array to use for coloring vertices.
vtkX3D::name
@ name
Definition: vtkX3D.h:225
vtkGraphLayoutView::SetLayoutStrategyToCone
void SetLayoutStrategyToCone()
The layout strategy to use when performing the graph layout.
Definition: vtkGraphLayoutView.h:353
vtkGraphLayoutView::GetIconArrayName
const char * GetIconArrayName()
The array used for assigning icons.
vtkGraphLayoutView::GetEnableEdgesByArray
int GetEnableEdgesByArray()
Whether to color edges.
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)
The layout strategy to use when performing the edge layout.
vtkGraphLayoutView::SetLayoutStrategyToFast2D
void SetLayoutStrategyToFast2D()
The layout strategy to use when performing the graph layout.
Definition: vtkGraphLayoutView.h:348
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:66
vtkGraphLayoutView::SetEdgeLayoutStrategyToArcParallel
void SetEdgeLayoutStrategyToArcParallel()
The layout strategy to use when performing the edge layout.
Definition: vtkGraphLayoutView.h:377
vtkGraphLayoutView::SetColorEdges
void SetColorEdges(bool vis)
Whether to color edges.
vtkGraphLayoutView::GetVertexLabelFontSize
virtual int GetVertexLabelFontSize()
The size of the font used for vertex labeling.
vtkGraphLayoutView::SetLayoutStrategyToSimple2D
void SetLayoutStrategyToSimple2D()
The layout strategy to use when performing the graph layout.
Definition: vtkGraphLayoutView.h:345
vtkGraphLayoutView::GetEdgeLabelArrayName
const char * GetEdgeLabelArrayName()
The array to use for edge labeling.
vtkGraphLayoutView::SetLayoutStrategyToCosmicTree
void SetLayoutStrategyToCosmicTree()
The layout strategy to use when performing the graph layout.
Definition: vtkGraphLayoutView.h:352
vtkEdgeLayoutStrategy
abstract superclass for all edge layout strategies
Definition: vtkEdgeLayoutStrategy.h:37
vtkGraphLayoutView::SetLayoutStrategyToSpanTree
void SetLayoutStrategyToSpanTree()
The layout strategy to use when performing the graph layout.
Definition: vtkGraphLayoutView.h:354
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
Overrides behavior in vtkView to create a vtkRenderedGraphRepresentation by default.
vtkX3D::index
@ index
Definition: vtkX3D.h:252
vtkGraphLayoutView::GetColorVertices
bool GetColorVertices()
Whether to color vertices.
vtkGraphLayoutView::SetEnableVerticesByArray
void SetEnableVerticesByArray(bool vis)
Whether to color vertices.
vtkGraphLayoutView::GetLayoutStrategyName
const char * GetLayoutStrategyName()
The layout strategy to use when performing the graph layout.
vtkGraphLayoutView::SetVertexLabelVisibility
void SetVertexLabelVisibility(bool vis)
Whether to show vertex labels.
vtkGraphLayoutView::GetScaledGlyphs
bool GetScaledGlyphs()
Whether to use scaled glyphs or not.
vtkGraphLayoutView::CreateDefaultRepresentation
vtkDataRepresentation * CreateDefaultRepresentation(vtkAlgorithmOutput *conn) override
Overrides behavior in vtkView to create a vtkRenderedGraphRepresentation by default.
vtkGraphLayoutView::GetEdgeLayoutStrategyName
const char * GetEdgeLayoutStrategyName()
The layout strategy to use when performing the edge layout.
vtkGraphLayoutView::SetEdgeSelection
void SetEdgeSelection(bool vis)
Whether edges are selectable.