vtkGridAxesHelper.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
3 // SPDX-License-Identifier: BSD-3-Clause
16 #ifndef vtkGridAxesHelper_h
17 #define vtkGridAxesHelper_h
18 
19 #include "vtkObject.h"
20 
21 #include "vtkRemotingViewsModule.h" //needed for exports
22 #include "vtkVector.h" // needed for vtkVector.
23 
24 class vtkMatrix4x4;
25 class vtkViewport;
26 
28 {
29 public:
30  static vtkGridAxesHelper* New();
31  vtkTypeMacro(vtkGridAxesHelper, vtkObject);
32  void PrintSelf(ostream& os, vtkIndent indent) override;
33 
35 
40  vtkSetVector6Macro(GridBounds, double);
41  vtkGetVector6Macro(GridBounds, double);
43 
44  // These are in the same order as the faces of a vtkVoxel.
45  enum Faces
46  {
52  MAX_XY
53  };
54 
56 
59  vtkSetClampMacro(Face, int, MIN_YZ, MAX_XY);
60  vtkGetMacro(Face, int);
62 
67  {
68  MIN_X = 0x01,
69  MIN_Y = 0x02,
70  MIN_Z = 0x04,
71  MAX_X = 0x08,
72  MAX_Y = 0x010,
73  MAX_Z = 0x020
74  };
75 
77 
80  vtkSetMacro(LabelMask, unsigned int);
81  vtkGetMacro(LabelMask, unsigned int);
83 
89  vtkTuple<vtkVector3d, 4> GetPoints();
90 
97  vtkVector2i GetActiveAxes();
98 
103  vtkTuple<bool, 4> GetLabelVisibilities();
104 
106 
111  void SetMatrix(vtkMatrix4x4*);
112  vtkGetObjectMacro(Matrix, vtkMatrix4x4);
114 
121  vtkTuple<vtkVector3d, 4> GetTransformedPoints();
122 
126  vtkVector3d TransformPoint(const vtkVector3d& point);
127 
134  vtkVector3d GetTransformedFaceNormal();
135 
141  bool UpdateForViewport(vtkViewport* viewport);
142 
146  vtkTuple<vtkVector2i, 4> GetViewportPoints() const { return this->ViewportPoints; }
148  {
149  return this->ViewportPointsAsDouble;
150  }
151 
156  vtkTuple<vtkVector2d, 4> GetViewportVectors() const { return this->ViewportVectors; }
157 
162  vtkTuple<vtkVector2d, 4> GetViewportNormals() const { return this->ViewportNormals; }
163 
165 
168  vtkGetMacro(Backface, bool);
170 
171 protected:
173  ~vtkGridAxesHelper() override;
174 
181  {
182  this->LabelVisibilityOverrides = overrides;
183  }
184  vtkTuple<bool, 4> GetLabelVisibilityOverrides() { return this->LabelVisibilityOverrides; }
185  friend class vtkGridAxes3DActor;
186 
187  double GridBounds[6];
188  int Face;
189  unsigned int LabelMask;
191 
197 
200 
205  bool Backface;
206 
209 
210 private:
211  vtkGridAxesHelper(const vtkGridAxesHelper&) = delete;
212  void operator=(const vtkGridAxesHelper&) = delete;
213 };
214 
215 #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
#define VTKREMOTINGVIEWS_EXPORT
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
vtkMTimeType GetPointsMTime
vtkMatrix4x4 * Matrix
vtkTuple< vtkVector2d, 4 > ViewportPointsAsDouble
void SetLabelVisibilityOverrides(const vtkTuple< bool, 4 > &overrides)
Get/Set label visibility overrides.
vtkTuple< bool, 4 > GetLabelVisibilityOverrides()
vtkTypeUInt64 vtkMTimeType
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
actor for a cube-axes like prop in the 3D view.
vtkTuple< bool, 4 > LabelVisibilities
vtkMTimeType GetTransformedPointsMTime
unsigned int LabelMask
is a helper object used by vtkGridAxes2DActor, vtkGridAxes3DActor, and vtkGridAxesPlane2DActor.
static vtkObject * New()
vtkTuple< vtkVector2d, 4 > GetViewportPointsAsDouble() const
void operator=(const vtkObjectBase &)
vtkTuple< vtkVector3d, 4 > Points
vtkTuple< vtkVector2d, 4 > ViewportVectors
LabelMasks
Valid values for LabelMask.