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) 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,
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,vtkTypeBool);
167  vtkGetMacro(GenerateUnselectedOutput,vtkTypeBool);
168  vtkBooleanMacro(GenerateUnselectedOutput,vtkTypeBool);
170 
175  vtkPolyData *GetUnselectedOutput();
176 
180  vtkPolyData *GetSelectionEdges();
181 
182  // Overload GetMTime() because we depend on Loop
183  vtkMTimeType GetMTime() override;
184 
185 protected:
187  ~vtkSelectPolyData() override;
188 
190 
195  double ClosestPoint[3];
197 
198 private:
199  vtkPolyData *Mesh;
200  void GetPointNeighbors (vtkIdType ptId, vtkIdList *nei);
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
228 
229 
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:33
VTK_INSIDE_LARGEST_REGION
#define VTK_INSIDE_LARGEST_REGION
Definition: vtkSelectPolyData.h:85
vtkIdType
int vtkIdType
Definition: vtkType.h:347
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkSelectPolyData::SetSelectionModeToClosestPointRegion
void SetSelectionModeToClosestPointRegion()
Definition: vtkSelectPolyData.h:156
vtkSelectPolyData::GenerateSelectionScalars
vtkTypeBool GenerateSelectionScalars
Definition: vtkSelectPolyData.h:191
vtkPolyDataAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSelectPolyData::Loop
vtkPoints * Loop
Definition: vtkSelectPolyData.h:193
vtkSelectPolyData::GenerateUnselectedOutput
vtkTypeBool GenerateUnselectedOutput
Definition: vtkSelectPolyData.h:196
vtkPolyDataAlgorithm.h
vtkCharArray
dynamic, self-adjusting array of char
Definition: vtkCharArray.h:35
VTK_INSIDE_CLOSEST_POINT_REGION
#define VTK_INSIDE_CLOSEST_POINT_REGION
Definition: vtkSelectPolyData.h:86
vtkSelectPolyData::SelectionMode
int SelectionMode
Definition: vtkSelectPolyData.h:194
vtkPolyDataAlgorithm::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkObject::GetMTime
virtual vtkMTimeType GetMTime()
Return this object's modified time.
VTK_INSIDE_SMALLEST_REGION
#define VTK_INSIDE_SMALLEST_REGION
Definition: vtkSelectPolyData.h:84
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:30
vtkSelectPolyData::SetSelectionModeToLargestRegion
void SetSelectionModeToLargestRegion()
Definition: vtkSelectPolyData.h:154
vtkSelectPolyData::SetSelectionModeToSmallestRegion
void SetSelectionModeToSmallestRegion()
Definition: vtkSelectPolyData.h:152
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:80
vtkSelectPolyData
select portion of polygonal mesh; generate selection scalars
Definition: vtkSelectPolyData.h:92
vtkSelectPolyData::GetSelectionModeAsString
const char * GetSelectionModeAsString()
Return the method of determining in/out of loop as a string.
Definition: vtkSelectPolyData.h:210
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkPolyDataAlgorithm::New
static vtkPolyDataAlgorithm * New()
vtkSelectPolyData::InsideOut
vtkTypeBool InsideOut
Definition: vtkSelectPolyData.h:192
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:41