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

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