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 
00008 Copyright (c) 1993-2001 Ken Martin, Will Schroeder, Bill Lorensen 
00009 All rights reserved.
00010 
00011 Redistribution and use in source and binary forms, with or without
00012 modification, are permitted provided that the following conditions are met:
00013 
00014  * Redistributions of source code must retain the above copyright notice,
00015    this list of conditions and the following disclaimer.
00016 
00017  * Redistributions in binary form must reproduce the above copyright notice,
00018    this list of conditions and the following disclaimer in the documentation
00019    and/or other materials provided with the distribution.
00020 
00021  * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
00022    of any contributors may be used to endorse or promote products derived
00023    from this software without specific prior written permission.
00024 
00025  * Modified source versions must be plainly marked as such, and must not be
00026    misrepresented as being the original software.
00027 
00028 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00029 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00030 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00031 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
00032 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00033 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00034 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00035 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00036 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00037 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00038 
00039 =========================================================================*/
00107 #ifndef __vtkSelectPolyData_h
00108 #define __vtkSelectPolyData_h
00109 
00110 #include "vtkPolyDataToPolyDataFilter.h"
00111 
00112 #define VTK_INSIDE_SMALLEST_REGION 0
00113 #define VTK_INSIDE_LARGEST_REGION 1
00114 #define VTK_INSIDE_CLOSEST_POINT_REGION 2
00115 
00116 class vtkCharArray;
00117 
00118 class VTK_EXPORT vtkSelectPolyData : public vtkPolyDataToPolyDataFilter
00119 {
00120 public:
00124   static vtkSelectPolyData *New();
00125 
00126   vtkTypeMacro(vtkSelectPolyData,vtkPolyDataToPolyDataFilter);
00127   void PrintSelf(ostream& os, vtkIndent indent);
00128 
00134   vtkSetMacro(GenerateSelectionScalars,int);
00135   vtkGetMacro(GenerateSelectionScalars,int);
00136   vtkBooleanMacro(GenerateSelectionScalars,int);
00137 
00140   vtkSetMacro(InsideOut,int);
00141   vtkGetMacro(InsideOut,int);
00142   vtkBooleanMacro(InsideOut,int);
00143 
00146   vtkSetObjectMacro(Loop,vtkPoints);
00147   vtkGetObjectMacro(Loop,vtkPoints);
00148 
00150   vtkSetClampMacro(SelectionMode,int,
00151              VTK_INSIDE_SMALLEST_REGION,VTK_INSIDE_CLOSEST_POINT_REGION);
00152   vtkGetMacro(SelectionMode,int);
00153   void SetSelectionModeToSmallestRegion()
00154     {this->SetSelectionMode(VTK_INSIDE_SMALLEST_REGION);};
00155   void SetSelectionModeToLargestRegion()
00156     {this->SetSelectionMode(VTK_INSIDE_LARGEST_REGION);};
00157   void SetSelectionModeToClosestPointRegion()
00158     {this->SetSelectionMode(VTK_INSIDE_CLOSEST_POINT_REGION);};
00159   const char *GetSelectionModeAsString();
00160 
00163   vtkSetMacro(GenerateUnselectedOutput,int);
00164   vtkGetMacro(GenerateUnselectedOutput,int);
00165   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   void UnRegister(vtkObject *o);
00179 
00181   virtual int InRegisterLoop(vtkObject *);
00182 
00183 protected:
00184   vtkSelectPolyData();
00185   ~vtkSelectPolyData();
00186   vtkSelectPolyData(const vtkSelectPolyData&) {};
00187   void operator=(const vtkSelectPolyData&) {};
00188 
00189   void Execute();
00190 
00191   int GenerateSelectionScalars;
00192   int InsideOut;
00193   vtkPoints *Loop;
00194   int SelectionMode;
00195   float ClosestPoint[3];
00196   int GenerateUnselectedOutput;
00197   vtkPolyData *UnselectedOutput;
00198   vtkPolyData *SelectionEdges;
00199 
00200 private:
00201   vtkPolyData *Mesh;
00202   void GetPointNeighbors (int ptId, vtkIdList *nei);
00203 
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 

Generated on Wed Nov 21 12:27:03 2001 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001