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 "vtkPolyDataAlgorithm.h"
84 
85 #define VTK_INSIDE_SMALLEST_REGION 0
86 #define VTK_INSIDE_LARGEST_REGION 1
87 #define VTK_INSIDE_CLOSEST_POINT_REGION 2
88 
89 class vtkCharArray;
90 class vtkPoints;
91 class vtkIdList;
92 
94 {
95 public:
99  static vtkSelectPolyData *New();
100 
102  void PrintSelf(ostream& os, vtkIndent indent);
103 
105 
110  vtkSetMacro(GenerateSelectionScalars,int);
111  vtkGetMacro(GenerateSelectionScalars,int);
112  vtkBooleanMacro(GenerateSelectionScalars,int);
114 
116 
118  vtkSetMacro(InsideOut,int);
119  vtkGetMacro(InsideOut,int);
120  vtkBooleanMacro(InsideOut,int);
122 
124 
126  virtual void SetLoop(vtkPoints*);
127  vtkGetObjectMacro(Loop,vtkPoints);
129 
131 
132  vtkSetClampMacro(SelectionMode,int,
134  vtkGetMacro(SelectionMode,int);
135  void SetSelectionModeToSmallestRegion()
136  {this->SetSelectionMode(VTK_INSIDE_SMALLEST_REGION);};
137  void SetSelectionModeToLargestRegion()
138  {this->SetSelectionMode(VTK_INSIDE_LARGEST_REGION);};
139  void SetSelectionModeToClosestPointRegion()
140  {this->SetSelectionMode(VTK_INSIDE_CLOSEST_POINT_REGION);};
141  const char *GetSelectionModeAsString();
143 
145 
147  vtkSetMacro(GenerateUnselectedOutput,int);
148  vtkGetMacro(GenerateUnselectedOutput,int);
149  vtkBooleanMacro(GenerateUnselectedOutput,int);
151 
154  vtkPolyData *GetUnselectedOutput();
155 
157  vtkPolyData *GetSelectionEdges();
158 
159  // Overload GetMTime() because we depend on Loop
160  unsigned long int GetMTime();
161 
162 protected:
165 
167 
172  double ClosestPoint[3];
174 
175 private:
176  vtkPolyData *Mesh;
177  void GetPointNeighbors (vtkIdType ptId, vtkIdList *nei);
178 private:
179  vtkSelectPolyData(const vtkSelectPolyData&); // Not implemented.
180  void operator=(const vtkSelectPolyData&); // Not implemented.
181 };
182 
184 
186 {
188  {
189  return "InsideSmallestRegion";
190  }
191  else if ( this->SelectionMode == VTK_INSIDE_LARGEST_REGION )
192  {
193  return "InsideLargestRegion";
194  }
195  else
196  {
197  return "InsideClosestPointRegion";
198  }
199 }
201 
202 #endif
203 
204