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 =========================================================================*/
157 #ifndef vtkPlaneSource_h
158 #define vtkPlaneSource_h
159 
160 #include "vtkFiltersSourcesModule.h" // For export macro
161 #include "vtkPolyDataAlgorithm.h"
162 
163 class VTKFILTERSSOURCES_EXPORT vtkPlaneSource : public vtkPolyDataAlgorithm
164 {
165 public:
166  void PrintSelf(ostream& os, vtkIndent indent) override;
168 
173  static vtkPlaneSource* New();
174 
176 
179  vtkSetMacro(XResolution, int);
180  vtkGetMacro(XResolution, int);
182 
184 
187  vtkSetMacro(YResolution, int);
188  vtkGetMacro(YResolution, int);
190 
192 
195  void SetResolution(const int xR, const int yR);
196  void GetResolution(int& xR, int& yR)
197  {
198  xR = this->XResolution;
199  yR = this->YResolution;
200  }
202 
204 
207  vtkSetVector3Macro(Origin, double);
208  vtkGetVectorMacro(Origin, double, 3);
210 
212 
215  void SetPoint1(double x, double y, double z);
216  void SetPoint1(double pnt[3]);
217  vtkGetVectorMacro(Point1, double, 3);
219 
221 
224  void SetPoint2(double x, double y, double z);
225  void SetPoint2(double pnt[3]);
226  vtkGetVectorMacro(Point2, double, 3);
228 
230 
235  void GetAxis1(double a1[3]);
236  void GetAxis2(double a2[3]);
238 
240 
245  void SetCenter(double x, double y, double z);
246  void SetCenter(double center[3]);
247  vtkGetVectorMacro(Center, double, 3);
249 
251 
256  void SetNormal(double nx, double ny, double nz);
257  void SetNormal(double n[3]);
258  vtkGetVectorMacro(Normal, double, 3);
260 
266  void Push(double distance);
267 
273  void Rotate(double angle, double rotationAxis[3]);
274 
276 
281  vtkSetMacro(OutputPointsPrecision, int);
282  vtkGetMacro(OutputPointsPrecision, int);
284 
285 protected:
287  ~vtkPlaneSource() override = default;
288 
290 
293  double Origin[3];
294  double Point1[3];
295  double Point2[3];
296  double Normal[3];
297  double Center[3];
299 
300  int UpdatePlane(double v1[3], double v2[3]);
301 
302 private:
303  vtkPlaneSource(const vtkPlaneSource&) = delete;
304  void operator=(const vtkPlaneSource&) = delete;
305 };
306 
307 #endif
vtkPlaneSource::SetPoint1
void SetPoint1(double x, double y, double z)
Specify a point defining the first axis of the plane.
vtkPlaneSource::YResolution
int YResolution
Definition: vtkPlaneSource.h:292
vtkPlaneSource::SetNormal
void SetNormal(double n[3])
Set/Get the plane normal.
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
vtkPlaneSource::SetResolution
void SetResolution(const int xR, const int yR)
Set the number of x-y subdivisions in the plane.
vtkPlaneSource
create an array of quadrilaterals located in a plane
Definition: vtkPlaneSource.h:164
vtkX3D::Normal
@ Normal
Definition: vtkX3D.h:51
vtkPlaneSource::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPlaneSource::SetNormal
void SetNormal(double nx, double ny, double nz)
Set/Get the plane normal.
vtkPlaneSource::Push
void Push(double distance)
Translate the plane in the direction of the normal by the distance specified.
vtkX3D::center
@ center
Definition: vtkX3D.h:236
vtkPlaneSource::GetResolution
void GetResolution(int &xR, int &yR)
Set the number of x-y subdivisions in the plane.
Definition: vtkPlaneSource.h:196
vtkPlaneSource::SetPoint1
void SetPoint1(double pnt[3])
Specify a point defining the first axis of the plane.
vtkPolyDataAlgorithm.h
vtkPlaneSource::SetPoint2
void SetPoint2(double x, double y, double z)
Specify a point defining the second axis of the plane.
vtkPlaneSource::~vtkPlaneSource
~vtkPlaneSource() override=default
vtkPlaneSource::vtkPlaneSource
vtkPlaneSource()
vtkPlaneSource::Rotate
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...
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkPlaneSource::SetCenter
void SetCenter(double x, double y, double z)
Set/Get the center of the plane.
vtkPlaneSource::SetCenter
void SetCenter(double center[3])
Set/Get the center of the plane.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkPlaneSource::GetAxis1
void GetAxis1(double a1[3])
Convenience methods to retrieve the axes of the plane; that is axis a1 is the vector (Point1-Origin),...
vtkPlaneSource::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkPlaneSource::UpdatePlane
int UpdatePlane(double v1[3], double v2[3])
vtkPlaneSource::GetAxis2
void GetAxis2(double a2[3])
Convenience methods to retrieve the axes of the plane; that is axis a1 is the vector (Point1-Origin),...
vtkPlaneSource::New
static vtkPlaneSource * New()
Construct plane perpendicular to z-axis, resolution 1x1, width and height 1.0, and centered at the or...
vtkPlaneSource::XResolution
int XResolution
Definition: vtkPlaneSource.h:291
vtkPlaneSource::SetPoint2
void SetPoint2(double pnt[3])
Specify a point defining the second axis of the plane.
vtkPlaneSource::OutputPointsPrecision
int OutputPointsPrecision
Definition: vtkPlaneSource.h:298
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:151