Skip to content
Snippets Groups Projects
Commit b310f2a7 authored by Joan Solà Ortega's avatar Joan Solà Ortega
Browse files

Add setNonEstimated()

parent beaeb3d8
No related branches found
No related tags found
1 merge request!285Add track keyframes
...@@ -80,6 +80,7 @@ class FrameBase : public NodeBase, public std::enable_shared_from_this<FrameBase ...@@ -80,6 +80,7 @@ class FrameBase : public NodeBase, public std::enable_shared_from_this<FrameBase
bool isKeyOrAux() const; bool isKeyOrAux() const;
// set type // set type
void setNonEstimated();
void setKey(); void setKey();
void setAux(); void setAux();
......
...@@ -155,6 +155,20 @@ void FrameBase::removeStateBlocks() ...@@ -155,6 +155,20 @@ void FrameBase::removeStateBlocks()
} }
} }
void FrameBase::setNonEstimated()
{
// unregister if previously estimated
if (isKeyOrAux())
removeStateBlocks();
type_ = NON_ESTIMATED;
if (getTrajectory())
{
getTrajectory()->sortFrame(shared_from_this());
getTrajectory()->updateLastFrames();
}
}
void FrameBase::setKey() void FrameBase::setKey()
{ {
// register if previously not estimated // register if previously not estimated
...@@ -163,8 +177,11 @@ void FrameBase::setKey() ...@@ -163,8 +177,11 @@ void FrameBase::setKey()
// WOLF_DEBUG("Set Key", this->id()); // WOLF_DEBUG("Set Key", this->id());
type_ = KEY; type_ = KEY;
getTrajectory()->sortFrame(shared_from_this()); if (getTrajectory())
getTrajectory()->updateLastFrames(); {
getTrajectory()->sortFrame(shared_from_this());
getTrajectory()->updateLastFrames();
}
} }
void FrameBase::setAux() void FrameBase::setAux()
...@@ -174,8 +191,11 @@ void FrameBase::setAux() ...@@ -174,8 +191,11 @@ void FrameBase::setAux()
// WOLF_DEBUG("Set Auxiliary", this->id()); // WOLF_DEBUG("Set Auxiliary", this->id());
type_ = AUXILIARY; type_ = AUXILIARY;
getTrajectory()->sortFrame(shared_from_this()); if (getTrajectory())
getTrajectory()->updateLastFrames(); {
getTrajectory()->sortFrame(shared_from_this());
getTrajectory()->updateLastFrames();
}
} }
void FrameBase::fix() void FrameBase::fix()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment