VTK  9.0.2
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:
101 
103  void PrintSelf(ostream& os, vtkIndent indent) override;
104 
106 
113  vtkSetMacro(GenerateSelectionScalars, vtkTypeBool);
114  vtkGetMacro(GenerateSelectionScalars, vtkTypeBool);
115  vtkBooleanMacro(GenerateSelectionScalars, vtkTypeBool);
117 
119 
123  vtkSetMacro(InsideOut, vtkTypeBool);
124  vtkGetMacro(InsideOut, vtkTypeBool);
125  vtkBooleanMacro(InsideOut, vtkTypeBool);
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, VTK_INSIDE_SMALLEST_REGION, VTK_INSIDE_CLOSEST_POINT_REGION);
150  vtkGetMacro(SelectionMode, int);
152  void SetSelectionModeToLargestRegion() { this->SetSelectionMode(VTK_INSIDE_LARGEST_REGION); }
154  {
155  this->SetSelectionMode(VTK_INSIDE_CLOSEST_POINT_REGION);
156  }
157  const char* GetSelectionModeAsString();
159 
161 
165  vtkSetMacro(GenerateUnselectedOutput, vtkTypeBool);
166  vtkGetMacro(GenerateUnselectedOutput, vtkTypeBool);
167  vtkBooleanMacro(GenerateUnselectedOutput, vtkTypeBool);
169 
175 
180 
181  // Overload GetMTime() because we depend on Loop
182  vtkMTimeType GetMTime() override;
183 
184 protected:
186  ~vtkSelectPolyData() override;
187 
189 
194  double ClosestPoint[3];
196 
197 private:
198  vtkPolyData* Mesh;
199  void GetPointNeighbors(vtkIdType ptId, vtkIdList* nei);
200 
201 private:
202  vtkSelectPolyData(const vtkSelectPolyData&) = delete;
203  void operator=(const vtkSelectPolyData&) = delete;
204 };
205 
207 
211 {
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
dynamic, self-adjusting array of char
Definition: vtkCharArray.h:36
list of point or cell ids
Definition: vtkIdList.h:31
a simple class to control print indentation
Definition: vtkIndent.h:34
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition: vtkPoints.h:34
Superclass for algorithms that produce only polydata as output.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
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()
vtkPolyData * GetSelectionEdges()
Return the (mesh) edges of the selection region.
void SetSelectionModeToLargestRegion()
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()
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:338
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:293