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();
62  vtkTypeMacro(vtkGraphMapper, vtkMapper);
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);
75  bool GetColorVertices();
76  void ColorVerticesOn();
77  void ColorVerticesOff();
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);
99  bool GetEdgeVisibility();
100  vtkBooleanMacro(EdgeVisibility, bool);
102 
104 
105  void SetEdgeColorArrayName(const char* name);
106  const char* GetEdgeColorArrayName();
108 
110 
111  void SetColorEdges(bool vis);
112  bool GetColorEdges();
113  void ColorEdgesOn();
114  void ColorEdgesOff();
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 
156  void ClearIconTypes();
157 
159 
161  void SetIconSize(int *size);
162  int *GetIconSize();
164 
167  void SetIconAlignment(int alignment);
168 
170 
171  vtkTexture *GetIconTexture();
172  void SetIconTexture(vtkTexture *texture);
174 
176 
177  void SetIconVisibility(bool vis);
178  bool GetIconVisibility();
179  vtkBooleanMacro(IconVisibility, bool);
181 
183 
184  vtkGetMacro(VertexPointSize,float);
185  void SetVertexPointSize(float size);
187 
189 
190  vtkGetMacro(EdgeLineWidth,float);
191  void SetEdgeLineWidth(float width);
193 
198 
200  unsigned long GetMTime();
201 
203 
204  void SetInputData(vtkGraph *input);
205  vtkGraph *GetInput();
207 
209 
211  virtual double *GetBounds();
212  virtual void GetBounds(double* bounds)
213  { Superclass::GetBounds(bounds); }
215 
217 
218  vtkGetObjectMacro(EdgeLookupTable, vtkLookupTable);
219  vtkGetObjectMacro(VertexLookupTable, vtkLookupTable);
221 
222 protected:
223  vtkGraphMapper();
224  ~vtkGraphMapper();
225 
227 
228  vtkGetStringMacro(VertexColorArrayNameInternal);
229  vtkSetStringMacro(VertexColorArrayNameInternal);
230  vtkGetStringMacro(EdgeColorArrayNameInternal);
231  vtkSetStringMacro(EdgeColorArrayNameInternal);
235 
240 
241  vtkGetStringMacro(IconArrayNameInternal);
242  vtkSetStringMacro(IconArrayNameInternal);
243  char* IconArrayNameInternal;
244 
245  //BTX
248 
254 
259 
264  //ETX
265 
266  // Color maps
269 
270  virtual void ReportReferences(vtkGarbageCollector*);
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
char * EdgeColorArrayNameInternal
map vtkGraph and derived classes to graphics primitives
char * EnabledVerticesArrayName
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:50
actor that draws 2D data with texture support
virtual void ReleaseGraphicsResources(vtkWindow *)
Definition: vtkMapper.h:109
char * IconArrayNameInternal
Map values in an input array to different values in an output array of (possibly) different type...
Store vtkAlgorithm input/output information.
Filter that generates a polydata consisting of quads with texture coordinates referring to a set of i...
vtkSmartPointer< vtkPolyDataMapper > OutlineMapper
a actor that draws 2D data
Definition: vtkActor2D.h:44
map scalar values into colors via a lookup table
abstract specification for renderers
Definition: vtkRenderer.h:63
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:83
vtkSmartPointer< vtkGlyph3D > CircleOutlineGlyph
vtkSmartPointer< vtkIconGlyphFilter > IconGlyph
vtkSmartPointer< vtkActor > OutlineActor
generate points at center of cells
Detect and break reference loops.
vtkSmartPointer< vtkTransformCoordinateSystems > IconTransform
convert a vtkGraph to vtkPolyData
Base class for graph data types.
Definition: vtkGraph.h:288
virtual void ReportReferences(vtkGarbageCollector *)
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
Make a vtkPolyData with a vertex on each point.
a simple class to control print indentation
Definition: vtkIndent.h:38
a virtual camera for 3D rendering
Definition: vtkCamera.h:48
vtkLookupTable * VertexLookupTable
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:110
vtkSmartPointer< vtkPolyDataMapper > VertexMapper
void PrintSelf(ostream &os, vtkIndent indent)
vtkSmartPointer< vtkGlyph3D > CircleGlyph
handles properties associated with a texture map
Definition: vtkTexture.h:69
virtual double * GetBounds()=0
vtkLookupTable * EdgeLookupTable
vtkSmartPointer< vtkActor > EdgeActor
transform points into different coordinate systems
virtual int FillInputPortInformation(int port, vtkInformation *info)
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:89
map vtkPolyData to graphics primitives
a subclass of actor that always faces the camera
Definition: vtkFollower.h:45
vtkSmartPointer< vtkTexturedActor2D > IconActor
vtkSmartPointer< vtkActor > VertexActor
char * EnabledEdgesArrayName
#define VTKRENDERINGCORE_EXPORT
virtual double * GetBounds()
vtkSmartPointer< vtkGraphToPolyData > GraphToPoly
unsigned long GetMTime()
static vtkAlgorithm * New()
vtkSmartPointer< vtkMapArrayValues > IconTypeToIndex
vtkDataSet * GetInput()
vtkSmartPointer< vtkVertexGlyphFilter > VertexGlyph
vtkSmartPointer< vtkPolyDataMapper2D > IconMapper
virtual void GetBounds(double *bounds)
vtkSmartPointer< vtkPolyDataMapper > EdgeMapper
virtual void Render(vtkRenderer *ren, vtkActor *a)=0
char * VertexColorArrayNameInternal
draw vtkPolyData onto the image plane