VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
94 class VTKFILTERSMODELING_EXPORT vtkSelectPolyData : public vtkPolyDataAlgorithm
95 {
96 public:
100  static vtkSelectPolyData *New();
101 
102  vtkTypeMacro(vtkSelectPolyData,vtkPolyDataAlgorithm);
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  vtkSetClampMacro(SelectionMode,int,
135  vtkGetMacro(SelectionMode,int);
137  {this->SetSelectionMode(VTK_INSIDE_SMALLEST_REGION);};
139  {this->SetSelectionMode(VTK_INSIDE_LARGEST_REGION);};
141  {this->SetSelectionMode(VTK_INSIDE_CLOSEST_POINT_REGION);};
142  const char *GetSelectionModeAsString();
144 
146 
148  vtkSetMacro(GenerateUnselectedOutput,int);
149  vtkGetMacro(GenerateUnselectedOutput,int);
150  vtkBooleanMacro(GenerateUnselectedOutput,int);
152 
155  vtkPolyData *GetUnselectedOutput();
156 
158  vtkPolyData *GetSelectionEdges();
159 
160  // Overload GetMTime() because we depend on Loop
161  unsigned long int GetMTime();
162 
163 protected:
166 
167  int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
168 
171  vtkPoints *Loop;
173  double ClosestPoint[3];
175 
176 private:
177  vtkPolyData *Mesh;
178  void GetPointNeighbors (vtkIdType ptId, vtkIdList *nei);
179 private:
180  vtkSelectPolyData(const vtkSelectPolyData&); // Not implemented.
181  void operator=(const vtkSelectPolyData&); // Not implemented.
182 };
183 
185 
187 {
189  {
190  return "InsideSmallestRegion";
191  }
192  else if ( this->SelectionMode == VTK_INSIDE_LARGEST_REGION )
193  {
194  return "InsideLargestRegion";
195  }
196  else
197  {
198  return "InsideClosestPointRegion";
199  }
200 }
202 
203 #endif
204 
205 
void SetSelectionModeToClosestPointRegion()
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
#define VTK_INSIDE_CLOSEST_POINT_REGION