Graphics/vtkSelectPolyData.h Source File

Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages

# Graphics/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 =========================================================================*/
    00095 #ifndef __vtkSelectPolyData_h
    00096 #define __vtkSelectPolyData_h
    00097
    00098 #include "vtkPolyDataToPolyDataFilter.h"
    00099
    00100 #define VTK_INSIDE_SMALLEST_REGION 0
    00101 #define VTK_INSIDE_LARGEST_REGION 1
    00102 #define VTK_INSIDE_CLOSEST_POINT_REGION 2
    00103
    00104 class vtkCharArray;
    00105 class vtkPoints;
    00106 class vtkIdList;
    00107
    00108 class VTK_GRAPHICS_EXPORT vtkSelectPolyData : public vtkPolyDataToPolyDataFilter
    00109 {
    00110 public:
    00114   static vtkSelectPolyData *New();
    00115
    00116   vtkTypeRevisionMacro(vtkSelectPolyData,vtkPolyDataToPolyDataFilter);
    00117   void PrintSelf(ostream& os, vtkIndent indent);
    00118
    00120
    00125   vtkSetMacro(GenerateSelectionScalars,int);
    00126   vtkGetMacro(GenerateSelectionScalars,int);
    00127   vtkBooleanMacro(GenerateSelectionScalars,int);
    00129
    00131
    00133   vtkSetMacro(InsideOut,int);
    00134   vtkGetMacro(InsideOut,int);
    00135   vtkBooleanMacro(InsideOut,int);
    00137
    00139
    00141   virtual void SetLoop(vtkPoints*);
    00142   vtkGetObjectMacro(Loop,vtkPoints);
    00144
    00146
    00147   vtkSetClampMacro(SelectionMode,int,
    00148              VTK_INSIDE_SMALLEST_REGION,VTK_INSIDE_CLOSEST_POINT_REGION);
    00149   vtkGetMacro(SelectionMode,int);
    00150   void SetSelectionModeToSmallestRegion()
    00151     {this->SetSelectionMode(VTK_INSIDE_SMALLEST_REGION);};
    00152   void SetSelectionModeToLargestRegion()
    00153     {this->SetSelectionMode(VTK_INSIDE_LARGEST_REGION);};
    00154   void SetSelectionModeToClosestPointRegion()
    00155     {this->SetSelectionMode(VTK_INSIDE_CLOSEST_POINT_REGION);};
    00156   const char *GetSelectionModeAsString();
    00158
    00160
    00162   vtkSetMacro(GenerateUnselectedOutput,int);
    00163   vtkGetMacro(GenerateUnselectedOutput,int);
    00164   vtkBooleanMacro(GenerateUnselectedOutput,int);
    00166
    00169   vtkPolyData *GetUnselectedOutput() {return this->UnselectedOutput;};
    00170
    00172   vtkPolyData *GetSelectionEdges() {return this->SelectionEdges;};
    00173
    00174   // Overload GetMTime() because we depend on Loop
    00175   unsigned long int GetMTime();
    00176
    00178   virtual void UnRegister(vtkObjectBase *o);
    00179
    00181   virtual int InRegisterLoop(vtkObject *);
    00182
    00183 protected:
    00184   vtkSelectPolyData();
    00185   ~vtkSelectPolyData();
    00186
    00187   void Execute();
    00188
    00189   int GenerateSelectionScalars;
    00190   int InsideOut;
    00191   vtkPoints *Loop;
    00192   int SelectionMode;
    00193   float ClosestPoint[3];
    00194   int GenerateUnselectedOutput;
    00195   vtkPolyData *UnselectedOutput;
    00196   vtkPolyData *SelectionEdges;
    00197
    00198 private:
    00199   vtkPolyData *Mesh;
    00200   void GetPointNeighbors (vtkIdType ptId, vtkIdList *nei);
    00201 private:
    00202   vtkSelectPolyData(const vtkSelectPolyData&);  // Not implemented.
    00203   void operator=(const vtkSelectPolyData&);  // Not implemented.
    00204 };
    00205
    00207 inline const char *vtkSelectPolyData::GetSelectionModeAsString(void)
    00208 {
    00209   if ( this->SelectionMode == VTK_INSIDE_SMALLEST_REGION )
    00210     {
    00211     return "InsideSmallestRegion";
    00212     }
    00213   else if ( this->SelectionMode == VTK_INSIDE_LARGEST_REGION )
    00214     {
    00215     return "InsideLargestRegion";
    00216     }
    00217   else
    00218     {
    00219     return "InsideClosestPointRegion";
    00220     }
    00221 }
    00222
    00223 #endif
    00224
    00225