Add locking mechanism to prevent updating transform/parent

This commit is contained in:
Godzil
2020-03-10 13:55:27 +00:00
parent 5da0c10182
commit 441d758845
9 changed files with 95 additions and 7 deletions

View File

@@ -17,8 +17,8 @@ CSG::CSG(OperationType operation, Shape *left, Shape *right) : Shape(Shape::CSG)
{
stats.addCsg();
this->left->parent = this;
this->right->parent = this;
this->left->setParent(this);
this->right->setParent(this);
this->bounds | this->left->getBounds();
this->bounds | this->right->getBounds();
@@ -134,6 +134,19 @@ void CSG::filterIntersections(Intersect &xs, Intersect &ret)
}
}
void CSG::lock()
{
Shape::lock();
if(this->left)
{
this->left->lock();
}
if(this->right)
{
this->right->lock();
}
}
void CSG::dumpMe(FILE *fp)
{