VTK  9.2.20221001
vtkPlaneSource.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPlaneSource.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 =========================================================================*/
163 #ifndef vtkPlaneSource_h
164 #define vtkPlaneSource_h
165 
166 #include "vtkFiltersSourcesModule.h" // For export macro
167 #include "vtkPolyDataAlgorithm.h"
168 
169 VTK_ABI_NAMESPACE_BEGIN
170 class VTKFILTERSSOURCES_EXPORT vtkPlaneSource : public vtkPolyDataAlgorithm
171 {
172 public:
173  void PrintSelf(ostream& os, vtkIndent indent) override;
175 
180  static vtkPlaneSource* New();
181 
183 
186  vtkSetMacro(XResolution, int);
187  vtkGetMacro(XResolution, int);
189 
191 
194  vtkSetMacro(YResolution, int);
195  vtkGetMacro(YResolution, int);
197 
199 
202  void SetResolution(const int xR, const int yR);
203  void GetResolution(int& xR, int& yR)
204  {
205  xR = this->XResolution;
206  yR = this->YResolution;
207  }
209 
211 
214  vtkSetVector3Macro(Origin, double);
215  vtkGetVectorMacro(Origin, double, 3);
217 
219 
222  void SetPoint1(double x, double y, double z);
223  void SetPoint1(double pnt[3]);
224  vtkGetVectorMacro(Point1, double, 3);
226 
228 
231  void SetPoint2(double x, double y, double z);
232  void SetPoint2(double pnt[3]);
233  vtkGetVectorMacro(Point2, double, 3);
235 
237 
242  void GetAxis1(double a1[3]);
243  void GetAxis2(double a2[3]);
245 
247 
252  void SetCenter(double x, double y, double z);
253  void SetCenter(double center[3]);
254  vtkGetVectorMacro(Center, double, 3);
256 
258 
263  void SetNormal(double nx, double ny, double nz);
264  void SetNormal(double n[3]);
265  vtkGetVectorMacro(Normal, double, 3);
267 
273  void Push(double distance);
274 
280  void Rotate(double angle, double rotationAxis[3]);
281 
283 
288  vtkSetMacro(OutputPointsPrecision, int);
289  vtkGetMacro(OutputPointsPrecision, int);
291 
292 protected:
294  ~vtkPlaneSource() override = default;
295 
297 
300  double Origin[3];
301  double Point1[3];
302  double Point2[3];
303  double Normal[3];
304  double Center[3];
306 
307  int UpdatePlane(double v1[3], double v2[3]);
308 
309 private:
310  vtkPlaneSource(const vtkPlaneSource&) = delete;
311  void operator=(const vtkPlaneSource&) = delete;
312 };
313 
314 VTK_ABI_NAMESPACE_END
315 #endif
a simple class to control print indentation
Definition: vtkIndent.h:120
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 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 SetResolution(const int xR, const int yR)
Set the number of x-y subdivisions in the plane.
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:57
@ center
Definition: vtkX3D.h:242