ParaView
vtkGridAxesHelper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkGridAxesHelper.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 =========================================================================*/
27 #ifndef vtkGridAxesHelper_h
28 #define vtkGridAxesHelper_h
29 
30 #include "vtkObject.h"
31 
32 #include "vtkPVVTKExtensionsDefaultModule.h" //needed for exports
33 #include "vtkVector.h" // needed for vtkVector.
34 
35 class vtkMatrix4x4;
36 class vtkViewport;
37 
38 class VTKPVVTKEXTENSIONSDEFAULT_EXPORT vtkGridAxesHelper : public vtkObject
39 {
40 public:
41  static vtkGridAxesHelper* New();
42  vtkTypeMacro(vtkGridAxesHelper, vtkObject);
43  void PrintSelf(ostream& os, vtkIndent indent);
44 
46 
51  vtkSetVector6Macro(GridBounds, double);
52  vtkGetVector6Macro(GridBounds, double);
54 
55  // These are in the same order as the faces of a vtkVoxel.
56  enum Faces
57  {
63  MAX_XY
64  };
65 
67 
70  vtkSetClampMacro(Face, int, MIN_YZ, MAX_XY);
71  vtkGetMacro(Face, int);
73 
78  {
79  MIN_X = 0x01,
80  MIN_Y = 0x02,
81  MIN_Z = 0x04,
82  MAX_X = 0x08,
83  MAX_Y = 0x010,
84  MAX_Z = 0x020
85  };
86 
88 
91  vtkSetMacro(LabelMask, unsigned int);
92  vtkGetMacro(LabelMask, unsigned int);
94 
100  vtkTuple<vtkVector3d, 4> GetPoints();
101 
108  vtkVector2i GetActiveAxes();
109 
114  vtkTuple<bool, 4> GetLabelVisibilities();
115 
117 
122  void SetMatrix(vtkMatrix4x4*);
123  vtkGetObjectMacro(Matrix, vtkMatrix4x4);
125 
132  vtkTuple<vtkVector3d, 4> GetTransformedPoints();
133 
137  vtkVector3d TransformPoint(const vtkVector3d& point);
138 
145  vtkVector3d GetTransformedFaceNormal();
146 
152  bool UpdateForViewport(vtkViewport* viewport);
153 
157  vtkTuple<vtkVector2i, 4> GetViewportPoints() const { return this->ViewportPoints; }
158  vtkTuple<vtkVector2d, 4> GetViewportPointsAsDouble() const
159  {
160  return this->ViewportPointsAsDouble;
161  }
162 
167  vtkTuple<vtkVector2d, 4> GetViewportVectors() const { return this->ViewportVectors; }
168 
173  vtkTuple<vtkVector2d, 4> GetViewportNormals() const { return this->ViewportNormals; }
174 
176 
179  vtkGetMacro(Backface, bool);
181 
182 protected:
185 
191  void SetLabelVisibilityOverrides(const vtkTuple<bool, 4>& overrides)
192  {
193  this->LabelVisibilityOverrides = overrides;
194  }
195  vtkTuple<bool, 4> GetLabelVisibilityOverrides() { return this->LabelVisibilityOverrides; }
196  friend class vtkGridAxes3DActor;
197 
198  double GridBounds[6];
199  int Face;
200  unsigned int LabelMask;
201  vtkMatrix4x4* Matrix;
202 
203  vtkTuple<vtkVector3d, 4> Points;
204  vtkVector2i ActiveAxes;
205  vtkTuple<bool, 4> LabelVisibilities;
206  vtkTuple<bool, 4> ComputedLabelVisibilities;
207  vtkTuple<bool, 4> LabelVisibilityOverrides;
208 
209  vtkTuple<vtkVector3d, 4> TransformedPoints;
211 
212  vtkTuple<vtkVector2i, 4> ViewportPoints;
213  vtkTuple<vtkVector2d, 4> ViewportPointsAsDouble;
214  vtkTuple<vtkVector2d, 4> ViewportVectors;
215  vtkTuple<vtkVector2d, 4> ViewportNormals;
216  bool Backface;
217 
218  vtkMTimeType GetPointsMTime;
220 
221 private:
222  vtkGridAxesHelper(const vtkGridAxesHelper&) VTK_DELETE_FUNCTION;
223  void operator=(const vtkGridAxesHelper&) VTK_DELETE_FUNCTION;
224 };
225 
226 #endif
vtkTuple< bool, 4 > LabelVisibilityOverrides
vtkTuple< vtkVector2d, 4 > GetViewportVectors() const
Get the axis vectors formed using the points returned by GetViewportPoints().
vtkTuple< vtkVector2d, 4 > GetViewportNormals() const
Get the normals to the axis vectors in viewport space.
vtkTuple< bool, 4 > ComputedLabelVisibilities
vtkMTimeType GetPointsMTime
vtkMatrix4x4 * Matrix
vtkTuple< vtkVector2d, 4 > ViewportPointsAsDouble
void SetLabelVisibilityOverrides(const vtkTuple< bool, 4 > &overrides)
Get/Set label visibility overrides.
vtkTuple< bool, 4 > GetLabelVisibilityOverrides()
vtkTuple< vtkVector2d, 4 > ViewportNormals
vtkTuple< vtkVector2i, 4 > GetViewportPoints() const
Get the positions for the plane points in viewport coordinates.
vtkTuple< vtkVector3d, 4 > TransformedPoints
vtkVector3d TransformedFaceNormal
vtkTuple< vtkVector2i, 4 > ViewportPoints
vtkTuple< bool, 4 > LabelVisibilities
vtkMTimeType GetTransformedPointsMTime
unsigned int LabelMask
is a helper object used by vtkGridAxes2DActor, vtkGridAxes3DActor, and vtkGridAxesPlane2DActor.
vtkTuple< vtkVector2d, 4 > GetViewportPointsAsDouble() const
vtkTuple< vtkVector3d, 4 > Points
vtkTuple< vtkVector2d, 4 > ViewportVectors
LabelMasks
Valid values for LabelMask.