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 -------------------------------------------------------------------------*/
32 #ifndef vtkGraphMapper_h
33 #define vtkGraphMapper_h
34 
35 #include "vtkRenderingCoreModule.h" // For export macro
36 #include "vtkMapper.h"
37 
38 #include "vtkSmartPointer.h" // Required for smart pointer internal ivars.
39 
40 class vtkActor2D;
41 class vtkMapArrayValues;
42 class vtkCamera;
43 class vtkFollower;
44 class vtkGraph;
45 class vtkGlyph3D;
46 class vtkGraphToPolyData;
47 class vtkIconGlyphFilter;
48 class vtkCellCenters;
49 class vtkPolyData;
50 class vtkPolyDataMapper;
52 class vtkLookupTable;
54 class vtkTexture;
55 class vtkTexturedActor2D;
57 
59 {
60 public:
61  static vtkGraphMapper *New();
63  void PrintSelf(ostream& os, vtkIndent indent);
64  void Render(vtkRenderer *ren, vtkActor *act);
65 
67 
68  void SetVertexColorArrayName(const char* name);
69  const char* GetVertexColorArrayName();
71 
73 
74  void SetColorVertices(bool vis);
79 
81 
85  void SetScaledGlyphs(bool arg);
86  vtkGetMacro(ScaledGlyphs, bool);
87  vtkBooleanMacro(ScaledGlyphs, bool);
89 
91 
92  vtkSetStringMacro(ScalingArrayName);
93  vtkGetStringMacro(ScalingArrayName);
95 
97 
98  void SetEdgeVisibility(bool vis);
100  vtkBooleanMacro(EdgeVisibility, bool);
102 
104 
105  void SetEdgeColorArrayName(const char* name);
106  const char* GetEdgeColorArrayName();
108 
110 
111  void SetColorEdges(bool vis);
113  void ColorEdgesOn();
116 
118 
119  vtkSetStringMacro(EnabledEdgesArrayName);
120  vtkGetStringMacro(EnabledEdgesArrayName);
122 
124 
125  vtkSetMacro(EnableEdgesByArray, int);
126  vtkGetMacro(EnableEdgesByArray, int);
127  vtkBooleanMacro(EnableEdgesByArray, int);
129 
131 
132  vtkSetStringMacro(EnabledVerticesArrayName);
133  vtkGetStringMacro(EnabledVerticesArrayName);
135 
137 
139  vtkSetMacro(EnableVerticesByArray, int);
140  vtkGetMacro(EnableVerticesByArray, int);
141  vtkBooleanMacro(EnableVerticesByArray, int);
143 
145 
146  void SetIconArrayName(const char* name);
147  const char* GetIconArrayName();
149 
153  void AddIconType(char *type, int index);
154 
157 
159 
161  void SetIconSize(int *size);
162  int *GetIconSize();
164 
167  void SetIconAlignment(int alignment);
168 
170 
174 
176 
177  void SetIconVisibility(bool vis);
179  vtkBooleanMacro(IconVisibility, bool);
181 
183 
184  vtkGetMacro(VertexPointSize,float);
187 
189 
190  vtkGetMacro(EdgeLineWidth,float);
191  void SetEdgeLineWidth(float width);
193 
198 
200  unsigned long GetMTime();
201 
203 
207 
209 
211  virtual double *GetBounds();
212  virtual void GetBounds(double* bounds)
213  { Superclass::GetBounds(bounds); }
215 
217 
219  vtkGetObjectMacro(VertexLookupTable, vtkLookupTable);
221 
222 protected:
225 
227 
228  vtkGetStringMacro(VertexColorArrayNameInternal);
229  vtkSetStringMacro(VertexColorArrayNameInternal);
230  vtkGetStringMacro(EdgeColorArrayNameInternal);
231  vtkSetStringMacro(EdgeColorArrayNameInternal);
235 
240 
241  vtkGetStringMacro(IconArrayNameInternal);
242  vtkSetStringMacro(IconArrayNameInternal);
244 
245  //BTX
248 
254 
259 
264  //ETX
265 
266  // Color maps
269 
271 
272  // see algorithm for more info
274 
275 private:
276  vtkGraphMapper(const vtkGraphMapper&); // Not implemented.
277  void operator=(const vtkGraphMapper&); // Not implemented.
278 
279  // Helper function
280  vtkPolyData* CreateCircle(bool filled);
281 
282  float VertexPointSize;
283  float EdgeLineWidth;
284  bool ScaledGlyphs;
285  char* ScalingArrayName;
286 };
287 
288 #endif
vtkPolyDataMapper
map vtkPolyData to graphics primitives
Definition: vtkPolyDataMapper.h:42
vtkGraphToPolyData
convert a vtkGraph to vtkPolyData
Definition: vtkGraphToPolyData.h:47
vtkGraphMapper::vtkGraphMapper
vtkGraphMapper()
vtkFollower
a subclass of actor that always faces the camera
Definition: vtkFollower.h:46
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkGraphMapper::OutlineActor
vtkSmartPointer< vtkActor > OutlineActor
Definition: vtkGraphMapper.h:262
vtkPolyDataMapper2D
draw vtkPolyData onto the image plane
Definition: vtkPolyDataMapper2D.h:51
vtkGraphMapper::VertexGlyph
vtkSmartPointer< vtkVertexGlyphFilter > VertexGlyph
Definition: vtkGraphMapper.h:250
vtkGraphMapper::SetIconAlignment
void SetIconAlignment(int alignment)
vtkAbstractMapper3D::GetBounds
virtual double * GetBounds()=0
vtkGraphMapper::New
static vtkGraphMapper * New()
vtkGraphMapper::EdgeLookupTable
vtkLookupTable * EdgeLookupTable
Definition: vtkGraphMapper.h:267
vtkTexturedActor2D
actor that draws 2D data with texture support
Definition: vtkTexturedActor2D.h:41
vtkGraphMapper::SetEdgeVisibility
void SetEdgeVisibility(bool vis)
vtkGraphMapper::ClearIconTypes
void ClearIconTypes()
vtkGraphMapper::IconActor
vtkSmartPointer< vtkTexturedActor2D > IconActor
Definition: vtkGraphMapper.h:263
vtkGraphMapper::IconTransform
vtkSmartPointer< vtkTransformCoordinateSystems > IconTransform
Definition: vtkGraphMapper.h:253
vtkGraphMapper::SetScaledGlyphs
void SetScaledGlyphs(bool arg)
vtkGraphMapper::FillInputPortInformation
virtual int FillInputPortInformation(int port, vtkInformation *info)
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkSmartPointer< vtkGlyph3D >
vtkGraphMapper::SetEdgeLineWidth
void SetEdgeLineWidth(float width)
vtkGraphMapper::GetColorEdges
bool GetColorEdges()
vtkGraphMapper::EnableVerticesByArray
int EnableVerticesByArray
Definition: vtkGraphMapper.h:239
vtkgl::input
GLenum GLenum GLenum input
Definition: vtkgl.h:15941
vtkGraphMapper::IconArrayNameInternal
char * IconArrayNameInternal
Definition: vtkGraphMapper.h:242
vtkGraphMapper::EdgeColorArrayNameInternal
char * EdgeColorArrayNameInternal
Definition: vtkGraphMapper.h:233
vtkIconGlyphFilter
Filter that generates a polydata consisting of quads with texture coordinates referring to a set of i...
Definition: vtkIconGlyphFilter.h:62
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkGraphMapper::SetInputData
void SetInputData(vtkGraph *input)
vtkGraphMapper::EdgeMapper
vtkSmartPointer< vtkPolyDataMapper > EdgeMapper
Definition: vtkGraphMapper.h:255
vtkMapper.h
vtkGraphMapper::CircleGlyph
vtkSmartPointer< vtkGlyph3D > CircleGlyph
Definition: vtkGraphMapper.h:246
vtkGraphMapper::SetColorVertices
void SetColorVertices(bool vis)
vtkGraphMapper::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkGraphMapper::GetEdgeColorArrayName
const char * GetEdgeColorArrayName()
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkMapArrayValues
Map values in an input array to different values in an output array of (possibly) different type.
Definition: vtkMapArrayValues.h:48
vtkgl::name
GLuint const GLchar * name
Definition: vtkgl.h:11983
vtkTexture
handles properties associated with a texture map
Definition: vtkTexture.h:70
vtkGraphMapper::GetInput
vtkGraph * GetInput()
vtkGraphMapper::GetIconArrayName
const char * GetIconArrayName()
vtkGraphMapper::ColorVerticesOn
void ColorVerticesOn()
vtkGraphMapper::GetVertexColorArrayName
const char * GetVertexColorArrayName()
vtkgl::texture
GLenum GLuint texture
Definition: vtkgl.h:12500
vtkGraphMapper::SetIconArrayName
void SetIconArrayName(const char *name)
vtkGraphMapper::CircleOutlineGlyph
vtkSmartPointer< vtkGlyph3D > CircleOutlineGlyph
Definition: vtkGraphMapper.h:247
vtkGraphMapper::SetIconVisibility
void SetIconVisibility(bool vis)
vtkGraphMapper
map vtkGraph and derived classes to graphics primitives
Definition: vtkGraphMapper.h:59
vtkGraphMapper::SetEdgeColorArrayName
void SetEdgeColorArrayName(const char *name)
vtkMapper
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:90
vtkGraphMapper::SetVertexColorArrayName
void SetVertexColorArrayName(const char *name)
vtkTransformCoordinateSystems
transform points into different coordinate systems
Definition: vtkTransformCoordinateSystems.h:38
vtkGraphMapper::ReportReferences
virtual void ReportReferences(vtkGarbageCollector *)
vtkGraphMapper::IconGlyph
vtkSmartPointer< vtkIconGlyphFilter > IconGlyph
Definition: vtkGraphMapper.h:251
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkGraphMapper::ColorEdgesOn
void ColorEdgesOn()
vtkGraphMapper::ColorEdgesOff
void ColorEdgesOff()
vtkRenderingCoreModule.h
vtkSetStringMacro
#define vtkSetStringMacro(name)
Definition: vtkSetGet.h:104
vtkGraphMapper::SetIconTexture
void SetIconTexture(vtkTexture *texture)
vtkGraphMapper::GraphToPoly
vtkSmartPointer< vtkGraphToPolyData > GraphToPoly
Definition: vtkGraphMapper.h:249
vtkGraphMapper::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *)
vtkGraphMapper::VertexActor
vtkSmartPointer< vtkActor > VertexActor
Definition: vtkGraphMapper.h:261
vtkCamera
a virtual camera for 3D rendering
Definition: vtkCamera.h:49
vtkGraphMapper::GetIconSize
int * GetIconSize()
vtkGraphMapper::GetBounds
virtual double * GetBounds()
vtkSmartPointer.h
vtkGraphMapper::GetEdgeVisibility
bool GetEdgeVisibility()
vtkGraphMapper::SetVertexPointSize
void SetVertexPointSize(float size)
vtkGraphMapper::IconMapper
vtkSmartPointer< vtkPolyDataMapper2D > IconMapper
Definition: vtkGraphMapper.h:258
vtkGraphMapper::GetBounds
virtual void GetBounds(double *bounds)
Definition: vtkGraphMapper.h:212
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkGetStringMacro
vtkGetStringMacro(ExtensionsString)
vtkGraphMapper::AddIconType
void AddIconType(char *type, int index)
vtkGraphMapper::GetMTime
unsigned long GetMTime()
vtkGarbageCollector
Detect and break reference loops.
Definition: vtkGarbageCollector.h:99
vtkGraphMapper::OutlineMapper
vtkSmartPointer< vtkPolyDataMapper > OutlineMapper
Definition: vtkGraphMapper.h:257
vtkGlyph3D
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:111
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkgl::width
GLint GLint GLsizei width
Definition: vtkgl.h:11316
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkLookupTable
map scalar values into colors via a lookup table
Definition: vtkLookupTable.h:74
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkGraphMapper::EnabledVerticesArrayName
char * EnabledVerticesArrayName
Definition: vtkGraphMapper.h:237
vtkgl::index
GLuint index
Definition: vtkgl.h:11983
vtkGraphMapper::SetIconSize
void SetIconSize(int *size)
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:45
vtkGraphMapper::GetIconVisibility
bool GetIconVisibility()
vtkGraphMapper::ColorVerticesOff
void ColorVerticesOff()
vtkGraphMapper::GetIconTexture
vtkTexture * GetIconTexture()
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:64
vtkGraphMapper::SetColorEdges
void SetColorEdges(bool vis)
vtkGraphMapper::Render
void Render(vtkRenderer *ren, vtkActor *act)
vtkGraphMapper::IconTypeToIndex
vtkSmartPointer< vtkMapArrayValues > IconTypeToIndex
Definition: vtkGraphMapper.h:252
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
vtkGraphMapper::VertexLookupTable
vtkLookupTable * VertexLookupTable
Definition: vtkGraphMapper.h:268
vtkGraphMapper::GetColorVertices
bool GetColorVertices()
VTKRENDERINGCORE_EXPORT
#define VTKRENDERINGCORE_EXPORT
Definition: vtkRenderingCoreModule.h:15
vtkGraphMapper::VertexColorArrayNameInternal
char * VertexColorArrayNameInternal
Definition: vtkGraphMapper.h:231
vtkGraph
Base class for graph data types.
Definition: vtkGraph.h:289
vtkCellCenters
generate points at center of cells
Definition: vtkCellCenters.h:47
vtkX3D::filled
@ filled
Definition: vtkX3D.h:349
vtkGraphMapper::VertexMapper
vtkSmartPointer< vtkPolyDataMapper > VertexMapper
Definition: vtkGraphMapper.h:256
vtkgl::type
GLuint GLuint GLsizei GLenum type
Definition: vtkgl.h:11315
vtkVertexGlyphFilter
Make a vtkPolyData with a vertex on each point.
Definition: vtkVertexGlyphFilter.h:43
vtkGraphMapper::EdgeActor
vtkSmartPointer< vtkActor > EdgeActor
Definition: vtkGraphMapper.h:260
vtkGraphMapper::EnableEdgesByArray
int EnableEdgesByArray
Definition: vtkGraphMapper.h:238
vtkGraphMapper::EnabledEdgesArrayName
char * EnabledEdgesArrayName
Definition: vtkGraphMapper.h:236
vtkGraphMapper::~vtkGraphMapper
~vtkGraphMapper()
vtkgl::size
GLsizeiptr size
Definition: vtkgl.h:11843