VTK
dox/Filters/Modeling/vtkSelectEnclosedPoints.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkSelectEnclosedPoints.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 =========================================================================*/
00045 #ifndef __vtkSelectEnclosedPoints_h
00046 #define __vtkSelectEnclosedPoints_h
00047 
00048 #include "vtkFiltersModelingModule.h" // For export macro
00049 #include "vtkDataSetAlgorithm.h"
00050 
00051 class vtkUnsignedCharArray;
00052 class vtkCellLocator;
00053 class vtkIdList;
00054 class vtkGenericCell;
00055 
00056 
00057 class VTKFILTERSMODELING_EXPORT vtkSelectEnclosedPoints : public vtkDataSetAlgorithm
00058 {
00059 public:
00061 
00062   vtkTypeMacro(vtkSelectEnclosedPoints,vtkDataSetAlgorithm);
00063   void PrintSelf(ostream& os, vtkIndent indent);
00065 
00067   static vtkSelectEnclosedPoints *New();
00068 
00070 
00073   void SetSurfaceData(vtkPolyData *pd);
00074   void SetSurfaceConnection(vtkAlgorithmOutput* algOutput);
00076 
00078 
00079   vtkPolyData *GetSurface();
00080   vtkPolyData *GetSurface(vtkInformationVector *sourceInfo);
00082 
00084 
00087   vtkSetMacro(InsideOut,int);
00088   vtkBooleanMacro(InsideOut,int);
00089   vtkGetMacro(InsideOut,int);
00091 
00093 
00095   vtkSetMacro(CheckSurface,int);
00096   vtkBooleanMacro(CheckSurface,int);
00097   vtkGetMacro(CheckSurface,int);
00099 
00102   int IsInside(vtkIdType inputPtId);
00103 
00105 
00107   vtkSetClampMacro(Tolerance,double,0.0,VTK_FLOAT_MAX);
00108   vtkGetMacro(Tolerance,double);
00110 
00112 
00116   void Initialize(vtkPolyData *surface);
00117   int IsInsideSurface(double x, double y, double z);
00118   int IsInsideSurface(double x[3]);
00119   void Complete();
00121 
00122 protected:
00123   vtkSelectEnclosedPoints();
00124   ~vtkSelectEnclosedPoints();
00125 
00126   int    CheckSurface;
00127   int    InsideOut;
00128   double Tolerance;
00129 
00130   int IsSurfaceClosed(vtkPolyData *surface);
00131   vtkUnsignedCharArray *InsideOutsideArray;
00132 
00133   // Internal structures for accelerating the intersection test
00134   vtkCellLocator *CellLocator;
00135   vtkIdList      *CellIds;
00136   vtkGenericCell *Cell;
00137   vtkPolyData    *Surface;
00138   double          Bounds[6];
00139   double          Length;
00140 
00141   virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00142   virtual int FillInputPortInformation(int, vtkInformation *);
00143 
00144   virtual void ReportReferences(vtkGarbageCollector*);
00145 
00146 private:
00147   vtkSelectEnclosedPoints(const vtkSelectEnclosedPoints&);  // Not implemented.
00148   void operator=(const vtkSelectEnclosedPoints&);  // Not implemented.
00149 };
00150 
00151 #endif