VTK
dox/Filters/Sources/vtkPlaneSource.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkPlaneSource.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00053 #ifndef __vtkPlaneSource_h
00054 #define __vtkPlaneSource_h
00055 
00056 #include "vtkFiltersSourcesModule.h" // For export macro
00057 #include "vtkPolyDataAlgorithm.h"
00058 
00059 class VTKFILTERSSOURCES_EXPORT vtkPlaneSource : public vtkPolyDataAlgorithm
00060 {
00061 public:
00062   void PrintSelf(ostream& os, vtkIndent indent);
00063   vtkTypeMacro(vtkPlaneSource,vtkPolyDataAlgorithm);
00064 
00067   static vtkPlaneSource *New();
00068 
00070 
00071   vtkSetMacro(XResolution,int);
00072   vtkGetMacro(XResolution,int);
00074 
00076 
00077   vtkSetMacro(YResolution,int);
00078   vtkGetMacro(YResolution,int);
00080 
00082 
00083   void SetResolution(const int xR, const int yR);
00084   void GetResolution(int& xR,int& yR) {
00085     xR=this->XResolution; yR=this->YResolution;};
00087 
00089 
00090   vtkSetVector3Macro(Origin,double);
00091   vtkGetVectorMacro(Origin,double,3);
00093 
00095 
00096   void SetPoint1(double x, double y, double z);
00097   void SetPoint1(double pnt[3]);
00098   vtkGetVectorMacro(Point1,double,3);
00100 
00102 
00103   void SetPoint2(double x, double y, double z);
00104   void SetPoint2(double pnt[3]);
00105   vtkGetVectorMacro(Point2,double,3);
00107 
00109 
00112   void SetCenter(double x, double y, double z);
00113   void SetCenter(double center[3]);
00114   vtkGetVectorMacro(Center,double,3);
00116 
00118 
00121   void SetNormal(double nx, double ny, double nz);
00122   void SetNormal(double n[3]);
00123   vtkGetVectorMacro(Normal,double,3);
00125 
00128   void Push(double distance);
00129 
00130 protected:
00131   vtkPlaneSource();
00132   ~vtkPlaneSource() {};
00133 
00134   int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00135 
00136   int XResolution;
00137   int YResolution;
00138   double Origin[3];
00139   double Point1[3];
00140   double Point2[3];
00141   double Normal[3];
00142   double Center[3];
00143 
00144   int UpdatePlane(double v1[3], double v2[3]);
00145 private:
00146   vtkPlaneSource(const vtkPlaneSource&);  // Not implemented.
00147   void operator=(const vtkPlaneSource&);  // Not implemented.
00148 };
00149 
00150 #endif