VTK
vtkChartXYZ.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkChartXYZ.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 
25 #ifndef vtkChartXYZ_h
26 #define vtkChartXYZ_h
27 
28 #include "vtkChartsCoreModule.h" // For export macro
29 #include "vtkContextItem.h"
30 #include "vtkColor.h" // For vtkColor4ub
31 #include "vtkRect.h" // For vtkRectf ivars
32 #include "vtkNew.h" // For ivars
33 #include "vtkSmartPointer.h" // For ivars
34 #include <vector> // For ivars
35 
36 class vtkAnnotationLink;
37 class vtkAxis;
38 class vtkContext3D;
40 class vtkPen;
41 class vtkPlaneCollection;
42 class vtkPlot3D;
43 class vtkTable;
44 class vtkTransform;
46 
48 {
49 public:
51  virtual void PrintSelf(ostream &os, vtkIndent indent);
52 
53  static vtkChartXYZ * New();
54 
59  void SetGeometry(const vtkRectf &bounds);
60 
62  void SetAngle(double angle);
63 
65  void SetAroundX(bool isX);
66 
68  virtual void SetAnnotationLink(vtkAnnotationLink *link);
69 
71  vtkAxis * GetAxis(int axis);
72 
74 
78 
81  void SetAutoRotate(bool b);
82 
85  void SetDecorateAxes(bool b);
86 
89  void SetFitToScene(bool b);
90 
93  virtual void Update();
94 
97  virtual bool Paint(vtkContext2D *painter);
98 
100  virtual vtkIdType AddPlot(vtkPlot3D* plot);
101 
103  void ClearPlots();
104 
108 
113 
114  //BTX
116  virtual bool Hit(const vtkContextMouseEvent &mouse);
117 
119  virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse);
120 
123  virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse);
124 
126  virtual bool MouseWheelEvent(const vtkContextMouseEvent &mouse, int delta);
127 
129 
132  virtual bool KeyPressEvent(const vtkContextKeyEvent &key);
133  //ETX
135 
136 protected:
139 
143  virtual void CalculateTransforms();
144 
146 
153 
155  bool Rotate(const vtkContextMouseEvent &mouse);
156 
158  bool Pan(const vtkContextMouseEvent &mouse);
159 
161  bool Zoom(const vtkContextMouseEvent &mouse);
162 
164  bool Spin(const vtkContextMouseEvent &mouse);
165 
168  void LookDownX();
169 
172  void LookDownY();
173 
176  void LookDownZ();
177 
180  void LookUpX();
181 
184  void LookUpY();
185 
188  void LookUpZ();
189 
192 
194  void RescaleAxes();
195 
197  void ScaleUpAxes();
198 
201 
203  void ZoomAxes(int delta);
204 
209 
218 
221 
223  void DrawAxes(vtkContext3D *context);
224 
228 
230  void DrawTickMarks(vtkContext2D *painter);
231 
233  void DrawAxesLabels(vtkContext2D *painter);
234 
238  void GetOffsetForAxisLabel(int axis, float *bounds, float *offset);
239 
243  double CalculateNiceMinMax(double &min, double &max, int axis);
244 
246  void GetClippingPlaneEquation(int i, double *planeEquation);
247 
250 
252  std::vector< vtkSmartPointer<vtkAxis> > Axes;
253 
257 
260  bool IsX;
261 
264  double Angle;
265 
269 
273 
277 
282 
286 
289 
293 
297 
301 
306 
309 
312 
315 
318 
320  std::vector<vtkPlot3D *> Plots;
321 
324 
327 
330 
333 
336  float AxesBoundaryPoints[14][3];
337 
340  float TickLabelOffset[3][2];
341 
344 
347 
349 
350  int XAxisToLabel[3];
351  int YAxisToLabel[3];
352  int ZAxisToLabel[3];
354 
356  int DirectionToData[3];
357 
359  double DataBounds[4];
360 
361 private:
362  vtkChartXYZ(const vtkChartXYZ &); // Not implemented.
363  void operator=(const vtkChartXYZ &); // Not implemented.
364 };
365 
366 #endif
vtkChartXYZ::Spin
bool Spin(const vtkContextMouseEvent &mouse)
vtkgl::z
GLdouble GLdouble z
Definition: vtkgl.h:11754
vtkChartXYZ::Scale
vtkNew< vtkTransform > Scale
Definition: vtkChartXYZ.h:296
vtkChartXYZ::ScaleUpAxes
void ScaleUpAxes()
vtkChartsCoreModule.h
vtkChartXYZ::Box
vtkNew< vtkTransform > Box
Definition: vtkChartXYZ.h:285
vtkChartXYZ::AddPlot
virtual vtkIdType AddPlot(vtkPlot3D *plot)
vtkChartXYZ::Pen
vtkNew< vtkPen > Pen
Definition: vtkChartXYZ.h:311
vtkContextMouseEvent
data structure to represent mouse events.
Definition: vtkContextMouseEvent.h:40
vtkChartXYZ::BoxScale
vtkNew< vtkTransform > BoxScale
Definition: vtkChartXYZ.h:300
vtkChartXYZ::CalculatePlotTransform
bool CalculatePlotTransform(vtkAxis *x, vtkAxis *y, vtkAxis *z, vtkTransform *transform)
vtkChartXYZ::InitializeFutureBox
void InitializeFutureBox()
vtkContextKeyEvent
data structure to represent key events.
Definition: vtkContextKeyEvent.h:34
vtkChartXYZ::LookDownZ
void LookDownZ()
vtkChartXYZ::Pan
bool Pan(const vtkContextMouseEvent &mouse)
vtkChartXYZ::Rotation
vtkNew< vtkTransform > Rotation
Definition: vtkChartXYZ.h:288
vtkgl::b
GLboolean GLboolean GLboolean b
Definition: vtkgl.h:12312
vtkChartXYZ::PrintSelf
virtual void PrintSelf(ostream &os, vtkIndent indent)
vtkChartXYZ::InitializeAxesBoundaryPoints
void InitializeAxesBoundaryPoints()
vtkIdType
int vtkIdType
Definition: vtkType.h:275
vtkChartXYZ::ZoomAxes
void ZoomAxes(int delta)
vtkChartXYZ::PlotTransform
vtkNew< vtkTransform > PlotTransform
Definition: vtkChartXYZ.h:281
vtkTable
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:68
vtkX3D::key
@ key
Definition: vtkX3D.h:257
vtkChartXYZ::Axes
std::vector< vtkSmartPointer< vtkAxis > > Axes
Definition: vtkChartXYZ.h:252
vtkChartXYZ::IsX
bool IsX
Definition: vtkChartXYZ.h:260
vtkChartXYZ::SetAroundX
void SetAroundX(bool isX)
vtkChartXYZ
Factory class for drawing 3D XYZ charts.
Definition: vtkChartXYZ.h:48
vtkChartXYZ::SetGeometry
void SetGeometry(const vtkRectf &bounds)
vtkChartXYZ::DetermineWhichAxesToLabel
void DetermineWhichAxesToLabel()
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:49
vtkChartXYZ::~vtkChartXYZ
~vtkChartXYZ()
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkChartXYZ::LookUpY
void LookUpY()
vtkSmartPointer< vtkAnnotationLink >
vtkChartXYZ::RecalculateBounds
void RecalculateBounds()
vtkChartXYZ::DrawAxes
void DrawAxes(vtkContext3D *context)
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkContext2D
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:57
vtkChartXYZ::GetAxis
vtkAxis * GetAxis(int axis)
vtkChartXYZ::GetAxisColor
vtkColor4ub GetAxisColor()
vtkContextItem.h
vtkChartXYZ::SetAxisColor
void SetAxisColor(const vtkColor4ub &color)
vtkChartXYZ::ScaleDownAxes
void ScaleDownAxes()
vtkTransform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:60
vtkChartXYZ::GetClippingPlaneEquation
void GetClippingPlaneEquation(int i, double *planeEquation)
vtkChartXYZ::CheckForSceneResize
bool CheckForSceneResize()
vtkChartXYZ::LookDownY
void LookDownY()
vtkChartXYZ::Hit
virtual bool Hit(const vtkContextMouseEvent &mouse)
vtkChartXYZ::vtkChartXYZ
vtkChartXYZ()
max
#define max(a, b)
Definition: vtkX3DExporterFIWriterHelper.h:30
vtkChartXYZ::CalculateTransforms
virtual void CalculateTransforms()
vtkChartXYZ::GetOffsetForAxisLabel
void GetOffsetForAxisLabel(int axis, float *bounds, float *offset)
vtkChartXYZ::Zoom
bool Zoom(const vtkContextMouseEvent &mouse)
vtkChartXYZ::SetAnnotationLink
virtual void SetAnnotationLink(vtkAnnotationLink *link)
vtkChartXYZ::Rotate
bool Rotate(const vtkContextMouseEvent &mouse)
vtkChartXYZ::YAxisLabel
std::string YAxisLabel
Definition: vtkChartXYZ.h:326
vtkChartXYZ::Link
vtkSmartPointer< vtkAnnotationLink > Link
Definition: vtkChartXYZ.h:317
vtkChartXYZ::Update
virtual void Update()
vtkChartXYZ::LookUpZ
void LookUpZ()
vtkChartXYZ::ZAxisLabel
std::string ZAxisLabel
Definition: vtkChartXYZ.h:329
vtkChartXYZ::RecalculateTransform
void RecalculateTransform()
vtkColor.h
vtkChartXYZ::ComputeDataBounds
void ComputeDataBounds()
vtkRect.h
vtkChartXYZ::Paint
virtual bool Paint(vtkContext2D *painter)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkChartXYZ::New
static vtkChartXYZ * New()
vtkSmartPointer.h
vtkgl::offset
GLintptr offset
Definition: vtkgl.h:11844
vtkNew< vtkTransform >
vtkChartXYZ::Geometry
vtkRectf Geometry
Definition: vtkChartXYZ.h:249
vtkChartXYZ::RescaleAxes
void RescaleAxes()
vtkChartXYZ::DrawAxesLabels
void DrawAxesLabels(vtkContext2D *painter)
vtkgl::color
GLuint color
Definition: vtkgl.h:12351
vtkChartXYZ::Angle
double Angle
Definition: vtkChartXYZ.h:264
vtkChartXYZ::SetFitToScene
void SetFitToScene(bool b)
vtkChartXYZ::ContextTransform
vtkNew< vtkTransform > ContextTransform
Definition: vtkChartXYZ.h:276
vtkChartXYZ::Translation
vtkNew< vtkTransform > Translation
Definition: vtkChartXYZ.h:292
vtkChartXYZ::FitToScene
bool FitToScene
Definition: vtkChartXYZ.h:272
vtkChartXYZ::ClearPlots
void ClearPlots()
vtkContextItem
base class for items that are part of a vtkContextScene.
Definition: vtkContextItem.h:34
vtkPlot3D
Abstract class for 3D plots.
Definition: vtkPlot3D.h:44
vtkChartXYZ::LookUpX
void LookUpX()
vtkChartXYZ::BoundingCube
vtkNew< vtkPlaneCollection > BoundingCube
Definition: vtkChartXYZ.h:332
vtkChartXYZ::Plots
std::vector< vtkPlot3D * > Plots
Definition: vtkChartXYZ.h:320
vtkgl::y
GLint GLint GLint GLint GLint GLint y
Definition: vtkgl.h:11318
vtkNew.h
vtkChartXYZ::SetDecorateAxes
void SetDecorateAxes(bool b)
vtkChartXYZ::FutureBox
vtkNew< vtkTransform > FutureBox
Definition: vtkChartXYZ.h:305
vtkChartXYZ::KeyPressEvent
virtual bool KeyPressEvent(const vtkContextKeyEvent &key)
vtkChartXYZ::AxisPen
vtkNew< vtkPen > AxisPen
Definition: vtkChartXYZ.h:314
vtkChartXYZ::MouseMoveEvent
virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse)
vtkAxis
takes care of drawing 2D axes
Definition: vtkAxis.h:71
vtkChartXYZ::DrawTickMarks
void DrawTickMarks(vtkContext2D *painter)
vtkColor4ub
Definition: vtkColor.h:209
vtkgl::angle
GLfloat angle
Definition: vtkgl.h:18174
vtkChartXYZ::FutureBoxScale
vtkNew< vtkTransform > FutureBoxScale
Definition: vtkChartXYZ.h:308
vtkContext3D
Class for drawing 3D primitives to a graphical context.
Definition: vtkContext3D.h:40
vtkChartXYZ::SetAngle
void SetAngle(double angle)
vtkChartXYZ::SceneHeight
int SceneHeight
Definition: vtkChartXYZ.h:343
vtkPen
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition: vtkPen.h:39
vtkPlaneCollection
maintain a list of planes
Definition: vtkPlaneCollection.h:36
vtkChartXYZ::DrawAxesDecoration
bool DrawAxesDecoration
Definition: vtkChartXYZ.h:268
VTKCHARTSCORE_EXPORT
#define VTKCHARTSCORE_EXPORT
Definition: vtkChartsCoreModule.h:15
vtkgl::transform
GLuint GLenum GLenum transform
Definition: vtkgl.h:16451
vtkChartXYZ::LookDownX
void LookDownX()
vtkRectf
Definition: vtkRect.h:97
vtkChartXYZ::MouseWheelEvent
virtual bool MouseWheelEvent(const vtkContextMouseEvent &mouse, int delta)
vtkgl::string
GLsizei const GLchar ** string
Definition: vtkgl.h:12011
vtkChartXYZ::SetAutoRotate
void SetAutoRotate(bool b)
vtkChartXYZ::MouseButtonPressEvent
virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse)
vtkChartXYZ::CalculateNiceMinMax
double CalculateNiceMinMax(double &min, double &max, int axis)
vtkChartXYZ::XAxisLabel
std::string XAxisLabel
Definition: vtkChartXYZ.h:323
vtkChartXYZ::AutoRotate
bool AutoRotate
Definition: vtkChartXYZ.h:256
vtkChartXYZ::SceneWidth
int SceneWidth
Definition: vtkChartXYZ.h:346