Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | 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 =========================================================================*/
00040 #ifndef __vtkImplicitBoolean_h
00041 #define __vtkImplicitBoolean_h
00042 
00043 #include "vtkImplicitFunction.h"
00044  
00045 class vtkImplicitFunctionCollection;
00046 
00047 #define VTK_UNION 0
00048 #define VTK_INTERSECTION 1
00049 #define VTK_DIFFERENCE 2
00050 #define VTK_UNION_OF_MAGNITUDES 3
00051 
00052 class VTK_FILTERING_EXPORT vtkImplicitBoolean : public vtkImplicitFunction
00053 {
00054 public:
00055   vtkTypeRevisionMacro(vtkImplicitBoolean,vtkImplicitFunction);
00056   void PrintSelf(ostream& os, vtkIndent indent);
00057 
00059   static vtkImplicitBoolean *New();
00060 
00062 
00064   double EvaluateFunction(double x[3]);
00065   double EvaluateFunction(double x, double y, double z)
00066     {return this->vtkImplicitFunction::EvaluateFunction(x, y, z); } ;
00068 
00070   void EvaluateGradient(double x[3], double g[3]);
00071 
00073   unsigned long GetMTime();
00074 
00076   void AddFunction(vtkImplicitFunction *in);
00077 
00079   void RemoveFunction(vtkImplicitFunction *in);
00080 
00082   vtkImplicitFunctionCollection *GetFunction() {return this->FunctionList;};
00083 
00085 
00086   vtkSetClampMacro(OperationType,int,VTK_UNION,VTK_UNION_OF_MAGNITUDES);
00087   vtkGetMacro(OperationType,int);
00088   void SetOperationTypeToUnion() 
00089     {this->SetOperationType(VTK_UNION);};
00090   void SetOperationTypeToIntersection() 
00091     {this->SetOperationType(VTK_INTERSECTION);};
00092   void SetOperationTypeToDifference() 
00093     {this->SetOperationType(VTK_DIFFERENCE);};
00094   void SetOperationTypeToUnionOfMagnitudes() 
00095     {this->SetOperationType(VTK_UNION_OF_MAGNITUDES);};
00096   const char *GetOperationTypeAsString();
00098   
00099 protected:
00100   vtkImplicitBoolean();
00101   ~vtkImplicitBoolean();
00102 
00103   vtkImplicitFunctionCollection *FunctionList;
00104 
00105   int OperationType;
00106 
00107 private:
00108   vtkImplicitBoolean(const vtkImplicitBoolean&);  // Not implemented.
00109   void operator=(const vtkImplicitBoolean&);  // Not implemented.
00110 };
00111 
00113 inline const char *vtkImplicitBoolean::GetOperationTypeAsString(void)
00114 {
00115   if ( this->OperationType == VTK_UNION )
00116     {
00117     return "Union";
00118     }
00119   else if ( this->OperationType == VTK_INTERSECTION ) 
00120     {
00121     return "Intersection";
00122     }
00123   else if ( this->OperationType == VTK_DIFFERENCE ) 
00124     {
00125     return "Difference";
00126     }
00127   else 
00128     {
00129     return "UnionOfMagnitudes";
00130     }
00131 }
00132 
00133 #endif
00134 
00135 

Generated on Mon Jan 21 23:07:19 2008 for VTK by  doxygen 1.4.3-20050530