Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | 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   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00084 #ifndef __vtkSelectPolyData_h
00085 #define __vtkSelectPolyData_h
00086 
00087 #include "vtkPolyDataToPolyDataFilter.h"
00088 
00089 #define VTK_INSIDE_SMALLEST_REGION 0
00090 #define VTK_INSIDE_LARGEST_REGION 1
00091 #define VTK_INSIDE_CLOSEST_POINT_REGION 2
00092 
00093 class vtkCharArray;
00094 class vtkPoints;
00095 class vtkIdList;
00096 
00097 class VTK_GRAPHICS_EXPORT vtkSelectPolyData : public vtkPolyDataToPolyDataFilter
00098 {
00099 public:
00103   static vtkSelectPolyData *New();
00104 
00105   vtkTypeRevisionMacro(vtkSelectPolyData,vtkPolyDataToPolyDataFilter);
00106   void PrintSelf(ostream& os, vtkIndent indent);
00107 
00109 
00114   vtkSetMacro(GenerateSelectionScalars,int);
00115   vtkGetMacro(GenerateSelectionScalars,int);
00116   vtkBooleanMacro(GenerateSelectionScalars,int);
00118 
00120 
00122   vtkSetMacro(InsideOut,int);
00123   vtkGetMacro(InsideOut,int);
00124   vtkBooleanMacro(InsideOut,int);
00126 
00128 
00130   virtual void SetLoop(vtkPoints*);
00131   vtkGetObjectMacro(Loop,vtkPoints);
00133 
00135 
00136   vtkSetClampMacro(SelectionMode,int,
00137              VTK_INSIDE_SMALLEST_REGION,VTK_INSIDE_CLOSEST_POINT_REGION);
00138   vtkGetMacro(SelectionMode,int);
00139   void SetSelectionModeToSmallestRegion()
00140     {this->SetSelectionMode(VTK_INSIDE_SMALLEST_REGION);};
00141   void SetSelectionModeToLargestRegion()
00142     {this->SetSelectionMode(VTK_INSIDE_LARGEST_REGION);};
00143   void SetSelectionModeToClosestPointRegion()
00144     {this->SetSelectionMode(VTK_INSIDE_CLOSEST_POINT_REGION);};
00145   const char *GetSelectionModeAsString();
00147 
00149 
00151   vtkSetMacro(GenerateUnselectedOutput,int);
00152   vtkGetMacro(GenerateUnselectedOutput,int);
00153   vtkBooleanMacro(GenerateUnselectedOutput,int);
00155 
00158   vtkPolyData *GetUnselectedOutput() {return this->UnselectedOutput;};
00159 
00161   vtkPolyData *GetSelectionEdges() {return this->SelectionEdges;};
00162 
00163   // Overload GetMTime() because we depend on Loop
00164   unsigned long int GetMTime();
00165 
00167   virtual void UnRegister(vtkObjectBase *o);
00168 
00170   virtual int InRegisterLoop(vtkObject *);
00171 
00172 protected:
00173   vtkSelectPolyData();
00174   ~vtkSelectPolyData();
00175 
00176   void Execute();
00177 
00178   int GenerateSelectionScalars;
00179   int InsideOut;
00180   vtkPoints *Loop;
00181   int SelectionMode;
00182   float ClosestPoint[3];
00183   int GenerateUnselectedOutput;
00184   vtkPolyData *UnselectedOutput;
00185   vtkPolyData *SelectionEdges;
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