Commit a11081f9 authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

Frame computes child list only when required.

parent 97580c46
......@@ -84,8 +84,9 @@ namespace hpp {
/// Returns true if this frame is the universe frame.
bool isRootFrame () const;
const std::vector<FrameIndex>& children () const
const std::vector<FrameIndex>& children ()
{
setChildList();
return children_;
}
......
......@@ -49,7 +49,6 @@ namespace hpp {
assert (devicePtr_.lock());
assert (devicePtr_.lock()->modelPtr());
assert (std::size_t(frameIndex_)<model().frames.size());
setChildList();
}
void Frame::selfAssert() const
......@@ -123,7 +122,7 @@ namespace hpp {
void Frame::setChildList()
{
selfAssert();
children_.clear();
if (!children_.empty()) return;
if (!isFixed()) return;
const Model& m = model();
......@@ -176,6 +175,8 @@ namespace hpp {
void Frame::positionInParentFrame (const Transform3f& p)
{
selfAssert();
setChildList();
devicePtr_.lock()->invalidate();
Model& m = model();
GeomModel& geomModel = devicePtr_.lock()->geomModel();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment