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 
void SetSelectionModeToClosestPointRegion()
Control how inside/outside of loop is defined.
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:300
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkTypeBool GenerateSelectionScalars
int vtkIdType
Definition: vtkType.h:345
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
static vtkPolyDataAlgorithm * New()
int vtkTypeBool
Definition: vtkABI.h:69
dynamic, self-adjusting array of char
Definition: vtkCharArray.h:35
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:33
list of point or cell ids
Definition: vtkIdList.h:30
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:33
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.