VTK
vtkSpiderPlotActor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSpiderPlotActor.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 =========================================================================*/
51 #ifndef vtkSpiderPlotActor_h
52 #define vtkSpiderPlotActor_h
53 
54 #include "vtkRenderingAnnotationModule.h" // For export macro
55 #include "vtkActor2D.h"
56 
57 class vtkAlgorithmOutput;
58 class vtkAxisActor2D;
59 class vtkDataObject;
60 class vtkPolyData;
62 class vtkTextMapper;
63 class vtkTextProperty;
64 class vtkLegendBoxActor;
65 class vtkGlyphSource2D;
66 class vtkAxisLabelArray;
67 class vtkAxisRanges;
68 class vtkSpiderPlotActorConnection;
69 
70 
71 #define VTK_IV_COLUMN 0
72 #define VTK_IV_ROW 1
73 
75 {
76 public:
78 
80  void PrintSelf(ostream& os, vtkIndent indent);
82 
85 
87 
89  virtual void SetInputData(vtkDataObject*);
92 
94  virtual vtkDataObject* GetInput();
95 
97 
100  vtkSetClampMacro(IndependentVariables,int,VTK_IV_COLUMN, VTK_IV_ROW);
101  vtkGetMacro(IndependentVariables,int);
103  {this->SetIndependentVariables(VTK_IV_COLUMN);};
105  {this->SetIndependentVariables(VTK_IV_ROW);};
107 
109 
110  vtkSetMacro(TitleVisibility, int);
111  vtkGetMacro(TitleVisibility, int);
112  vtkBooleanMacro(TitleVisibility, int);
114 
116 
120 
122 
124  vtkGetObjectMacro(TitleTextProperty,vtkTextProperty);
126 
127  // Enable/Disable the display axes titles. These are arranged on the end
128  // of each radial axis on the circumference of the spider plot. The label
129  // text strings are derived from the names of the data object arrays
130  // associated with the input.
131  vtkSetMacro(LabelVisibility, int);
132  vtkGetMacro(LabelVisibility, int);
133  vtkBooleanMacro(LabelVisibility, int);
134 
136 
140  vtkGetObjectMacro(LabelTextProperty,vtkTextProperty);
142 
144 
146  vtkSetClampMacro(NumberOfRings,int,0,VTK_INT_MAX);
147  vtkGetMacro(NumberOfRings,int);
149 
151 
153  void SetAxisLabel(const int i, const char *);
154  const char* GetAxisLabel(int i);
156 
158 
160  void SetAxisRange(int i, double min, double max);
161  void SetAxisRange(int i, double range[2]);
162  void GetAxisRange(int i, double range[2]);
164 
166 
168  void SetPlotColor(int i, double r, double g, double b);
169  void SetPlotColor(int i, const double color[3])
170  { this->SetPlotColor(i, color[0], color[1], color[2]); }
171  double *GetPlotColor(int i);
173 
175 
178  vtkSetMacro(LegendVisibility, int);
179  vtkGetMacro(LegendVisibility, int);
180  vtkBooleanMacro(LegendVisibility, int);
182 
184 
188 
190 
195 
198 
203 
204 protected:
207 
208 private:
209 
210  vtkSpiderPlotActorConnection* ConnectionHolder;
211 
212  int IndependentVariables; // Use column or row
213  int TitleVisibility; // Should I see the title?
214  char *Title; // The title string
215  vtkTextProperty *TitleTextProperty;
216  int LabelVisibility;
217  vtkTextProperty *LabelTextProperty;
218  vtkAxisLabelArray *Labels;
219  int LegendVisibility;
220  vtkLegendBoxActor *LegendActor;
221  vtkGlyphSource2D *GlyphSource;
222  int NumberOfRings;
223  int AutomaticRangeComputation;
224 
225  // Local variables needed to plot
226  vtkIdType N; // The number of independent variables
227  double *Mins; // Minimum data value along this row/column
228  double *Maxs; // Maximum data value along this row/column
229  vtkAxisRanges *Ranges;
230 
231  vtkTextMapper **LabelMappers; //a label for each radial spoke
232  vtkActor2D **LabelActors;
233 
234  vtkTextMapper *TitleMapper;
235  vtkActor2D *TitleActor;
236 
237  vtkPolyData *WebData; // The web of the spider plot
238  vtkPolyDataMapper2D *WebMapper;
239  vtkActor2D *WebActor;
240 
241  vtkPolyData *PlotData; // The lines drawn within the axes
242  vtkPolyDataMapper2D *PlotMapper;
243  vtkActor2D *PlotActor;
244 
246 
247  double Center[3];
248  double Radius;
249  double Theta;
250 
251  int LastPosition[2];
252  int LastPosition2[2];
253  double P1[3];
254  double P2[3];
255 
256  void Initialize();
257  int PlaceAxes(vtkViewport *viewport, int *size);
258  int BuildPlot(vtkViewport*);
259 
260 private:
261  vtkSpiderPlotActor(const vtkSpiderPlotActor&); // Not implemented.
262  void operator=(const vtkSpiderPlotActor&); // Not implemented.
263 };
264 
265 
266 #endif
267 
vtkSpiderPlotActor::GetAxisRange
void GetAxisRange(int i, double range[2])
vtkRenderingAnnotationModule.h
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:132
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkSpiderPlotActor::SetTitleTextProperty
virtual void SetTitleTextProperty(vtkTextProperty *p)
vtkGlyphSource2D
create 2D glyphs represented by vtkPolyData
Definition: vtkGlyphSource2D.h:62
vtkPolyDataMapper2D
draw vtkPolyData onto the image plane
Definition: vtkPolyDataMapper2D.h:51
vtkgl::b
GLboolean GLboolean GLboolean b
Definition: vtkgl.h:12312
VTK_IV_ROW
#define VTK_IV_ROW
Definition: vtkSpiderPlotActor.h:72
vtkSpiderPlotActor::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkIdType
int vtkIdType
Definition: vtkType.h:275
vtkSpiderPlotActor::SetIndependentVariablesToColumns
void SetIndependentVariablesToColumns()
Definition: vtkSpiderPlotActor.h:102
vtkSpiderPlotActor::GetInput
virtual vtkDataObject * GetInput()
VTK_IV_COLUMN
#define VTK_IV_COLUMN
Definition: vtkSpiderPlotActor.h:71
vtkLegendBoxActor
draw symbols with text
Definition: vtkLegendBoxActor.h:61
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:35
vtkSpiderPlotActor::SetInputConnection
virtual void SetInputConnection(vtkAlgorithmOutput *)
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkSpiderPlotActor::vtkSpiderPlotActor
vtkSpiderPlotActor()
vtkSpiderPlotActor::SetPlotColor
void SetPlotColor(int i, double r, double g, double b)
vtkSpiderPlotActor::SetIndependentVariablesToRows
void SetIndependentVariablesToRows()
Definition: vtkSpiderPlotActor.h:104
vtkgl::range
GLenum GLint * range
Definition: vtkgl.h:14180
vtkSpiderPlotActor::SetAxisRange
void SetAxisRange(int i, double range[2])
vtkSpiderPlotActor::SetPlotColor
void SetPlotColor(int i, const double color[3])
Definition: vtkSpiderPlotActor.h:169
vtkSpiderPlotActor
create a spider plot from input field
Definition: vtkSpiderPlotActor.h:75
vtkSpiderPlotActor::SetLabelTextProperty
virtual void SetLabelTextProperty(vtkTextProperty *p)
max
#define max(a, b)
Definition: vtkX3DExporterFIWriterHelper.h:30
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkSpiderPlotActor::GetAxisLabel
const char * GetAxisLabel(int i)
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkTextMapper
2D text annotation
Definition: vtkTextMapper.h:53
vtkSpiderPlotActor::SetAxisLabel
void SetAxisLabel(const int i, const char *)
vtkSpiderPlotActor::SetAxisRange
void SetAxisRange(int i, double min, double max)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkSetStringMacro
#define vtkSetStringMacro(name)
Definition: vtkSetGet.h:104
vtkSpiderPlotActor::RenderTranslucentPolygonalGeometry
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkSpiderPlotActor.h:193
vtkSpiderPlotActor::New
static vtkSpiderPlotActor * New()
vtkSpiderPlotActor::~vtkSpiderPlotActor
~vtkSpiderPlotActor()
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkGetStringMacro
vtkGetStringMacro(ExtensionsString)
vtkgl::color
GLuint color
Definition: vtkgl.h:12351
vtkSpiderPlotActor::HasTranslucentPolygonalGeometry
virtual int HasTranslucentPolygonalGeometry()
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
P1
#define P1
Definition: vtkTableBasedClipCases.h:849
vtkSpiderPlotActor::SetInputData
virtual void SetInputData(vtkDataObject *)
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:39
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkSpiderPlotActor::GetPlotColor
double * GetPlotColor(int i)
vtkgl::r
GLdouble GLdouble GLdouble r
Definition: vtkgl.h:11610
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:45
vtkActor2D.h
vtkgl::g
GLboolean GLboolean g
Definition: vtkgl.h:12312
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:39
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
vtkAxisActor2D
Create an axis with tick marks and labels.
Definition: vtkAxisActor2D.h:74
P2
#define P2
Definition: vtkTableBasedClipCases.h:850
vtkgl::p
GLfloat GLfloat p
Definition: vtkgl.h:15717
vtkSpiderPlotActor::RenderOverlay
int RenderOverlay(vtkViewport *)
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:65
vtkSpiderPlotActor::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *)
VTKRENDERINGANNOTATION_EXPORT
#define VTKRENDERINGANNOTATION_EXPORT
Definition: vtkRenderingAnnotationModule.h:15
vtkSpiderPlotActor::RenderOpaqueGeometry
int RenderOpaqueGeometry(vtkViewport *)
vtkgl::size
GLsizeiptr size
Definition: vtkgl.h:11843
BuildTime
vtkTimeStamp BuildTime
Definition: vtkOpenGLExtensionManager.h:327