VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vtkSelectEnclosedPoints.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSelectEnclosedPoints.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 =========================================================================*/
45 #ifndef __vtkSelectEnclosedPoints_h
46 #define __vtkSelectEnclosedPoints_h
47 
48 #include "vtkFiltersModelingModule.h" // For export macro
49 #include "vtkDataSetAlgorithm.h"
50 
51 class vtkUnsignedCharArray;
52 class vtkCellLocator;
53 class vtkIdList;
54 class vtkGenericCell;
55 
56 
57 class VTKFILTERSMODELING_EXPORT vtkSelectEnclosedPoints : public vtkDataSetAlgorithm
58 {
59 public:
61 
62  vtkTypeMacro(vtkSelectEnclosedPoints,vtkDataSetAlgorithm);
63  void PrintSelf(ostream& os, vtkIndent indent);
65 
67  static vtkSelectEnclosedPoints *New();
68 
70 
73  void SetSurfaceData(vtkPolyData *pd);
74  void SetSurfaceConnection(vtkAlgorithmOutput* algOutput);
76 
78 
79  vtkPolyData *GetSurface();
80  vtkPolyData *GetSurface(vtkInformationVector *sourceInfo);
82 
84 
87  vtkSetMacro(InsideOut,int);
88  vtkBooleanMacro(InsideOut,int);
89  vtkGetMacro(InsideOut,int);
91 
93 
95  vtkSetMacro(CheckSurface,int);
96  vtkBooleanMacro(CheckSurface,int);
97  vtkGetMacro(CheckSurface,int);
99 
102  int IsInside(vtkIdType inputPtId);
103 
105 
107  vtkSetClampMacro(Tolerance,double,0.0,VTK_FLOAT_MAX);
108  vtkGetMacro(Tolerance,double);
110 
112 
116  void Initialize(vtkPolyData *surface);
117  int IsInsideSurface(double x, double y, double z);
118  int IsInsideSurface(double x[3]);
119  void Complete();
121 
122 protected:
125 
128  double Tolerance;
129 
130  int IsSurfaceClosed(vtkPolyData *surface);
131  vtkUnsignedCharArray *InsideOutsideArray;
132 
133  // Internal structures for accelerating the intersection test
134  vtkCellLocator *CellLocator;
135  vtkIdList *CellIds;
136  vtkGenericCell *Cell;
137  vtkPolyData *Surface;
138  double Bounds[6];
139  double Length;
140 
141  virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
142  virtual int FillInputPortInformation(int, vtkInformation *);
143 
144  virtual void ReportReferences(vtkGarbageCollector*);
145 
146 private:
147  vtkSelectEnclosedPoints(const vtkSelectEnclosedPoints&); // Not implemented.
148  void operator=(const vtkSelectEnclosedPoints&); // Not implemented.
149 };
150 
151 #endif
vtkUnsignedCharArray * InsideOutsideArray
mark points as to whether they are inside a closed surface