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 =========================================================================*/
81 #ifndef vtkSelectPolyData_h
82 #define vtkSelectPolyData_h
83 
84 #include "vtkFiltersModelingModule.h" // For export macro
85 #include "vtkPolyDataAlgorithm.h"
86 
87 #define VTK_INSIDE_SMALLEST_REGION 0
88 #define VTK_INSIDE_LARGEST_REGION 1
89 #define VTK_INSIDE_CLOSEST_POINT_REGION 2
90 
91 class vtkCharArray;
92 class vtkPoints;
93 class vtkIdList;
94 
95 class VTKFILTERSMODELING_EXPORT vtkSelectPolyData : public vtkPolyDataAlgorithm
96 {
97 public:
103  static vtkSelectPolyData *New();
104 
106  void PrintSelf(ostream& os, vtkIndent indent);
107 
109 
116  vtkSetMacro(GenerateSelectionScalars,int);
117  vtkGetMacro(GenerateSelectionScalars,int);
118  vtkBooleanMacro(GenerateSelectionScalars,int);
120 
122 
126  vtkSetMacro(InsideOut,int);
127  vtkGetMacro(InsideOut,int);
128  vtkBooleanMacro(InsideOut,int);
130 
132 
136  virtual void SetLoop(vtkPoints*);
137  vtkGetObjectMacro(Loop,vtkPoints);
139 
141 
144  vtkSetVector3Macro(ClosestPoint,double);
145  vtkGetVector3Macro(ClosestPoint,double);
147 
149 
152  vtkSetClampMacro(SelectionMode,int,
154  vtkGetMacro(SelectionMode,int);
156  {this->SetSelectionMode(VTK_INSIDE_SMALLEST_REGION);};
158  {this->SetSelectionMode(VTK_INSIDE_LARGEST_REGION);};
160  {this->SetSelectionMode(VTK_INSIDE_CLOSEST_POINT_REGION);};
161  const char *GetSelectionModeAsString();
163 
165 
169  vtkSetMacro(GenerateUnselectedOutput,int);
170  vtkGetMacro(GenerateUnselectedOutput,int);
171  vtkBooleanMacro(GenerateUnselectedOutput,int);
173 
178  vtkPolyData *GetUnselectedOutput();
179 
183  vtkPolyData *GetSelectionEdges();
184 
185  // Overload GetMTime() because we depend on Loop
187 
188 protected:
191 
193 
198  double ClosestPoint[3];
200 
201 private:
202  vtkPolyData *Mesh;
203  void GetPointNeighbors (vtkIdType ptId, vtkIdList *nei);
204 private:
205  vtkSelectPolyData(const vtkSelectPolyData&) VTK_DELETE_FUNCTION;
206  void operator=(const vtkSelectPolyData&) VTK_DELETE_FUNCTION;
207 };
208 
210 
213 inline const char *vtkSelectPolyData::GetSelectionModeAsString(void)
214 {
215  if ( this->SelectionMode == VTK_INSIDE_SMALLEST_REGION )
216  {
217  return "InsideSmallestRegion";
218  }
219  else if ( this->SelectionMode == VTK_INSIDE_LARGEST_REGION )
220  {
221  return "InsideLargestRegion";
222  }
223  else
224  {
225  return "InsideClosestPointRegion";
226  }
227 }
229 
230 #endif
231 
232 
void SetSelectionModeToClosestPointRegion()
Control how inside/outside of loop is defined.
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
int vtkIdType
Definition: vtkType.h:287
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248
static vtkPolyDataAlgorithm * New()
dynamic, self-adjusting array of char
Definition: vtkCharArray.h:38
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:39
list of point or cell ids
Definition: vtkIdList.h:36
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:39
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.