VTK
|
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 "vtkPolyDataAlgorithm.h" 00084 00085 #define VTK_INSIDE_SMALLEST_REGION 0 00086 #define VTK_INSIDE_LARGEST_REGION 1 00087 #define VTK_INSIDE_CLOSEST_POINT_REGION 2 00088 00089 class vtkCharArray; 00090 class vtkPoints; 00091 class vtkIdList; 00092 00093 class VTK_GRAPHICS_EXPORT vtkSelectPolyData : public vtkPolyDataAlgorithm 00094 { 00095 public: 00099 static vtkSelectPolyData *New(); 00100 00101 vtkTypeMacro(vtkSelectPolyData,vtkPolyDataAlgorithm); 00102 void PrintSelf(ostream& os, vtkIndent indent); 00103 00105 00110 vtkSetMacro(GenerateSelectionScalars,int); 00111 vtkGetMacro(GenerateSelectionScalars,int); 00112 vtkBooleanMacro(GenerateSelectionScalars,int); 00114 00116 00118 vtkSetMacro(InsideOut,int); 00119 vtkGetMacro(InsideOut,int); 00120 vtkBooleanMacro(InsideOut,int); 00122 00124 00126 virtual void SetLoop(vtkPoints*); 00127 vtkGetObjectMacro(Loop,vtkPoints); 00129 00131 00132 vtkSetClampMacro(SelectionMode,int, 00133 VTK_INSIDE_SMALLEST_REGION,VTK_INSIDE_CLOSEST_POINT_REGION); 00134 vtkGetMacro(SelectionMode,int); 00135 void SetSelectionModeToSmallestRegion() 00136 {this->SetSelectionMode(VTK_INSIDE_SMALLEST_REGION);}; 00137 void SetSelectionModeToLargestRegion() 00138 {this->SetSelectionMode(VTK_INSIDE_LARGEST_REGION);}; 00139 void SetSelectionModeToClosestPointRegion() 00140 {this->SetSelectionMode(VTK_INSIDE_CLOSEST_POINT_REGION);}; 00141 const char *GetSelectionModeAsString(); 00143 00145 00147 vtkSetMacro(GenerateUnselectedOutput,int); 00148 vtkGetMacro(GenerateUnselectedOutput,int); 00149 vtkBooleanMacro(GenerateUnselectedOutput,int); 00151 00154 vtkPolyData *GetUnselectedOutput(); 00155 00157 vtkPolyData *GetSelectionEdges(); 00158 00159 // Overload GetMTime() because we depend on Loop 00160 unsigned long int GetMTime(); 00161 00162 protected: 00163 vtkSelectPolyData(); 00164 ~vtkSelectPolyData(); 00165 00166 int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00167 00168 int GenerateSelectionScalars; 00169 int InsideOut; 00170 vtkPoints *Loop; 00171 int SelectionMode; 00172 double ClosestPoint[3]; 00173 int GenerateUnselectedOutput; 00174 00175 private: 00176 vtkPolyData *Mesh; 00177 void GetPointNeighbors (vtkIdType ptId, vtkIdList *nei); 00178 private: 00179 vtkSelectPolyData(const vtkSelectPolyData&); // Not implemented. 00180 void operator=(const vtkSelectPolyData&); // Not implemented. 00181 }; 00182 00184 00185 inline const char *vtkSelectPolyData::GetSelectionModeAsString(void) 00186 { 00187 if ( this->SelectionMode == VTK_INSIDE_SMALLEST_REGION ) 00188 { 00189 return "InsideSmallestRegion"; 00190 } 00191 else if ( this->SelectionMode == VTK_INSIDE_LARGEST_REGION ) 00192 { 00193 return "InsideLargestRegion"; 00194 } 00195 else 00196 { 00197 return "InsideClosestPointRegion"; 00198 } 00199 } 00201 00202 #endif 00203 00204