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 "vtkMapper.h"
36 
37 #include "vtkSmartPointer.h" // Required for smart pointer internal ivars.
38 
39 class vtkActor2D;
40 class vtkMapArrayValues;
41 class vtkCamera;
42 class vtkFollower;
43 class vtkGraph;
44 class vtkGlyph3D;
45 class vtkGraphToPolyData;
46 class vtkIconGlyphFilter;
47 class vtkCellCenters;
48 class vtkPolyData;
49 class vtkPolyDataMapper;
51 class vtkLookupTable;
53 class vtkTexture;
54 class vtkTexturedActor2D;
56 class vtkViewTheme;
57 
58 
59 
61 {
62 public:
63  static vtkGraphMapper *New();
64  vtkTypeMacro(vtkGraphMapper,vtkMapper);
65  void PrintSelf(ostream& os, vtkIndent indent);
66  void Render(vtkRenderer *ren, vtkActor *act);
67 
69 
70  void SetVertexColorArrayName(const char* name);
71  const char* GetVertexColorArrayName();
73 
75 
76  void SetColorVertices(bool vis);
77  bool GetColorVertices();
78  void ColorVerticesOn();
79  void ColorVerticesOff();
81 
83 
87  void SetScaledGlyphs(bool arg);
88  vtkGetMacro(ScaledGlyphs,bool);
89  vtkBooleanMacro(ScaledGlyphs, bool);
91 
93 
94  vtkSetStringMacro(ScalingArrayName);
95  vtkGetStringMacro(ScalingArrayName);
97 
99 
100  void SetEdgeVisibility(bool vis);
101  bool GetEdgeVisibility();
102  vtkBooleanMacro(EdgeVisibility, bool);
104 
106 
107  void SetEdgeColorArrayName(const char* name);
108  const char* GetEdgeColorArrayName();
110 
112 
113  void SetColorEdges(bool vis);
114  bool GetColorEdges();
115  void ColorEdgesOn();
116  void ColorEdgesOff();
118 
120 
121  vtkSetStringMacro(EnabledEdgesArrayName);
122  vtkGetStringMacro(EnabledEdgesArrayName);
124 
126 
127  vtkSetMacro(EnableEdgesByArray,int);
128  vtkGetMacro(EnableEdgesByArray,int);
129  vtkBooleanMacro(EnableEdgesByArray,int);
131 
133 
134  vtkSetStringMacro(EnabledVerticesArrayName);
135  vtkGetStringMacro(EnabledVerticesArrayName);
137 
139 
141  vtkSetMacro(EnableVerticesByArray,int);
142  vtkGetMacro(EnableVerticesByArray,int);
143  vtkBooleanMacro(EnableVerticesByArray,int);
145 
147 
148  void SetIconArrayName(const char* name);
149  const char* GetIconArrayName();
151 
155  void AddIconType(char *type, int index);
156 
158  void ClearIconTypes();
159 
161 
163  void SetIconSize(int *size);
164  int *GetIconSize();
166 
169  void SetIconAlignment(int alignment);
170 
172 
173  vtkTexture *GetIconTexture();
174  void SetIconTexture(vtkTexture *texture);
176 
178 
179  void SetIconVisibility(bool vis);
180  bool GetIconVisibility();
181  vtkBooleanMacro(IconVisibility, bool);
183 
185 
186  vtkGetMacro(VertexPointSize,float);
187  void SetVertexPointSize(float size);
189 
191 
192  vtkGetMacro(EdgeLineWidth,float);
193  void SetEdgeLineWidth(float width);
195 
197  virtual void ApplyViewTheme(vtkViewTheme* theme);
198 
203 
205  unsigned long GetMTime();
206 
208 
209  void SetInput(vtkGraph *input);
210  vtkGraph *GetInput();
212 
214 
216  virtual double *GetBounds();
217  virtual void GetBounds(double* bounds)
218  { Superclass::GetBounds(bounds); }
220 
222 
223  vtkGetObjectMacro(EdgeLookupTable, vtkLookupTable);
224  vtkGetObjectMacro(VertexLookupTable, vtkLookupTable);
226 
227 protected:
228  vtkGraphMapper();
229  ~vtkGraphMapper();
230 
232 
233  vtkGetStringMacro(VertexColorArrayNameInternal);
234  vtkSetStringMacro(VertexColorArrayNameInternal);
235  vtkGetStringMacro(EdgeColorArrayNameInternal);
236  vtkSetStringMacro(EdgeColorArrayNameInternal);
240 
245 
246  vtkGetStringMacro(IconArrayNameInternal);
247  vtkSetStringMacro(IconArrayNameInternal);
248  char* IconArrayNameInternal;
249 
250  //BTX
253 
259 
264 
269  //ETX
270 
271  // Color maps
274 
275  virtual void ReportReferences(vtkGarbageCollector*);
276 
277  // see algorithm for more info
279 
280 private:
281  vtkGraphMapper(const vtkGraphMapper&); // Not implemented.
282  void operator=(const vtkGraphMapper&); // Not implemented.
283 
284  // Helper function
285  vtkPolyData* CreateCircle(bool filled);
286 
287  float VertexPointSize;
288  float EdgeLineWidth;
289  bool ScaledGlyphs;
290  char* ScalingArrayName;
291 };
292 
293 #endif
294 
295 
char * EdgeColorArrayNameInternal
map vtkGraph and derived classes to graphics primitives
char * EnabledVerticesArrayName
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:49
actor that draws 2D data with texture support
virtual void ReleaseGraphicsResources(vtkWindow *)
Definition: vtkMapper.h:105
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:43
map scalar values into colors via a lookup table
abstract specification for renderers
Definition: vtkRenderer.h:69
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:81
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:287
virtual void ReportReferences(vtkGarbageCollector *)
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:46
Make a vtkPolyData with a vertex on each point.
a simple class to control print indentation
Definition: vtkIndent.h:37
a virtual camera for 3D rendering
Definition: vtkCamera.h:47
vtkLookupTable * VertexLookupTable
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:109
vtkSmartPointer< vtkPolyDataMapper > VertexMapper
void PrintSelf(ostream &os, vtkIndent indent)
vtkSmartPointer< vtkGlyph3D > CircleGlyph
handles properties associated with a texture map
Definition: vtkTexture.h:68
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:85
#define VTK_RENDERING_EXPORT
map vtkPolyData to graphics primitives
a subclass of actor that always faces the camera
Definition: vtkFollower.h:44
vtkSmartPointer< vtkTexturedActor2D > IconActor
vtkSmartPointer< vtkActor > VertexActor
char * EnabledEdgesArrayName
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