vtkGridAxes3DActor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkGridAxes3DActor.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 =========================================================================*/
25 #ifndef vtkGridAxes3DActor_h
26 #define vtkGridAxes3DActor_h
27 
28 #include "vtkProp3D.h"
29 #include "vtkRemotingViewsModule.h" //needed for exports
30 
31 #include "vtkGridAxesHelper.h" // needed for vtkGridAxesHelper.
32 #include "vtkNew.h" // needed for vtkNew.
33 #include "vtkStdString.h" // needed for vtkStdString.
34 
35 class vtkDoubleArray;
36 class vtkGridAxes2DActor;
37 class vtkProperty;
38 class vtkTextProperty;
39 
40 class VTKREMOTINGVIEWS_EXPORT vtkGridAxes3DActor : public vtkProp3D
41 {
42 public:
43  static vtkGridAxes3DActor* New();
44  vtkTypeMacro(vtkGridAxes3DActor, vtkProp3D);
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
50  void ShallowCopy(vtkProp* prop) override;
51 
53 
58  vtkSetVector6Macro(GridBounds, double);
59  vtkGetVector6Macro(GridBounds, double);
61 
67  enum FaceMasks
68  {
69  MIN_YZ = 0x01,
70  MIN_ZX = 0x02,
71  MIN_XY = 0x04,
72  MAX_YZ = 0x08,
73  MAX_ZX = 0x010,
74  MAX_XY = 0x020
75  };
76 
78 
83  virtual void SetFaceMask(unsigned int mask);
84  vtkGetMacro(FaceMask, unsigned int);
86 
88  {
95  };
96 
98 
101  virtual void SetLabelMask(unsigned int mask);
102  unsigned int GetLabelMask();
104 
106 
110  vtkSetMacro(LabelUniqueEdgesOnly, bool);
111  vtkGetMacro(LabelUniqueEdgesOnly, bool);
113 
115 
118  void SetGenerateGrid(bool val);
119  bool GetGenerateGrid();
120  vtkBooleanMacro(GenerateGrid, bool);
122 
124 
128  void SetGenerateEdges(bool val);
129  bool GetGenerateEdges();
130  vtkBooleanMacro(GenerateEdges, bool);
132 
134 
138  void SetGenerateTicks(bool val);
139  bool GetGenerateTicks();
140  vtkBooleanMacro(GenerateTicks, bool);
142 
144 
147  void SetProperty(vtkProperty*);
148  vtkProperty* GetProperty();
150 
151  //---------------------------------------------------------------------------
152  // *** Properties to control the axis titles ***
153 
155 
159  void SetTitleTextProperty(int axis, vtkTextProperty*);
160  void SetXTitleTextProperty(vtkTextProperty* prop) { this->SetTitleTextProperty(0, prop); }
161  void SetYTitleTextProperty(vtkTextProperty* prop) { this->SetTitleTextProperty(1, prop); }
162  void SetZTitleTextProperty(vtkTextProperty* prop) { this->SetTitleTextProperty(2, prop); }
163  vtkTextProperty* GetTitleTextProperty(int axis);
165 
167 
171  void SetTitle(int axis, const vtkStdString& title);
172  void SetXTitle(const vtkStdString& title) { this->SetTitle(0, title); }
173  void SetYTitle(const vtkStdString& title) { this->SetTitle(1, title); }
174  void SetZTitle(const vtkStdString& title) { this->SetTitle(2, title); }
175  const vtkStdString& GetTitle(int axis);
177 
182  void SetUseCustomLabels(int axis, bool val);
183  void SetXUseCustomLabels(bool val) { this->SetUseCustomLabels(0, val); }
184  void SetYUseCustomLabels(bool val) { this->SetUseCustomLabels(1, val); }
185  void SetZUseCustomLabels(bool val) { this->SetUseCustomLabels(2, val); }
186 
187  void SetNumberOfLabels(int axis, vtkIdType val);
188  void SetNumberOfXLabels(vtkIdType val) { this->SetNumberOfLabels(0, val); }
189  void SetNumberOfYLabels(vtkIdType val) { this->SetNumberOfLabels(1, val); }
190  void SetNumberOfZLabels(vtkIdType val) { this->SetNumberOfLabels(2, val); }
191 
192  void SetLabel(int axis, vtkIdType index, double value);
193  void SetXLabel(vtkIdType index, double value) { this->SetLabel(0, index, value); }
194  void SetYLabel(vtkIdType index, double value) { this->SetLabel(1, index, value); }
195  void SetZLabel(vtkIdType index, double value) { this->SetLabel(2, index, value); }
196 
197  //---------------------------------------------------------------------------
198  // *** Properties to control the axis data labels ***
199 
201 
205  void SetLabelTextProperty(int axis, vtkTextProperty*);
206  void SetXLabelTextProperty(vtkTextProperty* prop) { this->SetLabelTextProperty(0, prop); }
207  void SetYLabelTextProperty(vtkTextProperty* prop) { this->SetLabelTextProperty(1, prop); }
208  void SetZLabelTextProperty(vtkTextProperty* prop) { this->SetLabelTextProperty(2, prop); }
209  vtkTextProperty* GetLabelTextProperty(int axis);
211 
213 
217  void SetNotation(int axis, int notation);
218  void SetXNotation(int notation) { this->SetNotation(0, notation); }
219  void SetYNotation(int notation) { this->SetNotation(1, notation); }
220  void SetZNotation(int notation) { this->SetNotation(2, notation); }
221  int GetNotation(int axis);
223 
225 
228  void SetPrecision(int axis, int val);
229  void SetXPrecision(int val) { this->SetPrecision(0, val); }
230  void SetYPrecision(int val) { this->SetPrecision(1, val); }
231  void SetZPrecision(int val) { this->SetPrecision(2, val); }
232  int GetPrecision(int axis);
234 
235  //--------------------------------------------------------------------------
236  // Methods for vtkProp3D API.
237  //--------------------------------------------------------------------------
238 
240 
243  double* GetBounds() override;
244  using Superclass::GetBounds;
246 
251  virtual void GetRenderedBounds(double bounds[6]);
252 
254 
257  vtkSetMacro(ForceOpaque, bool);
258  vtkGetMacro(ForceOpaque, bool);
259  vtkBooleanMacro(ForceOpaque, bool);
261 
262  int RenderOpaqueGeometry(vtkViewport*) override;
263  int RenderTranslucentPolygonalGeometry(vtkViewport* viewport) override;
264  int RenderOverlay(vtkViewport* viewport) override;
265  int HasTranslucentPolygonalGeometry() override;
266  void ReleaseGraphicsResources(vtkWindow*) override;
267 
268 protected:
270  ~vtkGridAxes3DActor() override;
271 
272  virtual void Update(vtkViewport* viewport);
273 
274  double GridBounds[6];
275  unsigned int FaceMask;
276  unsigned int LabelMask;
281 
283 
285 
286 private:
287  vtkGridAxes3DActor(const vtkGridAxes3DActor&) = delete;
288  void operator=(const vtkGridAxes3DActor&) = delete;
289 
290  vtkMTimeType GetBoundsMTime;
291 };
292 
293 #endif
void SetNumberOfXLabels(vtkIdType val)
void SetYLabelTextProperty(vtkTextProperty *prop)
Get/Set the vtkTextProperty that governs how the axis labels are displayed.
void SetYUseCustomLabels(bool val)
void SetZNotation(int notation)
Get/set the numerical notation, standard, scientific or mixed (0, 1, 2).
virtual int RenderOpaqueGeometry(vtkViewport *)
virtual int HasTranslucentPolygonalGeometry()
virtual int RenderOverlay(vtkViewport *)
void SetNumberOfZLabels(vtkIdType val)
FaceMasks
Values for FaceMask.
vtkTuple< vtkNew< vtkDoubleArray >, 3 > CustomLabels
void SetXTitle(const vtkStdString &title)
Get/Set the text to use for titles for the axis.
void SetXUseCustomLabels(bool val)
virtual void Update()
int vtkIdType
void SetYLabel(vtkIdType index, double value)
vtkTypeUInt64 vtkMTimeType
void SetYNotation(int notation)
Get/set the numerical notation, standard, scientific or mixed (0, 1, 2).
void SetZLabel(vtkIdType index, double value)
virtual void ReleaseGraphicsResources(vtkWindow *)
virtual double * GetBounds()
void SetXLabel(vtkIdType index, double value)
void SetYTitleTextProperty(vtkTextProperty *prop)
Get/Set the vtkTextProperty for the title for each the axes.
void ShallowCopy(vtkProp *prop)
void SetZPrecision(int val)
Get/set the numerical precision to use, default is 2.
void PrintSelf(ostream &os, vtkIndent indent)
void SetZUseCustomLabels(bool val)
vtkMTimeType CustomLabelsMTime
void SetXLabelTextProperty(vtkTextProperty *prop)
Get/Set the vtkTextProperty that governs how the axis labels are displayed.
void SetXNotation(int notation)
Get/set the numerical notation, standard, scientific or mixed (0, 1, 2).
vtkTuple< bool, 3 > UseCustomLabels
vtkTuple< vtkNew< vtkGridAxes2DActor >, 6 > GridAxes2DActors
actor for a cube-axes like prop in the 3D view.
void SetZTitleTextProperty(vtkTextProperty *prop)
Get/Set the vtkTextProperty for the title for each the axes.
void SetZTitle(const vtkStdString &title)
Get/Set the text to use for titles for the axis.
void SetXPrecision(int val)
Get/set the numerical precision to use, default is 2.
value
void SetZLabelTextProperty(vtkTextProperty *prop)
Get/Set the vtkTextProperty that governs how the axis labels are displayed.
void SetXTitleTextProperty(vtkTextProperty *prop)
Get/Set the vtkTextProperty for the title for each the axes.
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
actor for an axes plane in a 3D view.
virtual double * GetBounds()=0
static vtkObject * New()
index
void SetYPrecision(int val)
Get/set the numerical precision to use, default is 2.
void SetNumberOfYLabels(vtkIdType val)
void operator=(const vtkObjectBase &)
void SetYTitle(const vtkStdString &title)
Get/Set the text to use for titles for the axis.
title