1 #ifndef EXPR_ParentNode_H
2 #define EXPR_ParentNode_H
8 #include "CORE_ClassFactory.h"
11 #include "EXPR_ChildNode.h"
14 #include "core_string.h"
32 std::vector<CORE_SharedPointer<EXPR_ChildNode>> mChildren;
71 for(
const auto& child: mChildren) mem+=child->getContentsMemorySize();
80 inline void addChild(CORE_SharedPointer<EXPR_ChildNode> cNode) {
81 mChildren.push_back(cNode);
86 inline void addChild(CORE_UniquePointer<EXPR_ChildNode> cNode) {
88 mChildren.push_back(sharedChild);
94 inline const std::vector<CORE_SharedPointer<EXPR_ChildNode>>&
getChildren()
const {
100 inline std::vector<CORE_SharedPointer<EXPR_ChildNode>>&
getChildren() {
109 if (i>=mChildren.size()) {
110 CORE_SharedPointer<EXPR_ChildNode> nullChild;
121 if (i>=mChildren.size())
return null;
122 return mChildren[i].get();
130 if (i>=mChildren.size())
return null;
131 return mChildren[i].get();
139 virtual void adimensionize(
const tReal& L,std::map<tString,tBoolean>& alreadyComputed)
override {
142 for(
auto& child:mChildren) {
143 child->adimensionize(L,alreadyComputed);
156 virtual void computeBoundingBox(std::map<tString,tBoolean>& alreadyComputed)
override;
162 virtual tBoolean
isInside(std::array<tReal,3> M)
const override ;
171 if (mChildren.size()>0) {
172 ret=mChildren[0]->toString();
173 core_string::trim(ret);
CORE_SharedPointer< T > NewSharedPointer() const
create a shared instance of a class with same type as T with no argument
Definition: CORE_ClassFactory.h:198
tString getIdentityString() const
retrun the string identification of the class
Definition: CORE_Object.h:321
This class describes a child node of the tree.
Definition: EXPR_ChildNode.h:12
This class is a base class of the binary tree.
Definition: EXPR_Node.h:16
virtual void adimensionize(const tReal &L, std::map< tString, tBoolean > &alreadyComputed)
adimensionize the node
Definition: EXPR_Node.cpp:135
virtual tMemSize getContentsMemorySize() const override
return nthe memory size of the included associations
Definition: EXPR_Node.h:79
This class is a parent node with children.
Definition: EXPR_ParentNode.h:23
std::vector< CORE_SharedPointer< EXPR_ChildNode > > & getChildren()
get the children
Definition: EXPR_ParentNode.h:100
virtual ~EXPR_ParentNode()
delete the class
Definition: EXPR_ParentNode.cpp:8
void addChild(CORE_SharedPointer< EXPR_ChildNode > cNode)
add the children
Definition: EXPR_ParentNode.h:80
virtual tMemSize getMemorySize() const override
return the memory size of the class
Definition: EXPR_ParentNode.h:57
virtual tBoolean isInside(std::array< tReal, 3 > M) const override
return true if the point is in the bounding box of the first child node
Definition: EXPR_ParentNode.cpp:13
EXPR_ChildNode * getChild(const tIndex &i)
get the child at index for writting
Definition: EXPR_ParentNode.h:120
const EXPR_ChildNode * getChild(const tIndex &i) const
get the child at index for readind
Definition: EXPR_ParentNode.h:129
EXPR_ParentNode()
create the class
Definition: EXPR_ParentNode.cpp:5
CORE_SharedPointer< EXPR_ChildNode > getSharedChild(const tIndex &i)
get the shared child at index for writting
Definition: EXPR_ParentNode.h:108
virtual tMemSize getContentsMemorySize() const override
return nthe memory size of the included associations
Definition: EXPR_ParentNode.h:69
virtual void adimensionize(const tReal &L, std::map< tString, tBoolean > &alreadyComputed) override
adimensionize the node
Definition: EXPR_ParentNode.h:139
virtual tString toString() const override
return the string representation of this
Definition: EXPR_ParentNode.h:169
const std::vector< CORE_SharedPointer< EXPR_ChildNode > > & getChildren() const
get the children
Definition: EXPR_ParentNode.h:94
void addChild(CORE_UniquePointer< EXPR_ChildNode > cNode)
add the children
Definition: EXPR_ParentNode.h:86
virtual void computeBoundingBox(std::map< tString, tBoolean > &alreadyComputed) override
compute the bounding box of the geometry after applying the transformation cosidering only first chil...
Definition: EXPR_ParentNode.cpp:30