VTK  9.0.20200918
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 =========================================================================*/
35 #ifndef vtkImplicitBoolean_h
36 #define vtkImplicitBoolean_h
37 
38 #include "vtkCommonDataModelModule.h" // For export macro
39 #include "vtkImplicitFunction.h"
40 
42 
43 class VTKCOMMONDATAMODEL_EXPORT vtkImplicitBoolean : public vtkImplicitFunction
44 {
45 public:
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
50  {
51  VTK_UNION = 0,
54  VTK_UNION_OF_MAGNITUDES
55  };
56 
60  static vtkImplicitBoolean* New();
61 
63 
67  double EvaluateFunction(double x[3]) override;
69 
73  void EvaluateGradient(double x[3], double g[3]) override;
74 
78  vtkMTimeType GetMTime() override;
79 
83  void AddFunction(vtkImplicitFunction* in);
84 
88  void RemoveFunction(vtkImplicitFunction* in);
89 
93  vtkImplicitFunctionCollection* GetFunction() { return this->FunctionList; }
94 
96 
99  vtkSetClampMacro(OperationType, int, VTK_UNION, VTK_UNION_OF_MAGNITUDES);
100  vtkGetMacro(OperationType, int);
101  void SetOperationTypeToUnion() { this->SetOperationType(VTK_UNION); }
102  void SetOperationTypeToIntersection() { this->SetOperationType(VTK_INTERSECTION); }
103  void SetOperationTypeToDifference() { this->SetOperationType(VTK_DIFFERENCE); }
104  void SetOperationTypeToUnionOfMagnitudes() { this->SetOperationType(VTK_UNION_OF_MAGNITUDES); }
105  const char* GetOperationTypeAsString();
107 
108 protected:
110  ~vtkImplicitBoolean() override;
111 
113 
115 
116 private:
117  vtkImplicitBoolean(const vtkImplicitBoolean&) = delete;
118  void operator=(const vtkImplicitBoolean&) = delete;
119 };
120 
122 
126 {
127  if (this->OperationType == VTK_UNION)
128  {
129  return "Union";
130  }
131  else if (this->OperationType == VTK_INTERSECTION)
132  {
133  return "Intersection";
134  }
135  else if (this->OperationType == VTK_DIFFERENCE)
136  {
137  return "Difference";
138  }
139  else
140  {
141  return "UnionOfMagnitudes";
142  }
143 }
145 
146 #endif
vtkImplicitBoolean::SetOperationTypeToIntersection
void SetOperationTypeToIntersection()
Definition: vtkImplicitBoolean.h:102
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkImplicitFunction::EvaluateFunction
virtual double EvaluateFunction(double x[3])=0
Evaluate function at position x-y-z and return value.
vtkImplicitBoolean::SetOperationTypeToDifference
void SetOperationTypeToDifference()
Definition: vtkImplicitBoolean.h:103
vtkImplicitFunction
abstract interface for implicit functions
Definition: vtkImplicitFunction.h:60
vtkImplicitBoolean
implicit function consisting of boolean combinations of implicit functions
Definition: vtkImplicitBoolean.h:43
vtkImplicitBoolean::VTK_INTERSECTION
Definition: vtkImplicitBoolean.h:52
vtkImplicitBoolean::GetOperationTypeAsString
const char * GetOperationTypeAsString()
Return the boolean operation type as a descriptive character string.
Definition: vtkImplicitBoolean.h:125
vtkImplicitBoolean::OperationType
int OperationType
Definition: vtkImplicitBoolean.h:114
vtkImplicitBoolean::SetOperationTypeToUnionOfMagnitudes
void SetOperationTypeToUnionOfMagnitudes()
Definition: vtkImplicitBoolean.h:104
vtkImplicitFunction::GetMTime
vtkMTimeType GetMTime() override
Overload standard modified time function.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkImplicitFunction::EvaluateGradient
virtual void EvaluateGradient(double x[3], double g[3])=0
Evaluate function gradient at position x-y-z and pass back vector.
vtkImplicitBoolean::FunctionList
vtkImplicitFunctionCollection * FunctionList
Definition: vtkImplicitBoolean.h:112
vtkImplicitBoolean::OperationType
OperationType
Definition: vtkImplicitBoolean.h:49
vtkImplicitBoolean::GetFunction
vtkImplicitFunctionCollection * GetFunction()
Return the collection of implicit functions.
Definition: vtkImplicitBoolean.h:93
vtkImplicitFunction.h
vtkImplicitBoolean::VTK_DIFFERENCE
Definition: vtkImplicitBoolean.h:53
vtkImplicitBoolean::VTK_UNION
Definition: vtkImplicitBoolean.h:51
vtkImplicitBoolean::SetOperationTypeToUnion
void SetOperationTypeToUnion()
Definition: vtkImplicitBoolean.h:101
vtkImplicitFunction::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkImplicitFunctionCollection
maintain a list of implicit functions
Definition: vtkImplicitFunctionCollection.h:33
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:285