vtkPVAxesActor.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
13 #ifndef vtkPVAxesActor_h
14 #define vtkPVAxesActor_h
15 
16 #include "vtkProp3D.h"
17 #include "vtkRemotingViewsModule.h" // needed for export macro
18 
19 class vtkRenderer;
20 class vtkPropCollection;
21 class vtkMapper;
22 class vtkProperty;
23 class vtkActor;
24 class vtkFollower;
25 class vtkCylinderSource;
26 class vtkLineSource;
27 class vtkConeSource;
28 class vtkSphereSource;
29 class vtkPolyData;
30 class vtkVectorText;
31 
33 {
34 public:
35  static vtkPVAxesActor* New();
36  vtkTypeMacro(vtkPVAxesActor, vtkProp3D);
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38 
44  void GetActors(vtkPropCollection*) override;
45 
47 
50  int RenderOpaqueGeometry(vtkViewport* viewport) override;
51  int RenderTranslucentPolygonalGeometry(vtkViewport* viewport) override;
52  int HasTranslucentPolygonalGeometry() override;
54 
58  void ShallowCopy(vtkProp* prop) override;
59 
65  void ReleaseGraphicsResources(vtkWindow*) override;
66 
68 
72  void GetBounds(double bounds[6]);
73  double* GetBounds() override;
75 
79  vtkMTimeType GetMTime() override;
80 
87  vtkMTimeType GetRedrawMTime() override;
88 
90 
93  void SetTotalLength(float v[3]) { this->SetTotalLength(v[0], v[1], v[2]); }
94  void SetTotalLength(float x, float y, float z);
95  vtkGetVectorMacro(TotalLength, float, 3);
97 
99 
102  void SetNormalizedShaftLength(float v[3]) { this->SetNormalizedShaftLength(v[0], v[1], v[2]); }
103  void SetNormalizedShaftLength(float x, float y, float z);
104  vtkGetVectorMacro(NormalizedShaftLength, float, 3);
106 
108 
111  void SetNormalizedTipLength(float v[3]) { this->SetNormalizedTipLength(v[0], v[1], v[2]); }
112  void SetNormalizedTipLength(float x, float y, float z);
113  vtkGetVectorMacro(NormalizedTipLength, float, 3);
115 
117 
120  vtkSetClampMacro(ConeResolution, int, 3, 128);
121  vtkGetMacro(ConeResolution, int);
122  vtkSetClampMacro(SphereResolution, int, 3, 128);
123  vtkGetMacro(SphereResolution, int);
124  vtkSetClampMacro(CylinderResolution, int, 3, 128);
125  vtkGetMacro(CylinderResolution, int);
127 
129 
132  vtkSetClampMacro(ConeRadius, float, 0, VTK_FLOAT_MAX);
133  vtkGetMacro(ConeRadius, float);
134  vtkSetClampMacro(SphereRadius, float, 0, VTK_FLOAT_MAX);
135  vtkGetMacro(SphereRadius, float);
136  vtkSetClampMacro(CylinderRadius, float, 0, VTK_FLOAT_MAX);
137  vtkGetMacro(CylinderRadius, float);
139 
141 
144  vtkSetClampMacro(XAxisLabelPosition, float, 0, 1);
145  vtkGetMacro(XAxisLabelPosition, float);
146  vtkSetClampMacro(YAxisLabelPosition, float, 0, 1);
147  vtkGetMacro(YAxisLabelPosition, float);
148  vtkSetClampMacro(ZAxisLabelPosition, float, 0, 1);
149  vtkGetMacro(ZAxisLabelPosition, float);
151 
155  void SetShaftType(int type);
157  void SetShaftTypeToLine() { this->SetShaftType(vtkPVAxesActor::LINE_SHAFT); }
159 
163  void SetTipType(int type);
164  void SetTipTypeToCone() { this->SetTipType(vtkPVAxesActor::CONE_TIP); }
165  void SetTipTypeToSphere() { this->SetTipType(vtkPVAxesActor::SPHERE_TIP); }
167 
169 
172  void SetUserDefinedTip(vtkPolyData*);
173  vtkGetObjectMacro(UserDefinedTip, vtkPolyData);
175 
177 
180  void SetUserDefinedShaft(vtkPolyData*);
181  vtkGetObjectMacro(UserDefinedShaft, vtkPolyData);
183 
185 
188  vtkProperty* GetXAxisTipProperty();
189  vtkProperty* GetYAxisTipProperty();
190  vtkProperty* GetZAxisTipProperty();
192 
194 
197  vtkProperty* GetXAxisShaftProperty();
198  vtkProperty* GetYAxisShaftProperty();
199  vtkProperty* GetZAxisShaftProperty();
201 
203 
206  vtkProperty* GetXAxisLabelProperty();
207  vtkProperty* GetYAxisLabelProperty();
208  vtkProperty* GetZAxisLabelProperty();
210 
212 
215  vtkSetMacro(XAxisVisibility, bool);
216  vtkGetMacro(XAxisVisibility, bool);
217  vtkSetMacro(YAxisVisibility, bool);
218  vtkGetMacro(YAxisVisibility, bool);
219  vtkSetMacro(ZAxisVisibility, bool);
220  vtkGetMacro(ZAxisVisibility, bool);
222 
223  //
225 
228  vtkSetStringMacro(XAxisLabelText);
229  vtkSetStringMacro(YAxisLabelText);
230  vtkSetStringMacro(ZAxisLabelText);
232 
233  enum
234  {
237  USER_DEFINED_SHAFT
238  };
239 
240  enum
241  {
244  USER_DEFINED_TIP
245  };
246 
247 protected:
248  vtkPVAxesActor();
249  ~vtkPVAxesActor() override;
250 
255 
259 
263 
264  void UpdateProps();
265 
266  float TotalLength[3];
267  float NormalizedShaftLength[3];
268  float NormalizedTipLength[3];
269 
271  int TipType;
272 
275 
279 
283 
287 
291 
292  float ConeRadius;
295 
299 
300  bool XAxisVisibility = true;
301  bool YAxisVisibility = true;
302  bool ZAxisVisibility = true;
303 
304 private:
305  vtkPVAxesActor(const vtkPVAxesActor&) = delete;
306  void operator=(const vtkPVAxesActor&) = delete;
307 };
308 
309 #endif
vtkFollower * ZAxisLabel
void SetShaftTypeToUserDefined()
vtkVectorText * XAxisVectorText
float ZAxisLabelPosition
vtkVectorText * YAxisVectorText
void SetNormalizedTipLength(float v[3])
Set the normalized (0-1) length of the tip.
type
#define VTKREMOTINGVIEWS_EXPORT
virtual int RenderOpaqueGeometry(vtkViewport *)
void SetShaftTypeToLine()
virtual int HasTranslucentPolygonalGeometry()
vtkFollower * XAxisLabel
vtkTypeUInt64 vtkMTimeType
a 3D axes representation
vtkSphereSource * SphereSource
void SetShaftTypeToCylinder()
float XAxisLabelPosition
void SetTotalLength(float v[3])
Set the total length of the axes in 3 dimensions.
virtual void ReleaseGraphicsResources(vtkWindow *)
void SetNormalizedShaftLength(float v[3])
Set the normalized (0-1) length of the shaft.
virtual vtkMTimeType GetRedrawMTime()
vtkActor * ZAxisShaft
#define VTK_FLOAT_MAX
vtkCylinderSource * CylinderSource
void ShallowCopy(vtkProp *prop)
vtkActor * ZAxisTip
vtkPolyData * UserDefinedTip
vtkVectorText * ZAxisVectorText
void PrintSelf(ostream &os, vtkIndent indent)
vtkActor * XAxisShaft
vtkConeSource * ConeSource
vtkFollower * YAxisLabel
vtkLineSource * LineSource
vtkMTimeType GetMTime()
void SetTipTypeToSphere()
void SetTipTypeToCone()
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
vtkPolyData * UserDefinedShaft
vtkActor * XAxisTip
virtual double * GetBounds()=0
vtkActor * YAxisShaft
static vtkObject * New()
vtkActor * YAxisTip
void operator=(const vtkObjectBase &)
virtual void GetActors(vtkPropCollection *)
void SetTipTypeToUserDefined()
float YAxisLabelPosition