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 =========================================================================*/
38 #ifndef vtkImplicitBoolean_h
39 #define vtkImplicitBoolean_h
40 
41 #include "vtkCommonDataModelModule.h" // For export macro
42 #include "vtkImplicitFunction.h"
43 
45 
46 class VTKCOMMONDATAMODEL_EXPORT vtkImplicitBoolean : public vtkImplicitFunction
47 {
48 public:
50  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
53  {
54  VTK_UNION = 0,
57  VTK_UNION_OF_MAGNITUDES
58  };
59 
63  static vtkImplicitBoolean* New();
64 
66 
70  double EvaluateFunction(double x[3]) override;
72 
76  void EvaluateGradient(double x[3], double g[3]) override;
77 
81  vtkMTimeType GetMTime() override;
82 
86  void AddFunction(vtkImplicitFunction* in);
87 
91  void RemoveFunction(vtkImplicitFunction* in);
92 
96  vtkImplicitFunctionCollection* GetFunction() { return this->FunctionList; }
97 
99 
102  vtkSetClampMacro(OperationType, int, VTK_UNION, VTK_UNION_OF_MAGNITUDES);
103  vtkGetMacro(OperationType, int);
104  void SetOperationTypeToUnion() { this->SetOperationType(VTK_UNION); }
105  void SetOperationTypeToIntersection() { this->SetOperationType(VTK_INTERSECTION); }
106  void SetOperationTypeToDifference() { this->SetOperationType(VTK_DIFFERENCE); }
107  void SetOperationTypeToUnionOfMagnitudes() { this->SetOperationType(VTK_UNION_OF_MAGNITUDES); }
108  const char* GetOperationTypeAsString();
110 
111 protected:
113  ~vtkImplicitBoolean() override;
114 
116 
118 
119 private:
120  vtkImplicitBoolean(const vtkImplicitBoolean&) = delete;
121  void operator=(const vtkImplicitBoolean&) = delete;
122 };
123 
128 {
129  if (this->OperationType == VTK_UNION)
130  {
131  return "Union";
132  }
133  else if (this->OperationType == VTK_INTERSECTION)
134  {
135  return "Intersection";
136  }
137  else if (this->OperationType == VTK_DIFFERENCE)
138  {
139  return "Difference";
140  }
141  else
142  {
143  return "UnionOfMagnitudes";
144  }
145 }
146 
147 #endif
abstract interface for implicit functions
virtual double EvaluateFunction(double x[3])=0
Evaluate function at position x-y-z and return value.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
implicit function consisting of boolean combinations of implicit functions
void SetOperationTypeToUnion()
Specify the type of boolean operation.
maintain a list of implicit functions
virtual void EvaluateGradient(double x[3], double g[3])=0
Evaluate function gradient at position x-y-z and pass back vector.
void SetOperationTypeToDifference()
Specify the type of boolean operation.
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkMTimeType GetMTime() override
Overload standard modified time function.
vtkImplicitFunctionCollection * GetFunction()
Return the collection of implicit functions.
vtkImplicitFunctionCollection * FunctionList
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
void SetOperationTypeToIntersection()
Specify the type of boolean operation.
const char * GetOperationTypeAsString()
Return the boolean operation type as a descriptive character string.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetOperationTypeToUnionOfMagnitudes()
Specify the type of boolean operation.