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

dox/Filtering/vtkImplicitBoolean.h

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