Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkSelectPolyData.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkSelectPolyData.h,v $
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 =========================================================================*/
00092 #ifndef __vtkSelectPolyData_h
00093 #define __vtkSelectPolyData_h
00094 
00095 #include "vtkPolyDataToPolyDataFilter.h"
00096 
00097 #define VTK_INSIDE_SMALLEST_REGION 0
00098 #define VTK_INSIDE_LARGEST_REGION 1
00099 #define VTK_INSIDE_CLOSEST_POINT_REGION 2
00100 
00101 class vtkCharArray;
00102 class vtkPoints;
00103 class vtkIdList;
00104 
00105 class VTK_GRAPHICS_EXPORT vtkSelectPolyData : public vtkPolyDataToPolyDataFilter
00106 {
00107 public:
00111   static vtkSelectPolyData *New();
00112 
00113   vtkTypeRevisionMacro(vtkSelectPolyData,vtkPolyDataToPolyDataFilter);
00114   void PrintSelf(ostream& os, vtkIndent indent);
00115 
00117 
00122   vtkSetMacro(GenerateSelectionScalars,int);
00123   vtkGetMacro(GenerateSelectionScalars,int);
00124   vtkBooleanMacro(GenerateSelectionScalars,int);
00126 
00128 
00130   vtkSetMacro(InsideOut,int);
00131   vtkGetMacro(InsideOut,int);
00132   vtkBooleanMacro(InsideOut,int);
00134 
00136 
00138   virtual void SetLoop(vtkPoints*);
00139   vtkGetObjectMacro(Loop,vtkPoints);
00141 
00143 
00144   vtkSetClampMacro(SelectionMode,int,
00145              VTK_INSIDE_SMALLEST_REGION,VTK_INSIDE_CLOSEST_POINT_REGION);
00146   vtkGetMacro(SelectionMode,int);
00147   void SetSelectionModeToSmallestRegion()
00148     {this->SetSelectionMode(VTK_INSIDE_SMALLEST_REGION);};
00149   void SetSelectionModeToLargestRegion()
00150     {this->SetSelectionMode(VTK_INSIDE_LARGEST_REGION);};
00151   void SetSelectionModeToClosestPointRegion()
00152     {this->SetSelectionMode(VTK_INSIDE_CLOSEST_POINT_REGION);};
00153   const char *GetSelectionModeAsString();
00155 
00157 
00159   vtkSetMacro(GenerateUnselectedOutput,int);
00160   vtkGetMacro(GenerateUnselectedOutput,int);
00161   vtkBooleanMacro(GenerateUnselectedOutput,int);
00163 
00166   vtkPolyData *GetUnselectedOutput();
00167 
00169   vtkPolyData *GetSelectionEdges();
00170 
00171   // Overload GetMTime() because we depend on Loop
00172   unsigned long int GetMTime();
00173 
00174 protected:
00175   vtkSelectPolyData();
00176   ~vtkSelectPolyData();
00177 
00178   void Execute();
00179 
00180   int GenerateSelectionScalars;
00181   int InsideOut;
00182   vtkPoints *Loop;
00183   int SelectionMode;
00184   double ClosestPoint[3];
00185   int GenerateUnselectedOutput;
00186 
00187 private:
00188   vtkPolyData *Mesh;
00189   void GetPointNeighbors (vtkIdType ptId, vtkIdList *nei);
00190 private:
00191   vtkSelectPolyData(const vtkSelectPolyData&);  // Not implemented.
00192   void operator=(const vtkSelectPolyData&);  // Not implemented.
00193 };
00194 
00196 inline const char *vtkSelectPolyData::GetSelectionModeAsString(void)
00197 {
00198   if ( this->SelectionMode == VTK_INSIDE_SMALLEST_REGION ) 
00199     {
00200     return "InsideSmallestRegion";
00201     }
00202   else if ( this->SelectionMode == VTK_INSIDE_LARGEST_REGION ) 
00203     {
00204     return "InsideLargestRegion";
00205     }
00206   else 
00207     {
00208     return "InsideClosestPointRegion";
00209     }
00210 }
00211 
00212 #endif
00213 
00214