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

Remove setKeyFrame() and explode the only call there: clean redundant code.

parent 6e57b23b
No related branches found
No related tags found
1 merge request!157Kfpackmanager
......@@ -155,11 +155,18 @@ void ProcessorTracker::process(CaptureBasePtr const _incoming_ptr)
// process
processNew(max_new_features_);
setKeyFrame(last_ptr_);
// Set key
last_ptr_->getFramePtr()->setKey();
// Set state to the keyframe
last_ptr_->getFramePtr()->setState(getProblem()->getState(last_ptr_->getTimeStamp()));
// Establish constraints
establishConstraints();
// Call the new keyframe callback in order to let the other processors to establish their constraints
getProblem()->keyFrameCallback(last_ptr_->getFramePtr(), std::static_pointer_cast<ProcessorBase>(shared_from_this()), time_tolerance_);
// Update pointers
resetDerived();
origin_ptr_ = last_ptr_;
......@@ -189,20 +196,6 @@ void ProcessorTracker::process(CaptureBasePtr const _incoming_ptr)
postProcess();
}
void ProcessorTracker::setKeyFrame(CaptureBasePtr _capture_ptr)
{
assert(_capture_ptr != nullptr && _capture_ptr->getFramePtr() != nullptr && "ProcessorTracker::setKeyFrame: null capture or capture without frame");
if (!_capture_ptr->getFramePtr()->isKey())
{
// Set key
_capture_ptr->getFramePtr()->setKey();
// Set state to the keyframe
_capture_ptr->getFramePtr()->setState(getProblem()->getState(_capture_ptr->getTimeStamp()));
// Call the new keyframe callback in order to let the other processors to establish their constraints
getProblem()->keyFrameCallback(_capture_ptr->getFramePtr(), std::static_pointer_cast<ProcessorBase>(shared_from_this()), time_tolerance_);
}
}
void ProcessorTracker::computeProcessingStep()
{
// First determine the processing phase by checking the status of the tracker pointers
......
......@@ -187,10 +187,6 @@ class ProcessorTracker : public ProcessorBase
*/
virtual void establishConstraints()=0;
/**\brief set key Frame to the provided Capture's frame
*/
virtual void setKeyFrame(CaptureBasePtr _capture_ptr);
/** \brief Reset the tracker using the \b last Capture as the new \b origin.
*/
virtual void resetDerived() = 0;
......
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