VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/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   vtkSetVector3Macro(ClosestPoint,double);
00134   vtkGetVector3Macro(ClosestPoint,double);
00136 
00138 
00139   vtkSetClampMacro(SelectionMode,int,
00140              VTK_INSIDE_SMALLEST_REGION,VTK_INSIDE_CLOSEST_POINT_REGION);
00141   vtkGetMacro(SelectionMode,int);
00142   void SetSelectionModeToSmallestRegion()
00143     {this->SetSelectionMode(VTK_INSIDE_SMALLEST_REGION);};
00144   void SetSelectionModeToLargestRegion()
00145     {this->SetSelectionMode(VTK_INSIDE_LARGEST_REGION);};
00146   void SetSelectionModeToClosestPointRegion()
00147     {this->SetSelectionMode(VTK_INSIDE_CLOSEST_POINT_REGION);};
00148   const char *GetSelectionModeAsString();
00150 
00152 
00154   vtkSetMacro(GenerateUnselectedOutput,int);
00155   vtkGetMacro(GenerateUnselectedOutput,int);
00156   vtkBooleanMacro(GenerateUnselectedOutput,int);
00158 
00161   vtkPolyData *GetUnselectedOutput();
00162 
00164   vtkPolyData *GetSelectionEdges();
00165 
00166   // Overload GetMTime() because we depend on Loop
00167   unsigned long int GetMTime();
00168 
00169 protected:
00170   vtkSelectPolyData();
00171   ~vtkSelectPolyData();
00172 
00173   int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00174 
00175   int GenerateSelectionScalars;
00176   int InsideOut;
00177   vtkPoints *Loop;
00178   int SelectionMode;
00179   double ClosestPoint[3];
00180   int GenerateUnselectedOutput;
00181 
00182 private:
00183   vtkPolyData *Mesh;
00184   void GetPointNeighbors (vtkIdType ptId, vtkIdList *nei);
00185 private:
00186   vtkSelectPolyData(const vtkSelectPolyData&);  // Not implemented.
00187   void operator=(const vtkSelectPolyData&);  // Not implemented.
00188 };
00189 
00191 
00192 inline const char *vtkSelectPolyData::GetSelectionModeAsString(void)
00193 {
00194   if ( this->SelectionMode == VTK_INSIDE_SMALLEST_REGION )
00195     {
00196     return "InsideSmallestRegion";
00197     }
00198   else if ( this->SelectionMode == VTK_INSIDE_LARGEST_REGION )
00199     {
00200     return "InsideLargestRegion";
00201     }
00202   else
00203     {
00204     return "InsideClosestPointRegion";
00205     }
00206 }
00208 
00209 #endif
00210 
00211