VTK
vtkImplicitBoolean.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImplicitBoolean.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
40 #ifndef __vtkImplicitBoolean_h
41 #define __vtkImplicitBoolean_h
42 
43 #include "vtkImplicitFunction.h"
44 
46 
47 #define VTK_UNION 0
48 #define VTK_INTERSECTION 1
49 #define VTK_DIFFERENCE 2
50 #define VTK_UNION_OF_MAGNITUDES 3
51 
53 {
54 public:
56  void PrintSelf(ostream& os, vtkIndent indent);
57 
59  static vtkImplicitBoolean *New();
60 
62 
64  double EvaluateFunction(double x[3]);
65  double EvaluateFunction(double x, double y, double z)
66  {return this->vtkImplicitFunction::EvaluateFunction(x, y, z); } ;
68 
70  void EvaluateGradient(double x[3], double g[3]);
71 
73  unsigned long GetMTime();
74 
76  void AddFunction(vtkImplicitFunction *in);
77 
79  void RemoveFunction(vtkImplicitFunction *in);
80 
82  vtkImplicitFunctionCollection *GetFunction() {return this->FunctionList;};
83 
85 
86  vtkSetClampMacro(OperationType,int,VTK_UNION,VTK_UNION_OF_MAGNITUDES);
87  vtkGetMacro(OperationType,int);
88  void SetOperationTypeToUnion()
89  {this->SetOperationType(VTK_UNION);};
90  void SetOperationTypeToIntersection()
91  {this->SetOperationType(VTK_INTERSECTION);};
92  void SetOperationTypeToDifference()
93  {this->SetOperationType(VTK_DIFFERENCE);};
94  void SetOperationTypeToUnionOfMagnitudes()
95  {this->SetOperationType(VTK_UNION_OF_MAGNITUDES);};
96  const char *GetOperationTypeAsString();
98 
99 protected:
102 
104 
106 
107 private:
108  vtkImplicitBoolean(const vtkImplicitBoolean&); // Not implemented.
109  void operator=(const vtkImplicitBoolean&); // Not implemented.
110 };
111 
113 
115 {
116  if ( this->OperationType == VTK_UNION )
117  {
118  return "Union";
119  }
120  else if ( this->OperationType == VTK_INTERSECTION )
121  {
122  return "Intersection";
123  }
124  else if ( this->OperationType == VTK_DIFFERENCE )
125  {
126  return "Difference";
127  }
128  else
129  {
130  return "UnionOfMagnitudes";
131  }
132 }
134 
135 #endif
136 
137