VTK  9.3.20240327
vtkPlaneSource.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
151 #ifndef vtkPlaneSource_h
152 #define vtkPlaneSource_h
153 
154 #include "vtkFiltersSourcesModule.h" // For export macro
155 #include "vtkPolyDataAlgorithm.h"
156 
157 VTK_ABI_NAMESPACE_BEGIN
158 class VTKFILTERSSOURCES_EXPORT vtkPlaneSource : public vtkPolyDataAlgorithm
159 {
160 public:
161  void PrintSelf(ostream& os, vtkIndent indent) override;
163 
168  static vtkPlaneSource* New();
169 
171 
174  vtkSetMacro(XResolution, int);
175  vtkGetMacro(XResolution, int);
177 
179 
182  vtkSetMacro(YResolution, int);
183  vtkGetMacro(YResolution, int);
185 
187 
190  void SetResolution(int xR, int yR);
191  void GetResolution(int& xR, int& yR)
192  {
193  xR = this->XResolution;
194  yR = this->YResolution;
195  }
197 
199 
202  vtkSetVector3Macro(Origin, double);
203  vtkGetVectorMacro(Origin, double, 3);
205 
207 
210  void SetPoint1(double x, double y, double z);
211  void SetPoint1(double pnt[3]);
212  vtkGetVectorMacro(Point1, double, 3);
214 
216 
219  void SetPoint2(double x, double y, double z);
220  void SetPoint2(double pnt[3]);
221  vtkGetVectorMacro(Point2, double, 3);
223 
225 
230  void GetAxis1(double a1[3]);
231  void GetAxis2(double a2[3]);
233 
235 
240  void SetCenter(double x, double y, double z);
241  void SetCenter(double center[3]);
242  vtkGetVectorMacro(Center, double, 3);
244 
246 
251  void SetNormal(double nx, double ny, double nz);
252  void SetNormal(double n[3]);
253  vtkGetVectorMacro(Normal, double, 3);
255 
261  void Push(double distance);
262 
268  void Rotate(double angle, double rotationAxis[3]);
269 
271 
276  vtkSetMacro(OutputPointsPrecision, int);
277  vtkGetMacro(OutputPointsPrecision, int);
279 
280 protected:
282  ~vtkPlaneSource() override = default;
283 
285 
288  double Origin[3];
289  double Point1[3];
290  double Point2[3];
291  double Normal[3];
292  double Center[3];
294 
295  int UpdatePlane(double v1[3], double v2[3]);
296 
297 private:
298  vtkPlaneSource(const vtkPlaneSource&) = delete;
299  void operator=(const vtkPlaneSource&) = delete;
300 };
301 
302 VTK_ABI_NAMESPACE_END
303 #endif
a simple class to control print indentation
Definition: vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
create an array of quadrilaterals located in a plane
void SetNormal(double nx, double ny, double nz)
Set/Get the plane normal.
static vtkPlaneSource * New()
Construct plane perpendicular to z-axis, resolution 1x1, width and height 1.0, and centered at the or...
void SetPoint1(double pnt[3])
Specify a point defining the first axis of the plane.
void GetResolution(int &xR, int &yR)
Set the number of x-y subdivisions in the plane.
void Rotate(double angle, double rotationAxis[3])
Rotate plane at center around a given axis If the absolute value of the angle is inferior to the defi...
void Push(double distance)
Translate the plane in the direction of the normal by the distance specified.
void SetPoint2(double pnt[3])
Specify a point defining the second axis of the plane.
~vtkPlaneSource() override=default
void SetCenter(double x, double y, double z)
Set/Get the center of the plane.
void SetResolution(int xR, int yR)
Set the number of x-y subdivisions in the plane.
void GetAxis1(double a1[3])
Convenience methods to retrieve the axes of the plane; that is axis a1 is the vector (Point1-Origin),...
int UpdatePlane(double v1[3], double v2[3])
void SetNormal(double n[3])
Set/Get the plane normal.
void SetCenter(double center[3])
Set/Get the center of the plane.
void SetPoint1(double x, double y, double z)
Specify a point defining the first axis of the plane.
void SetPoint2(double x, double y, double z)
Specify a point defining the second axis of the plane.
void GetAxis2(double a2[3])
Convenience methods to retrieve the axes of the plane; that is axis a1 is the vector (Point1-Origin),...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
Superclass for algorithms that produce only polydata as output.
@ Normal
Definition: vtkX3D.h:45
@ center
Definition: vtkX3D.h:230