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) override;
107 
109 
116  vtkSetMacro(GenerateSelectionScalars,vtkTypeBool);
117  vtkGetMacro(GenerateSelectionScalars,vtkTypeBool);
118  vtkBooleanMacro(GenerateSelectionScalars,vtkTypeBool);
120 
122 
126  vtkSetMacro(InsideOut,vtkTypeBool);
127  vtkGetMacro(InsideOut,vtkTypeBool);
128  vtkBooleanMacro(InsideOut,vtkTypeBool);
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,vtkTypeBool);
170  vtkGetMacro(GenerateUnselectedOutput,vtkTypeBool);
171  vtkBooleanMacro(GenerateUnselectedOutput,vtkTypeBool);
173 
178  vtkPolyData *GetUnselectedOutput();
179 
183  vtkPolyData *GetSelectionEdges();
184 
185  // Overload GetMTime() because we depend on Loop
186  vtkMTimeType GetMTime() override;
187 
188 protected:
190  ~vtkSelectPolyData() override;
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&) = delete;
206  void operator=(const vtkSelectPolyData&) = delete;
207 };
208 
210 
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.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkTypeBool GenerateSelectionScalars
int vtkIdType
Definition: vtkType.h:347
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
static vtkPolyDataAlgorithm * New()
int vtkTypeBool
Definition: vtkABI.h:69
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.
vtkTypeBool GenerateUnselectedOutput
virtual vtkMTimeType GetMTime()
Return this object's modified time.
const char * GetSelectionModeAsString()
Return the method of determining in/out of loop as a string.
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.
#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.