1 #ifndef EXPR_VariableNode_H
2 #define EXPR_VariableNode_H
4 #include "EXPR_LeafNode.h"
6 #include "EXPR_RootNode.h"
23 CORE_UniquePointer<EXPR_RootNode> mTree;
45 static inline CORE_UniquePointer<EXPR_VariableNode>
New() {
75 mem+=(mTree.get()==
null)?0:mTree->getContentsMemorySize();
76 mem+=mName.size()*
sizeof(tUChar);
82 inline void setName(
const tString& name) {
90 mTree=std::move(node);
110 virtual tBoolean
isInside(std::array<tReal,3> P)
const override {
111 if (mTree.get()==
null)
return false;
120 return mTree->isInside(P);
130 if (mTree.get()==
null)
return;
132 mTree->computeBoundingBox(alreadyComputed);
136 const std::array<tReal,3>& P=mTree->getBoundingBoxMinPoint();
137 const std::array<tReal,3>& Q=mTree->getBoundingBoxMaxPoint();
143 memcpy(minPoint.data(),P.data(),P.size()*
sizeof(tReal));
144 memcpy(maxPoint.data(),Q.data(),Q.size()*
sizeof(tReal));
154 virtual void adimensionize(
const tReal& L,std::map<tString,tBoolean>& alreadyComputed)
override {
157 if (mTree.get()!=
null) {
159 mTree->adimensionize(L,alreadyComputed);
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:113
tString getIdentityString() const
retrun the string identification of the class
Definition: CORE_Object.h:321
This class describes a leaf node of the tree without children.
Definition: EXPR_LeafNode.h:15
virtual tMemSize getContentsMemorySize() const override
return nthe memory size of the included associations
Definition: EXPR_LeafNode.h:62
virtual void adimensionize(const tReal &L, std::map< tString, tBoolean > &alreadyComputed)
adimensionize the node
Definition: EXPR_Node.cpp:135
const std::array< tReal, 3 > & getBoundingBoxMinPoint() const
get the min point bounding box of the node for reading
Definition: EXPR_Node.h:652
tBoolean isInsideBoundingBox(const std::array< tReal, 3 > &P) const
return true if the point P is in the bounding box
Definition: EXPR_Node.h:694
const std::array< tReal, 3 > & getBoundingBoxMaxPoint() const
get the max point bounding box of the node for reading
Definition: EXPR_Node.h:658
void applyInverse(std::array< tReal, 3 > &P) const
apply the inverse transformation to point P
Definition: EXPR_Node.h:550
This class describes the root of the tree.
Definition: EXPR_RootNode.h:16
This class describes a variable node with contains:
Definition: EXPR_VariableNode.h:17
void setName(const tString &name)
set the name of the variable
Definition: EXPR_VariableNode.h:82
virtual tMemSize getMemorySize() const override
return the memory size of the class
Definition: EXPR_VariableNode.h:61
const EXPR_RootNode * getExpression() const
get the expression of the variable
Definition: EXPR_VariableNode.h:95
virtual tMemSize getContentsMemorySize() const override
return nthe memory size of the included associations
Definition: EXPR_VariableNode.h:73
virtual tString toString() const override
return the string representation of this
Definition: EXPR_VariableNode.h:170
virtual ~EXPR_VariableNode()
delete the class
Definition: EXPR_VariableNode.h:38
virtual tBoolean isInside(std::array< tReal, 3 > P) const override
return true if the point is in the node
Definition: EXPR_VariableNode.h:110
virtual void computeBoundingBox(std::map< tString, tBoolean > &alreadyComputed) override
compute the bounding box of the node
Definition: EXPR_VariableNode.h:127
EXPR_RootNode * getExpression()
get the expression of the variable
Definition: EXPR_VariableNode.h:101
static CORE_UniquePointer< EXPR_VariableNode > New()
crete the new instance of this
Definition: EXPR_VariableNode.h:45
EXPR_VariableNode()
create the class
Definition: EXPR_VariableNode.h:32
virtual void adimensionize(const tReal &L, std::map< tString, tBoolean > &alreadyComputed) override
adimensionize the node
Definition: EXPR_VariableNode.h:154
void setExpression(CORE_UniquePointer< EXPR_RootNode > node)
set the expression of the variable
Definition: EXPR_VariableNode.h:89