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