VTK  9.2.6
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 =========================================================================*/
47 #ifndef vtkImplicitBoolean_h
48 #define vtkImplicitBoolean_h
49 
50 #include "vtkCommonDataModelModule.h" // For export macro
51 #include "vtkImplicitFunction.h"
52 
54 
55 class VTKCOMMONDATAMODEL_EXPORT vtkImplicitBoolean : public vtkImplicitFunction
56 {
57 public:
59  void PrintSelf(ostream& os, vtkIndent indent) override;
60 
62  {
63  VTK_UNION = 0,
66  VTK_UNION_OF_MAGNITUDES
67  };
68 
73 
75 
79  double EvaluateFunction(double x[3]) override;
81 
85  void EvaluateGradient(double x[3], double g[3]) override;
86 
90  vtkMTimeType GetMTime() override;
91 
96 
101 
105  vtkImplicitFunctionCollection* GetFunction() { return this->FunctionList; }
106 
108 
111  vtkSetClampMacro(OperationType, int, VTK_UNION, VTK_UNION_OF_MAGNITUDES);
112  vtkGetMacro(OperationType, int);
113  void SetOperationTypeToUnion() { this->SetOperationType(VTK_UNION); }
114  void SetOperationTypeToIntersection() { this->SetOperationType(VTK_INTERSECTION); }
115  void SetOperationTypeToDifference() { this->SetOperationType(VTK_DIFFERENCE); }
116  void SetOperationTypeToUnionOfMagnitudes() { this->SetOperationType(VTK_UNION_OF_MAGNITUDES); }
117  const char* GetOperationTypeAsString();
119 
120 protected:
123 
125 
127 
128 private:
129  vtkImplicitBoolean(const vtkImplicitBoolean&) = delete;
130  void operator=(const vtkImplicitBoolean&) = delete;
131 };
132 
137 {
138  if (this->OperationType == VTK_UNION)
139  {
140  return "Union";
141  }
142  else if (this->OperationType == VTK_INTERSECTION)
143  {
144  return "Intersection";
145  }
146  else if (this->OperationType == VTK_DIFFERENCE)
147  {
148  return "Difference";
149  }
150  else
151  {
152  return "UnionOfMagnitudes";
153  }
154 }
155 
156 #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:49
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287