VTK  9.1.0
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 =========================================================================*/
48 #ifndef vtkPlaneSource_h
49 #define vtkPlaneSource_h
50 
51 #include "vtkFiltersSourcesModule.h" // For export macro
52 #include "vtkPolyDataAlgorithm.h"
53 
54 class VTKFILTERSSOURCES_EXPORT vtkPlaneSource : public vtkPolyDataAlgorithm
55 {
56 public:
57  void PrintSelf(ostream& os, vtkIndent indent) override;
59 
64  static vtkPlaneSource* New();
65 
67 
70  vtkSetMacro(XResolution, int);
71  vtkGetMacro(XResolution, int);
73 
75 
78  vtkSetMacro(YResolution, int);
79  vtkGetMacro(YResolution, int);
81 
83 
86  void SetResolution(const int xR, const int yR);
87  void GetResolution(int& xR, int& yR)
88  {
89  xR = this->XResolution;
90  yR = this->YResolution;
91  }
93 
95 
98  vtkSetVector3Macro(Origin, double);
99  vtkGetVectorMacro(Origin, double, 3);
101 
103 
106  void SetPoint1(double x, double y, double z);
107  void SetPoint1(double pnt[3]);
108  vtkGetVectorMacro(Point1, double, 3);
110 
112 
115  void SetPoint2(double x, double y, double z);
116  void SetPoint2(double pnt[3]);
117  vtkGetVectorMacro(Point2, double, 3);
119 
121 
126  void GetAxis1(double a1[3]);
127  void GetAxis2(double a2[3]);
129 
131 
136  void SetCenter(double x, double y, double z);
137  void SetCenter(double center[3]);
138  vtkGetVectorMacro(Center, double, 3);
140 
142 
147  void SetNormal(double nx, double ny, double nz);
148  void SetNormal(double n[3]);
149  vtkGetVectorMacro(Normal, double, 3);
151 
157  void Push(double distance);
158 
164  void Rotate(double angle, double rotationAxis[3]);
165 
167 
172  vtkSetMacro(OutputPointsPrecision, int);
173  vtkGetMacro(OutputPointsPrecision, int);
175 
176 protected:
178  ~vtkPlaneSource() override = default;
179 
181 
184  double Origin[3];
185  double Point1[3];
186  double Point2[3];
187  double Normal[3];
188  double Center[3];
190 
191  int UpdatePlane(double v1[3], double v2[3]);
192 
193 private:
194  vtkPlaneSource(const vtkPlaneSource&) = delete;
195  void operator=(const vtkPlaneSource&) = delete;
196 };
197 
198 #endif
a simple class to control print indentation
Definition: vtkIndent.h:34
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:51
@ center
Definition: vtkX3D.h:236