VTK
dox/Filters/Modeling/vtkSelectPolyData.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkSelectPolyData.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00080 #ifndef __vtkSelectPolyData_h
00081 #define __vtkSelectPolyData_h
00082 
00083 #include "vtkFiltersModelingModule.h" // For export macro
00084 #include "vtkPolyDataAlgorithm.h"
00085 
00086 #define VTK_INSIDE_SMALLEST_REGION 0
00087 #define VTK_INSIDE_LARGEST_REGION 1
00088 #define VTK_INSIDE_CLOSEST_POINT_REGION 2
00089 
00090 class vtkCharArray;
00091 class vtkPoints;
00092 class vtkIdList;
00093 
00094 class VTKFILTERSMODELING_EXPORT vtkSelectPolyData : public vtkPolyDataAlgorithm
00095 {
00096 public:
00100   static vtkSelectPolyData *New();
00101 
00102   vtkTypeMacro(vtkSelectPolyData,vtkPolyDataAlgorithm);
00103   void PrintSelf(ostream& os, vtkIndent indent);
00104 
00106 
00111   vtkSetMacro(GenerateSelectionScalars,int);
00112   vtkGetMacro(GenerateSelectionScalars,int);
00113   vtkBooleanMacro(GenerateSelectionScalars,int);
00115 
00117 
00119   vtkSetMacro(InsideOut,int);
00120   vtkGetMacro(InsideOut,int);
00121   vtkBooleanMacro(InsideOut,int);
00123 
00125 
00127   virtual void SetLoop(vtkPoints*);
00128   vtkGetObjectMacro(Loop,vtkPoints);
00130 
00132 
00133   vtkSetClampMacro(SelectionMode,int,
00134              VTK_INSIDE_SMALLEST_REGION,VTK_INSIDE_CLOSEST_POINT_REGION);
00135   vtkGetMacro(SelectionMode,int);
00136   void SetSelectionModeToSmallestRegion()
00137     {this->SetSelectionMode(VTK_INSIDE_SMALLEST_REGION);};
00138   void SetSelectionModeToLargestRegion()
00139     {this->SetSelectionMode(VTK_INSIDE_LARGEST_REGION);};
00140   void SetSelectionModeToClosestPointRegion()
00141     {this->SetSelectionMode(VTK_INSIDE_CLOSEST_POINT_REGION);};
00142   const char *GetSelectionModeAsString();
00144 
00146 
00148   vtkSetMacro(GenerateUnselectedOutput,int);
00149   vtkGetMacro(GenerateUnselectedOutput,int);
00150   vtkBooleanMacro(GenerateUnselectedOutput,int);
00152 
00155   vtkPolyData *GetUnselectedOutput();
00156 
00158   vtkPolyData *GetSelectionEdges();
00159 
00160   // Overload GetMTime() because we depend on Loop
00161   unsigned long int GetMTime();
00162 
00163 protected:
00164   vtkSelectPolyData();
00165   ~vtkSelectPolyData();
00166 
00167   int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00168 
00169   int GenerateSelectionScalars;
00170   int InsideOut;
00171   vtkPoints *Loop;
00172   int SelectionMode;
00173   double ClosestPoint[3];
00174   int GenerateUnselectedOutput;
00175 
00176 private:
00177   vtkPolyData *Mesh;
00178   void GetPointNeighbors (vtkIdType ptId, vtkIdList *nei);
00179 private:
00180   vtkSelectPolyData(const vtkSelectPolyData&);  // Not implemented.
00181   void operator=(const vtkSelectPolyData&);  // Not implemented.
00182 };
00183 
00185 
00186 inline const char *vtkSelectPolyData::GetSelectionModeAsString(void)
00187 {
00188   if ( this->SelectionMode == VTK_INSIDE_SMALLEST_REGION )
00189     {
00190     return "InsideSmallestRegion";
00191     }
00192   else if ( this->SelectionMode == VTK_INSIDE_LARGEST_REGION )
00193     {
00194     return "InsideLargestRegion";
00195     }
00196   else
00197     {
00198     return "InsideClosestPointRegion";
00199     }
00200 }
00202 
00203 #endif
00204 
00205