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=========================================================================*/
41#ifndef vtkImplicitBoolean_h
42#define vtkImplicitBoolean_h
43
44#include "vtkCommonDataModelModule.h" // For export macro
45#include "vtkImplicitFunction.h"
46
48
49class VTKCOMMONDATAMODEL_EXPORT vtkImplicitBoolean : public vtkImplicitFunction
50{
51public:
53 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
54
56 {
57 VTK_UNION=0,
60 VTK_UNION_OF_MAGNITUDES
61 };
62
67
69
72 double EvaluateFunction(double x[3]) VTK_OVERRIDE;
73 double EvaluateFunction(double x, double y, double z)
74 {return this->vtkImplicitFunction::EvaluateFunction(x, y, z); } ;
76
80 void EvaluateGradient(double x[3], double g[3]) VTK_OVERRIDE;
81
85 vtkMTimeType GetMTime() VTK_OVERRIDE;
86
90 void AddFunction(vtkImplicitFunction *in);
91
95 void RemoveFunction(vtkImplicitFunction *in);
96
100 vtkImplicitFunctionCollection *GetFunction() {return this->FunctionList;};
101
103
106 vtkSetClampMacro(OperationType,int,VTK_UNION,VTK_UNION_OF_MAGNITUDES);
107 vtkGetMacro(OperationType,int);
109 {this->SetOperationType(VTK_UNION);};
111 {this->SetOperationType(VTK_INTERSECTION);};
113 {this->SetOperationType(VTK_DIFFERENCE);};
115 {this->SetOperationType(VTK_UNION_OF_MAGNITUDES);};
116 const char *GetOperationTypeAsString();
118
119protected:
121 ~vtkImplicitBoolean() VTK_OVERRIDE;
122
124
126
127private:
128 vtkImplicitBoolean(const vtkImplicitBoolean&) VTK_DELETE_FUNCTION;
129 void operator=(const vtkImplicitBoolean&) VTK_DELETE_FUNCTION;
130};
131
133
136inline const char *vtkImplicitBoolean::GetOperationTypeAsString(void)
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}
156
157#endif
158
159
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 PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkImplicitBoolean * New()
Default boolean method is union.
~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.
double EvaluateFunction(double x, double y, double z)
void SetOperationTypeToUnionOfMagnitudes()
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:40
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248