VTK  9.3.20240328
vtkImplicitBoolean.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
95 #ifndef vtkImplicitBoolean_h
96 #define vtkImplicitBoolean_h
97 
98 #include "vtkCommonDataModelModule.h" // For export macro
99 #include "vtkImplicitFunction.h"
100 
101 VTK_ABI_NAMESPACE_BEGIN
103 
104 class VTKCOMMONDATAMODEL_EXPORT vtkImplicitBoolean : public vtkImplicitFunction
105 {
106 public:
108  void PrintSelf(ostream& os, vtkIndent indent) override;
109 
111  {
112  VTK_UNION = 0,
115  VTK_UNION_OF_MAGNITUDES
116  };
117 
122 
124 
128  double EvaluateFunction(double x[3]) override;
130 
134  void EvaluateGradient(double x[3], double g[3]) override;
135 
139  vtkMTimeType GetMTime() override;
140 
145 
150 
154  vtkImplicitFunctionCollection* GetFunction() { return this->FunctionList; }
155 
157 
160  vtkSetClampMacro(OperationType, int, VTK_UNION, VTK_UNION_OF_MAGNITUDES);
161  vtkGetMacro(OperationType, int);
162  void SetOperationTypeToUnion() { this->SetOperationType(VTK_UNION); }
163  void SetOperationTypeToIntersection() { this->SetOperationType(VTK_INTERSECTION); }
164  void SetOperationTypeToDifference() { this->SetOperationType(VTK_DIFFERENCE); }
165  void SetOperationTypeToUnionOfMagnitudes() { this->SetOperationType(VTK_UNION_OF_MAGNITUDES); }
166  const char* GetOperationTypeAsString();
168 
169 protected:
172 
174 
176 
177 private:
178  vtkImplicitBoolean(const vtkImplicitBoolean&) = delete;
179  void operator=(const vtkImplicitBoolean&) = delete;
180 };
181 
186 {
187  if (this->OperationType == VTK_UNION)
188  {
189  return "Union";
190  }
191  else if (this->OperationType == VTK_INTERSECTION)
192  {
193  return "Intersection";
194  }
195  else if (this->OperationType == VTK_DIFFERENCE)
196  {
197  return "Difference";
198  }
199  else
200  {
201  return "UnionOfMagnitudes";
202  }
203 }
204 
205 VTK_ABI_NAMESPACE_END
206 #endif
implicit function consisting of boolean combinations of implicit functions
double EvaluateFunction(double x[3]) override
Evaluate boolean combinations of implicit function using current operator.
void SetOperationTypeToDifference()
Specify the type of boolean operation.
static vtkImplicitBoolean * New()
Default boolean method is union.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetOperationTypeToIntersection()
Specify the type of boolean operation.
vtkImplicitFunctionCollection * FunctionList
void SetOperationTypeToUnion()
Specify the type of boolean operation.
void AddFunction(vtkImplicitFunction *in)
Add another implicit function to the list of functions.
vtkImplicitFunctionCollection * GetFunction()
Return the collection of implicit functions.
~vtkImplicitBoolean() override
void EvaluateGradient(double x[3], double g[3]) override
Evaluate gradient of boolean combination.
vtkMTimeType GetMTime() override
Override modified time retrieval because of object dependencies.
void RemoveFunction(vtkImplicitFunction *in)
Remove a function from the list of implicit functions to boolean.
const char * GetOperationTypeAsString()
Return the boolean operation type as a descriptive character string.
void SetOperationTypeToUnionOfMagnitudes()
Specify the type of boolean operation.
maintain a list of implicit functions
abstract interface for implicit functions
virtual double EvaluateFunction(double x[3])=0
Evaluate function at position x-y-z and return value.
a simple class to control print indentation
Definition: vtkIndent.h:108
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270