VTK
vtkGraphMapper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkGraphMapper.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 -------------------------------------------------------------------------*/
33 #ifndef vtkGraphMapper_h
34 #define vtkGraphMapper_h
35 
36 #include "vtkRenderingCoreModule.h" // For export macro
37 #include "vtkMapper.h"
38 
39 #include "vtkSmartPointer.h" // Required for smart pointer internal ivars.
40 
41 class vtkActor2D;
42 class vtkMapArrayValues;
43 class vtkCamera;
44 class vtkFollower;
45 class vtkGraph;
46 class vtkGlyph3D;
47 class vtkGraphToPolyData;
48 class vtkIconGlyphFilter;
49 class vtkCellCenters;
50 class vtkPolyData;
51 class vtkPolyDataMapper;
53 class vtkLookupTable;
55 class vtkTexture;
56 class vtkTexturedActor2D;
58 
59 class VTKRENDERINGCORE_EXPORT vtkGraphMapper : public vtkMapper
60 {
61 public:
62  static vtkGraphMapper *New();
63  vtkTypeMacro(vtkGraphMapper, vtkMapper);
64  void PrintSelf(ostream& os, vtkIndent indent);
65  void Render(vtkRenderer *ren, vtkActor *act);
66 
68 
71  void SetVertexColorArrayName(const char* name);
72  const char* GetVertexColorArrayName();
74 
76 
79  void SetColorVertices(bool vis);
84 
86 
92  void SetScaledGlyphs(bool arg);
93  vtkGetMacro(ScaledGlyphs, bool);
94  vtkBooleanMacro(ScaledGlyphs, bool);
96 
98 
101  vtkSetStringMacro(ScalingArrayName);
102  vtkGetStringMacro(ScalingArrayName);
104 
106 
109  void SetEdgeVisibility(bool vis);
111  vtkBooleanMacro(EdgeVisibility, bool);
113 
115 
118  void SetEdgeColorArrayName(const char* name);
119  const char* GetEdgeColorArrayName();
121 
123 
126  void SetColorEdges(bool vis);
128  void ColorEdgesOn();
131 
133 
136  vtkSetStringMacro(EnabledEdgesArrayName);
137  vtkGetStringMacro(EnabledEdgesArrayName);
139 
141 
144  vtkSetMacro(EnableEdgesByArray, int);
145  vtkGetMacro(EnableEdgesByArray, int);
146  vtkBooleanMacro(EnableEdgesByArray, int);
148 
150 
153  vtkSetStringMacro(EnabledVerticesArrayName);
154  vtkGetStringMacro(EnabledVerticesArrayName);
156 
158 
161  vtkSetMacro(EnableVerticesByArray, int);
162  vtkGetMacro(EnableVerticesByArray, int);
163  vtkBooleanMacro(EnableVerticesByArray, int);
165 
167 
170  void SetIconArrayName(const char* name);
171  const char* GetIconArrayName();
173 
179  void AddIconType(char *type, int index);
180 
185 
187 
190  void SetIconSize(int *size);
191  int *GetIconSize();
193 
198  void SetIconAlignment(int alignment);
199 
201 
205  void SetIconTexture(vtkTexture *texture);
207 
209 
212  void SetIconVisibility(bool vis);
214  vtkBooleanMacro(IconVisibility, bool);
216 
218 
221  vtkGetMacro(VertexPointSize,float);
224 
226 
229  vtkGetMacro(EdgeLineWidth,float);
230  void SetEdgeLineWidth(float width);
232 
239 
244 
246 
249  void SetInputData(vtkGraph *input);
252 
257  virtual double *GetBounds();
258  virtual void GetBounds(double* bounds)
259  { Superclass::GetBounds(bounds); }
260 
262 
265  vtkGetObjectMacro(EdgeLookupTable, vtkLookupTable);
266  vtkGetObjectMacro(VertexLookupTable, vtkLookupTable);
268 
269 protected:
272 
274 
277  vtkGetStringMacro(VertexColorArrayNameInternal);
278  vtkSetStringMacro(VertexColorArrayNameInternal);
279  vtkGetStringMacro(EdgeColorArrayNameInternal);
280  vtkSetStringMacro(EdgeColorArrayNameInternal);
284 
289 
290  vtkGetStringMacro(IconArrayNameInternal);
291  vtkSetStringMacro(IconArrayNameInternal);
293 
296 
302 
307 
312 
313  // Color maps
316 
318 
319  // see algorithm for more info
321 
322 private:
323  vtkGraphMapper(const vtkGraphMapper&) VTK_DELETE_FUNCTION;
324  void operator=(const vtkGraphMapper&) VTK_DELETE_FUNCTION;
325 
326  // Helper function
327  vtkPolyData* CreateCircle(bool filled);
328 
329  float VertexPointSize;
330  float EdgeLineWidth;
331  bool ScaledGlyphs;
332  char* ScalingArrayName;
333 };
334 
335 #endif
virtual double * GetBounds()=0
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax,...
a actor that draws 2D data
Definition: vtkActor2D.h:46
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:52
a virtual camera for 3D rendering
Definition: vtkCamera.h:51
generate points at center of cells
a subclass of actor that always faces the camera
Definition: vtkFollower.h:47
Detect and break reference loops.
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:112
map vtkGraph and derived classes to graphics primitives
void ColorEdgesOn()
bool GetEdgeVisibility()
vtkSmartPointer< vtkTexturedActor2D > IconActor
void SetColorEdges(bool vis)
Whether to color edges.
void SetVertexColorArrayName(const char *name)
The array to use for coloring vertices.
char * EnabledVerticesArrayName
vtkSmartPointer< vtkGraphToPolyData > GraphToPoly
vtkLookupTable * EdgeLookupTable
bool GetIconVisibility()
void ClearIconTypes()
Clear all icon mappings.
vtkSmartPointer< vtkPolyDataMapper > EdgeMapper
const char * GetVertexColorArrayName()
vtkSmartPointer< vtkPolyDataMapper > VertexMapper
int * GetIconSize()
void SetIconVisibility(bool vis)
Whether to show icons.
void ColorVerticesOff()
bool GetColorVertices()
void AddIconType(char *type, int index)
Associate the icon at index "index" in the vtkTexture to all vertices containing "type" as a value in...
void SetColorVertices(bool vis)
Whether to color vertices.
vtkSmartPointer< vtkMapArrayValues > IconTypeToIndex
void ReportReferences(vtkGarbageCollector *) override
vtkSmartPointer< vtkIconGlyphFilter > IconGlyph
void Render(vtkRenderer *ren, vtkActor *act)
Method initiates the mapping process.
const char * GetIconArrayName()
char * EdgeColorArrayNameInternal
vtkSmartPointer< vtkPolyDataMapper > OutlineMapper
vtkSmartPointer< vtkVertexGlyphFilter > VertexGlyph
vtkSmartPointer< vtkTransformCoordinateSystems > IconTransform
void SetScaledGlyphs(bool arg)
Whether scaled glyphs are on or not.
char * IconArrayNameInternal
void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this mapper.
void SetIconSize(int *size)
Specify the Width and Height, in pixels, of an icon in the icon sheet.
void SetInputData(vtkGraph *input)
Set the Input of this mapper.
vtkMTimeType GetMTime()
Get the mtime also considering the lookup table.
static vtkGraphMapper * New()
void ColorVerticesOn()
vtkSmartPointer< vtkActor > EdgeActor
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkGraph * GetInput()
vtkLookupTable * VertexLookupTable
virtual double * GetBounds()
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax,...
char * VertexColorArrayNameInternal
bool GetColorEdges()
void SetIconAlignment(int alignment)
Specify where the icons should be placed in relation to the vertex.
char * EnabledEdgesArrayName
vtkSmartPointer< vtkPolyDataMapper2D > IconMapper
vtkSmartPointer< vtkGlyph3D > CircleGlyph
vtkSmartPointer< vtkActor > OutlineActor
void SetIconArrayName(const char *name)
The array to use for assigning icons.
vtkSmartPointer< vtkActor > VertexActor
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
void ColorEdgesOff()
void SetIconTexture(vtkTexture *texture)
virtual void GetBounds(double *bounds)
void SetEdgeVisibility(bool vis)
Whether to show edges or not.
vtkSmartPointer< vtkGlyph3D > CircleOutlineGlyph
const char * GetEdgeColorArrayName()
void SetEdgeLineWidth(float width)
void SetEdgeColorArrayName(const char *name)
The array to use for coloring edges.
void SetVertexPointSize(float size)
vtkTexture * GetIconTexture()
The texture containing the icon sheet.
convert a vtkGraph to vtkPolyData
Base class for graph data types.
Definition: vtkGraph.h:288
Filter that generates a polydata consisting of quads with texture coordinates referring to a set of i...
a simple class to control print indentation
Definition: vtkIndent.h:40
Store vtkAlgorithm input/output information.
map scalar values into colors via a lookup table
Map values in an input array to different values in an output array of (possibly) different type.
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:92
draw vtkPolyData onto the image plane
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
abstract specification for renderers
Definition: vtkRenderer.h:64
handles properties associated with a texture map
Definition: vtkTexture.h:71
actor that draws 2D data with texture support
transform points into different coordinate systems
Make a vtkPolyData with a vertex on each point.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
@ info
Definition: vtkX3D.h:376
@ port
Definition: vtkX3D.h:447
@ type
Definition: vtkX3D.h:516
@ filled
Definition: vtkX3D.h:349
@ name
Definition: vtkX3D.h:219
@ size
Definition: vtkX3D.h:253
@ index
Definition: vtkX3D.h:246
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248