VTK  9.1.0
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 =========================================================================*/
97 #ifndef vtkSelectPolyData_h
98 #define vtkSelectPolyData_h
99 
100 #include "vtkFiltersModelingModule.h" // For export macro
101 #include "vtkPolyDataAlgorithm.h"
102 
103 #define VTK_INSIDE_SMALLEST_REGION 0
104 #define VTK_INSIDE_LARGEST_REGION 1
105 #define VTK_INSIDE_CLOSEST_POINT_REGION 2
106 
107 class vtkCharArray;
108 class vtkPoints;
109 class vtkIdList;
110 
111 class VTKFILTERSMODELING_EXPORT vtkSelectPolyData : public vtkPolyDataAlgorithm
112 {
113 public:
120 
122  void PrintSelf(ostream& os, vtkIndent indent) override;
123 
125 
132  vtkSetMacro(GenerateSelectionScalars, vtkTypeBool);
133  vtkGetMacro(GenerateSelectionScalars, vtkTypeBool);
134  vtkBooleanMacro(GenerateSelectionScalars, vtkTypeBool);
136 
138 
142  vtkSetMacro(InsideOut, vtkTypeBool);
143  vtkGetMacro(InsideOut, vtkTypeBool);
144  vtkBooleanMacro(InsideOut, vtkTypeBool);
146 
148 
152  virtual void SetLoop(vtkPoints*);
153  vtkGetObjectMacro(Loop, vtkPoints);
155 
157 
160  vtkSetVector3Macro(ClosestPoint, double);
161  vtkGetVector3Macro(ClosestPoint, double);
163 
165 
168  vtkSetClampMacro(SelectionMode, int, VTK_INSIDE_SMALLEST_REGION, VTK_INSIDE_CLOSEST_POINT_REGION);
169  vtkGetMacro(SelectionMode, int);
171  void SetSelectionModeToLargestRegion() { this->SetSelectionMode(VTK_INSIDE_LARGEST_REGION); }
173  {
174  this->SetSelectionMode(VTK_INSIDE_CLOSEST_POINT_REGION);
175  }
176  const char* GetSelectionModeAsString();
178 
180 
184  vtkSetMacro(GenerateUnselectedOutput, vtkTypeBool);
185  vtkGetMacro(GenerateUnselectedOutput, vtkTypeBool);
186  vtkBooleanMacro(GenerateUnselectedOutput, vtkTypeBool);
188 
194 
199 
200  // Overload GetMTime() because we depend on Loop
201  vtkMTimeType GetMTime() override;
202 
203 protected:
205  ~vtkSelectPolyData() override;
206 
208 
213  double ClosestPoint[3];
215 
216 private:
217  vtkPolyData* Mesh;
218  void GetPointNeighbors(vtkIdType ptId, vtkIdList* nei);
219 
220 private:
221  vtkSelectPolyData(const vtkSelectPolyData&) = delete;
222  void operator=(const vtkSelectPolyData&) = delete;
223 };
224 
229 {
231  {
232  return "InsideSmallestRegion";
233  }
234  else if (this->SelectionMode == VTK_INSIDE_LARGEST_REGION)
235  {
236  return "InsideLargestRegion";
237  }
238  else
239  {
240  return "InsideClosestPointRegion";
241  }
242 }
243 
244 #endif
dynamic, self-adjusting array of char
Definition: vtkCharArray.h:68
list of point or cell ids
Definition: vtkIdList.h:140
a simple class to control print indentation
Definition: vtkIndent.h:113
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition: vtkPoints.h:143
Superclass for algorithms that produce only polydata as output.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:195
select portion of polygonal mesh; generate selection scalars
virtual void SetLoop(vtkPoints *)
Set/Get the array of point coordinates defining the loop.
static vtkSelectPolyData * New()
Instantiate object with InsideOut turned off, and GenerateSelectionScalars turned off.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetSelectionModeToSmallestRegion()
Control how inside/outside of loop is defined.
vtkPolyData * GetSelectionEdges()
Return the (mesh) edges of the selection region.
void SetSelectionModeToLargestRegion()
Control how inside/outside of loop is defined.
vtkTypeBool GenerateUnselectedOutput
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
const char * GetSelectionModeAsString()
Return the method of determining in/out of loop as a string.
vtkTypeBool GenerateSelectionScalars
void SetSelectionModeToClosestPointRegion()
Control how inside/outside of loop is defined.
vtkMTimeType GetMTime() override
Return this object's modified time.
~vtkSelectPolyData() override
vtkPolyData * GetUnselectedOutput()
Return output that hasn't been selected (if GenreateUnselectedOutput is enabled).
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_INSIDE_SMALLEST_REGION
#define VTK_INSIDE_LARGEST_REGION
#define VTK_INSIDE_CLOSEST_POINT_REGION
int vtkIdType
Definition: vtkType.h:332
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287