ParaView
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 =========================================================================*/
20 #ifndef vtkGridAxes3DActor_h
21 #define vtkGridAxes3DActor_h
22 
23 #include "vtkPVVTKExtensionsDefaultModule.h" //needed for exports
24 #include "vtkProp3D.h"
25 
26 #include "vtkGridAxesHelper.h" // needed for vtkGridAxesHelper.
27 #include "vtkNew.h" // needed for vtkNew.
28 #include "vtkStdString.h" // needed for vtkStdString.
29 
30 class vtkDoubleArray;
31 class vtkGridAxes2DActor;
32 class vtkProperty;
33 class vtkTextProperty;
34 
35 class VTKPVVTKEXTENSIONSDEFAULT_EXPORT vtkGridAxes3DActor : public vtkProp3D
36 {
37 public:
38  static vtkGridAxes3DActor* New();
39  vtkTypeMacro(vtkGridAxes3DActor, vtkProp3D);
40  void PrintSelf(ostream& os, vtkIndent indent);
41 
45  virtual void ShallowCopy(vtkProp* prop);
46 
48 
53  vtkSetVector6Macro(GridBounds, double);
54  vtkGetVector6Macro(GridBounds, double);
56 
62  enum FaceMasks
63  {
64  MIN_YZ = 0x01,
65  MIN_ZX = 0x02,
66  MIN_XY = 0x04,
67  MAX_YZ = 0x08,
68  MAX_ZX = 0x010,
69  MAX_XY = 0x020
70  };
71 
73 
78  virtual void SetFaceMask(unsigned int mask);
79  vtkGetMacro(FaceMask, unsigned int);
81 
83  {
90  };
91 
93 
96  virtual void SetLabelMask(unsigned int mask);
97  unsigned int GetLabelMask();
99 
101 
105  vtkSetMacro(LabelUniqueEdgesOnly, bool);
106  vtkGetMacro(LabelUniqueEdgesOnly, bool);
108 
110 
113  void SetGenerateGrid(bool val);
114  bool GetGenerateGrid();
115  vtkBooleanMacro(GenerateGrid, bool);
117 
119 
123  void SetGenerateEdges(bool val);
124  bool GetGenerateEdges();
125  vtkBooleanMacro(GenerateEdges, bool);
127 
129 
133  void SetGenerateTicks(bool val);
134  bool GetGenerateTicks();
135  vtkBooleanMacro(GenerateTicks, bool);
137 
139 
142  void SetProperty(vtkProperty*);
143  vtkProperty* GetProperty();
145 
146  //---------------------------------------------------------------------------
147  // *** Properties to control the axis titles ***
148 
150 
154  void SetTitleTextProperty(int axis, vtkTextProperty*);
155  void SetXTitleTextProperty(vtkTextProperty* prop) { this->SetTitleTextProperty(0, prop); }
156  void SetYTitleTextProperty(vtkTextProperty* prop) { this->SetTitleTextProperty(1, prop); }
157  void SetZTitleTextProperty(vtkTextProperty* prop) { this->SetTitleTextProperty(2, prop); }
158  vtkTextProperty* GetTitleTextProperty(int axis);
160 
162 
166  void SetTitle(int axis, const vtkStdString& title);
167  void SetXTitle(const vtkStdString& title) { this->SetTitle(0, title); }
168  void SetYTitle(const vtkStdString& title) { this->SetTitle(1, title); }
169  void SetZTitle(const vtkStdString& title) { this->SetTitle(2, title); }
170  const vtkStdString& GetTitle(int axis);
172 
177  void SetUseCustomLabels(int axis, bool val);
178  void SetXUseCustomLabels(bool val) { this->SetUseCustomLabels(0, val); }
179  void SetYUseCustomLabels(bool val) { this->SetUseCustomLabels(1, val); }
180  void SetZUseCustomLabels(bool val) { this->SetUseCustomLabels(2, val); }
181 
182  void SetNumberOfLabels(int axis, vtkIdType val);
183  void SetNumberOfXLabels(vtkIdType val) { this->SetNumberOfLabels(0, val); }
184  void SetNumberOfYLabels(vtkIdType val) { this->SetNumberOfLabels(1, val); }
185  void SetNumberOfZLabels(vtkIdType val) { this->SetNumberOfLabels(2, val); }
186 
187  void SetLabel(int axis, vtkIdType index, double value);
188  void SetXLabel(vtkIdType index, double value) { this->SetLabel(0, index, value); }
189  void SetYLabel(vtkIdType index, double value) { this->SetLabel(1, index, value); }
190  void SetZLabel(vtkIdType index, double value) { this->SetLabel(2, index, value); }
191 
192  //---------------------------------------------------------------------------
193  // *** Properties to control the axis data labels ***
194 
196 
200  void SetLabelTextProperty(int axis, vtkTextProperty*);
201  void SetXLabelTextProperty(vtkTextProperty* prop) { this->SetLabelTextProperty(0, prop); }
202  void SetYLabelTextProperty(vtkTextProperty* prop) { this->SetLabelTextProperty(1, prop); }
203  void SetZLabelTextProperty(vtkTextProperty* prop) { this->SetLabelTextProperty(2, prop); }
204  vtkTextProperty* GetLabelTextProperty(int axis);
206 
208 
212  void SetNotation(int axis, int notation);
213  void SetXNotation(int notation) { this->SetNotation(0, notation); }
214  void SetYNotation(int notation) { this->SetNotation(1, notation); }
215  void SetZNotation(int notation) { this->SetNotation(2, notation); }
216  int GetNotation(int axis);
218 
220 
223  void SetPrecision(int axis, int val);
224  void SetXPrecision(int val) { this->SetPrecision(0, val); }
225  void SetYPrecision(int val) { this->SetPrecision(1, val); }
226  void SetZPrecision(int val) { this->SetPrecision(2, val); }
227  int GetPrecision(int axis);
229 
231 
238  void SetEnableLayerSupport(bool val);
239  bool GetEnableLayerSupport();
240  vtkBooleanMacro(EnableLayerSupport, bool);
242 
244 
248  void SetBackgroundLayer(int val);
249  int GetBackgroundLayer();
251 
253 
257  void SetGeometryLayer(int val);
258  int GetGeometryLayer();
260 
262 
266  void SetForegroundLayer(int val);
267  int GetForegroundLayer();
269 
270  //--------------------------------------------------------------------------
271  // Methods for vtkProp3D API.
272  //--------------------------------------------------------------------------
273 
277  virtual double* GetBounds();
278 
279  virtual int RenderOpaqueGeometry(vtkViewport*);
280  virtual int RenderTranslucentPolygonalGeometry(vtkViewport* viewport);
281  virtual int RenderOverlay(vtkViewport* viewport);
282  virtual int HasTranslucentPolygonalGeometry();
283  virtual void ReleaseGraphicsResources(vtkWindow*);
284 
285 protected:
288 
289  virtual void Update(vtkViewport* viewport);
290 
291  double GridBounds[6];
292  unsigned int FaceMask;
293  unsigned int LabelMask;
295  vtkTuple<bool, 3> UseCustomLabels;
296  vtkTuple<vtkNew<vtkDoubleArray>, 3> CustomLabels;
297  vtkMTimeType CustomLabelsMTime;
298 
299  vtkTuple<vtkNew<vtkGridAxes2DActor>, 6> GridAxes2DActors;
300 
301 private:
302  vtkGridAxes3DActor(const vtkGridAxes3DActor&) VTK_DELETE_FUNCTION;
303  void operator=(const vtkGridAxes3DActor&) VTK_DELETE_FUNCTION;
304 
305  vtkMTimeType GetBoundsMTime;
306 };
307 
308 #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).
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)
void SetYLabel(vtkIdType index, double value)
void SetYNotation(int notation)
Get/set the numerical notation, standard, scientific or mixed (0, 1, 2).
void SetZLabel(vtkIdType index, double value)
void SetXLabel(vtkIdType index, double value)
void SetYTitleTextProperty(vtkTextProperty *prop)
Get/Set the vtkTextProperty for the title for each the axes.
void SetZPrecision(int val)
Get/set the numerical precision to use, default is 2.
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
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.
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.
void SetYPrecision(int val)
Get/set the numerical precision to use, default is 2.
void SetNumberOfYLabels(vtkIdType val)
void SetYTitle(const vtkStdString &title)
Get/Set the text to use for titles for the axis.