VTK  9.3.0
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
42 #ifndef vtkPlaneSource_h
43 #define vtkPlaneSource_h
44 
45 #include "vtkFiltersSourcesModule.h" // For export macro
46 #include "vtkPolyDataAlgorithm.h"
47 
48 VTK_ABI_NAMESPACE_BEGIN
49 class VTKFILTERSSOURCES_EXPORT vtkPlaneSource : public vtkPolyDataAlgorithm
50 {
51 public:
52  void PrintSelf(ostream& os, vtkIndent indent) override;
54 
59  static vtkPlaneSource* New();
60 
62 
65  vtkSetMacro(XResolution, int);
66  vtkGetMacro(XResolution, int);
68 
70 
73  vtkSetMacro(YResolution, int);
74  vtkGetMacro(YResolution, int);
76 
78 
81  void SetResolution(int xR, int yR);
82  void GetResolution(int& xR, int& yR)
83  {
84  xR = this->XResolution;
85  yR = this->YResolution;
86  }
88 
90 
93  vtkSetVector3Macro(Origin, double);
94  vtkGetVectorMacro(Origin, double, 3);
96 
98 
101  void SetPoint1(double x, double y, double z);
102  void SetPoint1(double pnt[3]);
103  vtkGetVectorMacro(Point1, double, 3);
105 
107 
110  void SetPoint2(double x, double y, double z);
111  void SetPoint2(double pnt[3]);
112  vtkGetVectorMacro(Point2, double, 3);
114 
116 
121  void GetAxis1(double a1[3]);
122  void GetAxis2(double a2[3]);
124 
126 
131  void SetCenter(double x, double y, double z);
132  void SetCenter(double center[3]);
133  vtkGetVectorMacro(Center, double, 3);
135 
137 
142  void SetNormal(double nx, double ny, double nz);
143  void SetNormal(double n[3]);
144  vtkGetVectorMacro(Normal, double, 3);
146 
152  void Push(double distance);
153 
159  void Rotate(double angle, double rotationAxis[3]);
160 
162 
167  vtkSetMacro(OutputPointsPrecision, int);
168  vtkGetMacro(OutputPointsPrecision, int);
170 
171 protected:
173  ~vtkPlaneSource() override = default;
174 
176 
179  double Origin[3];
180  double Point1[3];
181  double Point2[3];
182  double Normal[3];
183  double Center[3];
185 
186  int UpdatePlane(double v1[3], double v2[3]);
187 
188 private:
189  vtkPlaneSource(const vtkPlaneSource&) = delete;
190  void operator=(const vtkPlaneSource&) = delete;
191 };
192 
193 VTK_ABI_NAMESPACE_END
194 #endif
a simple class to control print indentation
Definition: vtkIndent.h:29
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