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

vtkImplicitBoolean.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkImplicitBoolean.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 =========================================================================*/
00053 #ifndef __vtkImplicitBoolean_h
00054 #define __vtkImplicitBoolean_h
00055 
00056 #include "vtkImplicitFunction.h"
00057  
00058 class vtkImplicitFunctionCollection;
00059 
00060 #define VTK_UNION 0
00061 #define VTK_INTERSECTION 1
00062 #define VTK_DIFFERENCE 2
00063 #define VTK_UNION_OF_MAGNITUDES 3
00064 
00065 class VTK_FILTERING_EXPORT vtkImplicitBoolean : public vtkImplicitFunction
00066 {
00067 public:
00068   vtkTypeRevisionMacro(vtkImplicitBoolean,vtkImplicitFunction);
00069   void PrintSelf(ostream& os, vtkIndent indent);
00070 
00072   static vtkImplicitBoolean *New();
00073 
00075 
00077   double EvaluateFunction(double x[3]);
00078   double EvaluateFunction(double x, double y, double z)
00079     {return this->vtkImplicitFunction::EvaluateFunction(x, y, z); } ;
00081 
00083   void EvaluateGradient(double x[3], double g[3]);
00084 
00086   unsigned long GetMTime();
00087 
00089   void AddFunction(vtkImplicitFunction *in);
00090 
00092   void RemoveFunction(vtkImplicitFunction *in);
00093 
00095   vtkImplicitFunctionCollection *GetFunction() {return this->FunctionList;};
00096 
00098 
00099   vtkSetClampMacro(OperationType,int,VTK_UNION,VTK_UNION_OF_MAGNITUDES);
00100   vtkGetMacro(OperationType,int);
00101   void SetOperationTypeToUnion() 
00102     {this->SetOperationType(VTK_UNION);};
00103   void SetOperationTypeToIntersection() 
00104     {this->SetOperationType(VTK_INTERSECTION);};
00105   void SetOperationTypeToDifference() 
00106     {this->SetOperationType(VTK_DIFFERENCE);};
00107   void SetOperationTypeToUnionOfMagnitudes() 
00108     {this->SetOperationType(VTK_UNION_OF_MAGNITUDES);};
00109   const char *GetOperationTypeAsString();
00111   
00112 protected:
00113   vtkImplicitBoolean();
00114   ~vtkImplicitBoolean();
00115 
00116   vtkImplicitFunctionCollection *FunctionList;
00117 
00118   int OperationType;
00119 
00120 private:
00121   vtkImplicitBoolean(const vtkImplicitBoolean&);  // Not implemented.
00122   void operator=(const vtkImplicitBoolean&);  // Not implemented.
00123 };
00124 
00126 inline const char *vtkImplicitBoolean::GetOperationTypeAsString(void)
00127 {
00128   if ( this->OperationType == VTK_UNION )
00129     {
00130     return "Union";
00131     }
00132   else if ( this->OperationType == VTK_INTERSECTION ) 
00133     {
00134     return "Intersection";
00135     }
00136   else if ( this->OperationType == VTK_DIFFERENCE ) 
00137     {
00138     return "Difference";
00139     }
00140   else 
00141     {
00142     return "UnionOfMagnitudes";
00143     }
00144 }
00145 
00146 #endif
00147 
00148