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 =========================================================================*/
80 #ifndef vtkSelectPolyData_h
81 #define vtkSelectPolyData_h
82 
83 #include "vtkFiltersModelingModule.h" // For export macro
84 #include "vtkPolyDataAlgorithm.h"
85 
86 #define VTK_INSIDE_SMALLEST_REGION 0
87 #define VTK_INSIDE_LARGEST_REGION 1
88 #define VTK_INSIDE_CLOSEST_POINT_REGION 2
89 
90 class vtkCharArray;
91 class vtkPoints;
92 class vtkIdList;
93 
95 {
96 public:
100  static vtkSelectPolyData *New();
101 
103  void PrintSelf(ostream& os, vtkIndent indent);
104 
106 
111  vtkSetMacro(GenerateSelectionScalars,int);
112  vtkGetMacro(GenerateSelectionScalars,int);
113  vtkBooleanMacro(GenerateSelectionScalars,int);
115 
117 
119  vtkSetMacro(InsideOut,int);
120  vtkGetMacro(InsideOut,int);
121  vtkBooleanMacro(InsideOut,int);
123 
125 
127  virtual void SetLoop(vtkPoints*);
128  vtkGetObjectMacro(Loop,vtkPoints);
130 
132 
133  vtkSetVector3Macro(ClosestPoint,double);
134  vtkGetVector3Macro(ClosestPoint,double);
136 
138 
139  vtkSetClampMacro(SelectionMode,int,
141  vtkGetMacro(SelectionMode,int);
143  {this->SetSelectionMode(VTK_INSIDE_SMALLEST_REGION);};
145  {this->SetSelectionMode(VTK_INSIDE_LARGEST_REGION);};
147  {this->SetSelectionMode(VTK_INSIDE_CLOSEST_POINT_REGION);};
148  const char *GetSelectionModeAsString();
150 
152 
154  vtkSetMacro(GenerateUnselectedOutput,int);
155  vtkGetMacro(GenerateUnselectedOutput,int);
156  vtkBooleanMacro(GenerateUnselectedOutput,int);
158 
161  vtkPolyData *GetUnselectedOutput();
162 
164  vtkPolyData *GetSelectionEdges();
165 
166  // Overload GetMTime() because we depend on Loop
167  unsigned long int GetMTime();
168 
169 protected:
172 
174 
179  double ClosestPoint[3];
181 
182 private:
183  vtkPolyData *Mesh;
184  void GetPointNeighbors (vtkIdType ptId, vtkIdList *nei);
185 private:
186  vtkSelectPolyData(const vtkSelectPolyData&); // Not implemented.
187  void operator=(const vtkSelectPolyData&); // Not implemented.
188 };
189 
191 
193 {
195  {
196  return "InsideSmallestRegion";
197  }
198  else if ( this->SelectionMode == VTK_INSIDE_LARGEST_REGION )
199  {
200  return "InsideLargestRegion";
201  }
202  else
203  {
204  return "InsideClosestPointRegion";
205  }
206 }
208 
209 #endif
210 
211 
void SetSelectionModeToClosestPointRegion()
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
#define VTKFILTERSMODELING_EXPORT
int vtkIdType
Definition: vtkType.h:275
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:83
static vtkPolyDataAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent)
dynamic, self-adjusting array of char
Definition: vtkCharArray.h:42
Superclass for algorithms that produce only polydata as output.
virtual unsigned long GetMTime()
a simple class to control print indentation
Definition: vtkIndent.h:38
list of point or cell ids
Definition: vtkIdList.h:35
void SetSelectionModeToSmallestRegion()
const char * GetSelectionModeAsString()
select portion of polygonal mesh; generate selection scalars
void SetSelectionModeToLargestRegion()
#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:38