vtkPolarAxesRepresentation.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
3 // .NAME vtkPolarAxesRepresentation - representation for a polar-axes.
4 // .SECTION Description
5 // vtkPolarAxesRepresentation is a representation for the Polar-Axes that shows a
6 // bounding box with labels around any input dataset.
7 
8 #ifndef vtkPolarAxesRepresentation_h
9 #define vtkPolarAxesRepresentation_h
10 
11 #include "vtkRemotingViewsModule.h" //needed for exports
12 
13 #include "vtkNew.h" // needed for vtkNew.
15 #include "vtkPVRenderView.h" // needed for renderer enum
16 #include "vtkParaViewDeprecation.h" // for PARAVIEW_DEPRECATED_IN_5_12_0
17 #include "vtkWeakPointer.h" // needed for vtkWeakPointer.
18 
19 class vtkPolarAxesActor;
20 class vtkPolyData;
21 class vtkTextProperty;
22 
24 {
25 public:
28  void PrintSelf(ostream& os, vtkIndent indent) override;
29 
30  // Description:
31  // Get/Set the Position to transform the data bounds.
32  vtkSetVector3Macro(Position, double);
33  vtkGetVector3Macro(Position, double);
34 
35  // Description:
36  // Get/Set the Orientation to transform the data bounds.
37  vtkSetVector3Macro(Orientation, double);
38  vtkGetVector3Macro(Orientation, double);
39 
40  // Description:
41  // Get/Set the Scale to transform the data bounds.
42  vtkSetVector3Macro(Scale, double);
43  vtkGetVector3Macro(Scale, double);
44 
45  // Description:
46  // Get the bounds of the data.
47  vtkGetVector6Macro(DataBounds, double);
48 
49  // Description:
50  // Get/Set custom bounds to use. When corresponding CustomBoundsActive is
51  // true, the data bounds will be ignored for that direction and CustomBounds
52  // will be used instead.
53  vtkSetVector6Macro(CustomBounds, double);
54  vtkGetVector6Macro(CustomBounds, double);
55 
56  // Description:
57  // Get/Set whether to use custom bounds for a particular dimension.
58  vtkSetVector3Macro(EnableCustomBounds, int);
59  vtkGetVector3Macro(EnableCustomBounds, int);
60 
61  // Description:
62  // Set the use of a custom range.
63  vtkSetMacro(EnableCustomRange, bool);
64  vtkGetMacro(EnableCustomRange, bool);
65 
66  // Description:
67  // Get/Set custom range to use.
68  // the data bounds will be ignored for that direction and CustomRange
69  // will be used instead.
70  vtkSetVector2Macro(CustomRange, double);
71  vtkGetVector2Macro(CustomRange, double);
72 
73  // Description:
74  // Get/Set the use of automatically placed pole (origin of the axes).
75  // If on, pole is placed at the center of the bounding box.
76  vtkSetMacro(EnableAutoPole, bool);
77  vtkGetMacro(EnableAutoPole, bool);
78 
79  // Description:
80  // Get/Set the use of custom min/max angles.
81  // If off, min/max angles are computed relatively to pole position.
82  vtkSetMacro(EnableCustomAngle, bool);
83  vtkGetMacro(EnableCustomAngle, bool);
84 
85  // Description:
86  // Get/Set the custom min/max angles when EnableCustomAngle is On.
87  vtkSetMacro(MinAngle, double);
88  vtkGetMacro(MinAngle, double);
89  vtkSetMacro(MaxAngle, double);
90  vtkGetMacro(MaxAngle, double);
91 
92  // Description:
93  // Get/Set the use of custom min radius.
94  // If off, min radius is computed relatively to pole position.
95  // Max radius is always computed because not exposed.
96  vtkSetMacro(EnableCustomRadius, bool);
97  vtkGetMacro(EnableCustomRadius, bool);
98 
99  // Description:
100  // Get/Set the custom min radius when EnableCustomRadius is On.
101  vtkSetMacro(MinRadius, double);
102  vtkGetMacro(MinRadius, double);
103 
104  // Description:
105  // Set the actor color.
106  vtkGetMacro(EnableOverallColor, bool);
107  virtual void SetEnableOverallColor(bool enable);
108  virtual void SetOverallColor(double r, double g, double b);
109  virtual void SetPolarAxisColor(double r, double g, double b);
110  virtual void SetPolarArcsColor(double r, double g, double b);
111  virtual void SetSecondaryPolarArcsColor(double r, double g, double b);
112  virtual void SetSecondaryRadialAxesColor(double r, double g, double b);
113  virtual void SetLastRadialAxisColor(double r, double g, double b);
114  virtual void SetPolarAxisTitleTextProperty(vtkTextProperty* prop);
115  virtual void SetPolarAxisLabelTextProperty(vtkTextProperty* prop);
116  virtual void SetLastRadialAxisTextProperty(vtkTextProperty* prop);
117  virtual void SetSecondaryRadialAxesTextProperty(vtkTextProperty* prop);
118 
119  // Description:
120  // This needs to be called on all instances of vtkPolarAxesRepresentation when
121  // the input is modified.
122  void MarkModified() override { this->Superclass::MarkModified(); }
123 
124  // Description:
125  // vtkAlgorithm::ProcessRequest() equivalent for rendering passes. This is
126  // typically called by the vtkView to request meta-data from the
127  // representations or ask them to perform certain tasks e.g.
128  // PrepareForRendering.
130  vtkInformation* outInfo) override;
131 
132  // Description:
133  // Set visibility of the representation.
134  void SetVisibility(bool visible) override;
135 
136  // Description:
137  // Set (forward) visibility of the parent (composite) representation.
138  virtual void SetParentVisibility(bool visible);
139 
140  //***************************************************************************
141  // Forwarded to internal vtkPolarAxesActor
142  virtual void SetLog(bool active);
143  virtual void SetNumberOfRadialAxes(vtkIdType val);
144  virtual void SetNumberOfPolarAxes(vtkIdType val);
145  PARAVIEW_DEPRECATED_IN_5_12_0("Set DeltaRangeMajor instead or enable AxisTickMatchesPolarAxes")
146  virtual void SetNumberOfPolarAxisTicks(int val);
147  PARAVIEW_DEPRECATED_IN_5_12_0("Set DeltaRangePolarAxes instead")
148  virtual void SetAutoSubdividePolarAxis(bool active);
149  virtual void SetDeltaAngleRadialAxes(double angle);
150  virtual void SetDeltaRangePolarAxes(double range);
151  virtual void SetSmallestVisiblePolarAngle(double angle);
152  virtual void SetTickLocation(int location);
153  virtual void SetRadialUnits(bool use);
154  virtual void SetScreenSize(double size);
155  virtual void SetPolarAxisTitle(const char* title);
156  virtual void SetPolarLabelFormat(const char* format);
157  virtual void SetExponentLocation(int location);
158  virtual void SetRadialAngleFormat(const char* format);
159  virtual void SetEnableDistanceLOD(int enable);
160  virtual void SetDistanceLODThreshold(double val);
161  virtual void SetEnableViewAngleLOD(int enable);
162  virtual void SetViewAngleLODThreshold(double val);
163  virtual void SetPolarAxisVisibility(int visible);
164  virtual void SetDrawRadialGridlines(int draw);
165  virtual void SetDrawPolarArcsGridlines(int draw);
166  virtual void SetPolarTitleVisibility(int visible);
167  virtual void SetRadialAxisTitleLocation(int location);
168  virtual void SetPolarAxisTitleLocation(int location);
169  virtual void SetRadialTitleOffset(double offsetX, double offsetY);
170  virtual void SetPolarTitleOffset(double offsetX, double offsetY);
171  virtual void SetPolarLabelOffset(double offsetY);
172  virtual void SetPolarExponentOffset(double offsetY);
173  virtual void SetPolarLabelVisibility(int visible);
174  virtual void SetArcTicksOriginToPolarAxis(int use);
175  virtual void SetRadialAxesOriginToPolarAxis(int use);
176  virtual void SetPolarTickVisibility(int visible);
177  virtual void SetAxisTickVisibility(int visible);
178  virtual void SetAxisMinorTickVisibility(int visible);
179  virtual void SetAxisTickMatchesPolarAxes(int enable);
180  virtual void SetArcTickVisibility(int visible);
181  virtual void SetArcMinorTickVisibility(int visible);
182  virtual void SetArcTickMatchesRadialAxes(int enable);
183  virtual void SetTickRatioRadiusSize(double ratio);
184  virtual void SetArcMajorTickSize(double size);
185  virtual void SetPolarAxisMajorTickSize(double size);
186  virtual void SetLastRadialAxisMajorTickSize(double size);
187  virtual void SetPolarAxisTickRatioSize(double size);
188  virtual void SetLastAxisTickRatioSize(double size);
189  virtual void SetArcTickRatioSize(double size);
190  virtual void SetPolarAxisMajorTickThickness(double thickness);
191  virtual void SetLastRadialAxisMajorTickThickness(double thickness);
192  virtual void SetArcMajorTickThickness(double thickness);
193  virtual void SetPolarAxisTickRatioThickness(double thickness);
194  virtual void SetLastAxisTickRatioThickness(double thickness);
195  virtual void SetArcTickRatioThickness(double thickness);
196  virtual void SetDeltaAngleMajor(double delta);
197  virtual void SetDeltaAngleMinor(double delta);
198  virtual void SetRadialAxesVisibility(int visible);
199  virtual void SetRadialTitleVisibility(int visible);
200  virtual void SetPolarArcsVisibility(int visible);
201  virtual void SetUse2DMode(int use);
202  virtual void SetRatio(double ratio);
203  virtual void SetPolarArcResolutionPerDegree(double resolution);
204  virtual void SetDeltaRangeMinor(double delta);
205  virtual void SetDeltaRangeMajor(double delta);
206 
207  // Description:
208  // Set the renderer to use. Default is to use the
209  // vtkPVRenderView::DEFAULT_RENDERER.
210  vtkSetMacro(RendererType, int);
211  vtkGetMacro(RendererType, int);
212 
213 protected:
215  ~vtkPolarAxesRepresentation() override;
216 
217  int FillInputPortInformation(int port, vtkInformation* info) override;
218  int RequestData(
219  vtkInformation*, vtkInformationVector** inputVector, vtkInformationVector*) override;
220 
221  virtual void InitializeDataBoundsFromData(vtkDataObject* data);
222  virtual void UpdateBounds();
223 
224  // Description:
225  // Adds the representation to the view. This is called from
226  // vtkView::AddRepresentation(). Subclasses should override this method.
227  // Returns true if the addition succeeds.
228  bool AddToView(vtkView* view) override;
229 
230  // Description:
231  // Removes the representation to the view. This is called from
232  // vtkView::RemoveRepresentation(). Subclasses should override this method.
233  // Returns true if the removal succeeds.
234  bool RemoveFromView(vtkView* view) override;
235 
239  double Position[3] = { 0.0 };
240  double Scale[3] = { 1.0 };
241  double Orientation[3] = { 0.0 };
242  double CustomBounds[6] = { 0.0, 1.0, 0.0, 1.0, 0.0, 1.0 };
243  int EnableCustomBounds[3] = { 0 };
244  double CustomRange[2] = { 0.0, 1.0 };
245  bool EnableCustomRange = false;
246  bool EnableAutoPole = true;
247  bool EnableCustomAngle = true;
248  double MinAngle = 0.0;
249  double MaxAngle = 90.0;
250  bool EnableCustomRadius = true;
251  double MinRadius = 0.0;
252  bool EnableOverallColor = true;
253  double OverallColor[3] = { 1.0 };
254  double PolarAxisColor[3] = { 1.0 };
255  double PolarArcsColor[3] = { 1.0 };
256  double SecondaryPolarArcsColor[3] = { 1.0 };
257  double SecondaryRadialAxesColor[3] = { 1.0 };
258  double LastRadialAxisColor[3] = { 1.0 };
259  double DataBounds[6] = { 0.0 };
261  bool ParentVisibility = true;
263 
264 private:
266  void operator=(const vtkPolarAxesRepresentation&) = delete;
267 };
268 
269 #endif
data
location
#define PARAVIEW_DEPRECATED_IN_5_12_0(reason)
#define VTKREMOTINGVIEWS_EXPORT
vtkPVDataRepresentation adds some ParaView specific API to data representations.
bool AddToView(vtkView *view) override
Making these methods public.
info
int vtkIdType
virtual void SetVisibility(bool val)
Get/Set the visibility for this representation.
virtual int ProcessViewRequest(vtkInformationRequestKey *request_type, vtkInformation *inInfo, vtkInformation *outInfo)
vtkAlgorithm::ProcessRequest() equivalent for rendering passes.
virtual int FillInputPortInformation(int port, vtkInformation *info)
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Overridden to invoke vtkCommand::UpdateDataEvent.
vtkNew< vtkPolarAxesActor > PolarAxesActor
bool RemoveFromView(vtkView *view) override
Making these methods public.
size
range
static vtkDataRepresentation * New()
resolution
vtkWeakPointer< vtkPVRenderView > RenderView
void PrintSelf(ostream &os, vtkIndent indent) override
port
void MarkModified() override
This is one of the most important functions.
title