VTK
vtkSelectPolyData.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSelectPolyData.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 =========================================================================*/
78 #ifndef vtkSelectPolyData_h
79 #define vtkSelectPolyData_h
80 
81 #include "vtkFiltersModelingModule.h" // For export macro
82 #include "vtkPolyDataAlgorithm.h"
83 
84 #define VTK_INSIDE_SMALLEST_REGION 0
85 #define VTK_INSIDE_LARGEST_REGION 1
86 #define VTK_INSIDE_CLOSEST_POINT_REGION 2
87 
88 class vtkCharArray;
89 class vtkPoints;
90 class vtkIdList;
91 
92 class VTKFILTERSMODELING_EXPORT vtkSelectPolyData : public vtkPolyDataAlgorithm
93 {
94 public:
100  static vtkSelectPolyData *New();
101 
103  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
104 
106 
113  vtkSetMacro(GenerateSelectionScalars,int);
114  vtkGetMacro(GenerateSelectionScalars,int);
115  vtkBooleanMacro(GenerateSelectionScalars,int);
117 
119 
123  vtkSetMacro(InsideOut,int);
124  vtkGetMacro(InsideOut,int);
125  vtkBooleanMacro(InsideOut,int);
127 
129 
133  virtual void SetLoop(vtkPoints*);
134  vtkGetObjectMacro(Loop,vtkPoints);
136 
138 
141  vtkSetVector3Macro(ClosestPoint,double);
142  vtkGetVector3Macro(ClosestPoint,double);
144 
146 
149  vtkSetClampMacro(SelectionMode,int,
151  vtkGetMacro(SelectionMode,int);
153  {this->SetSelectionMode(VTK_INSIDE_SMALLEST_REGION);};
155  {this->SetSelectionMode(VTK_INSIDE_LARGEST_REGION);};
157  {this->SetSelectionMode(VTK_INSIDE_CLOSEST_POINT_REGION);};
158  const char *GetSelectionModeAsString();
160 
162 
166  vtkSetMacro(GenerateUnselectedOutput,int);
167  vtkGetMacro(GenerateUnselectedOutput,int);
168  vtkBooleanMacro(GenerateUnselectedOutput,int);
170 
175  vtkPolyData *GetUnselectedOutput();
176 
180  vtkPolyData *GetSelectionEdges();
181 
182  // Overload GetMTime() because we depend on Loop
183  vtkMTimeType GetMTime() VTK_OVERRIDE;
184 
185 protected:
187  ~vtkSelectPolyData() VTK_OVERRIDE;
188 
189  int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) VTK_OVERRIDE;
190 
191  int GenerateSelectionScalars;
192  int InsideOut;
193  vtkPoints *Loop;
194  int SelectionMode;
195  double ClosestPoint[3];
196  int GenerateUnselectedOutput;
197 
198 private:
199  vtkPolyData *Mesh;
200  void GetPointNeighbors (vtkIdType ptId, vtkIdList *nei);
201 private:
202  vtkSelectPolyData(const vtkSelectPolyData&) VTK_DELETE_FUNCTION;
203  void operator=(const vtkSelectPolyData&) VTK_DELETE_FUNCTION;
204 };
205 
207 
210 inline const char *vtkSelectPolyData::GetSelectionModeAsString(void)
211 {
212  if ( this->SelectionMode == VTK_INSIDE_SMALLEST_REGION )
213  {
214  return "InsideSmallestRegion";
215  }
216  else if ( this->SelectionMode == VTK_INSIDE_LARGEST_REGION )
217  {
218  return "InsideLargestRegion";
219  }
220  else
221  {
222  return "InsideClosestPointRegion";
223  }
224 }
226 
227 #endif
228 
229 
void SetSelectionModeToClosestPointRegion()
Control how inside/outside of loop is defined.
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:300
int vtkIdType
Definition: vtkType.h:345
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
static vtkPolyDataAlgorithm * New()
dynamic, self-adjusting array of char
Definition: vtkCharArray.h:35
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:33
list of point or cell ids
Definition: vtkIdList.h:30
void SetSelectionModeToSmallestRegion()
Control how inside/outside of loop is defined.
virtual vtkMTimeType GetMTime()
Return this object's modified time.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
select portion of polygonal mesh; generate selection scalars
void SetSelectionModeToLargestRegion()
Control how inside/outside of loop is defined.
#define VTK_INSIDE_LARGEST_REGION
#define VTK_INSIDE_SMALLEST_REGION
Store zero or more vtkInformation instances.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
#define VTK_INSIDE_CLOSEST_POINT_REGION
represent and manipulate 3D points
Definition: vtkPoints.h:33
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.