VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/Common/DataModel/vtkImplicitBoolean.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkImplicitBoolean.h
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 "vtkCommonDataModelModule.h" // For export macro
00044 #include "vtkImplicitFunction.h"
00045 
00046 class vtkImplicitFunctionCollection;
00047 
00048 class VTKCOMMONDATAMODEL_EXPORT vtkImplicitBoolean : public vtkImplicitFunction
00049 {
00050 public:
00051   vtkTypeMacro(vtkImplicitBoolean,vtkImplicitFunction);
00052   void PrintSelf(ostream& os, vtkIndent indent);
00053 
00054   enum OperationType
00055   {
00056     VTK_UNION=0,
00057     VTK_INTERSECTION,
00058     VTK_DIFFERENCE,
00059     VTK_UNION_OF_MAGNITUDES
00060   };
00061 
00063   static vtkImplicitBoolean *New();
00064 
00066 
00068   double EvaluateFunction(double x[3]);
00069   double EvaluateFunction(double x, double y, double z)
00070     {return this->vtkImplicitFunction::EvaluateFunction(x, y, z); } ;
00072 
00074   void EvaluateGradient(double x[3], double 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 
00118 inline const char *vtkImplicitBoolean::GetOperationTypeAsString(void)
00119 {
00120   if ( this->OperationType == VTK_UNION )
00121     {
00122     return "Union";
00123     }
00124   else if ( this->OperationType == VTK_INTERSECTION )
00125     {
00126     return "Intersection";
00127     }
00128   else if ( this->OperationType == VTK_DIFFERENCE )
00129     {
00130     return "Difference";
00131     }
00132   else
00133     {
00134     return "UnionOfMagnitudes";
00135     }
00136 }
00138 
00139 #endif
00140 
00141