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

Implement lists of NodeOther and API

parent 0c888c06
No related branches found
No related tags found
1 merge request!346Resolve "Frame/Capture/Feature/Landmark Other as list/vectors in FactorBase"
This commit is part of merge request !346. Comments created here will be created in the context of that merge request.
...@@ -182,10 +182,10 @@ class FactorBase : public NodeBase, public std::enable_shared_from_this<FactorBa ...@@ -182,10 +182,10 @@ class FactorBase : public NodeBase, public std::enable_shared_from_this<FactorBa
FeatureBaseWPtrList getFeatureOtherList() const { return feature_other_list_; } FeatureBaseWPtrList getFeatureOtherList() const { return feature_other_list_; }
LandmarkBaseWPtrList getLandmarkOtherList() const { return landmark_other_list_; } LandmarkBaseWPtrList getLandmarkOtherList() const { return landmark_other_list_; }
bool hasFrameOther(const FrameBasePtr& _frm_other); bool hasFrameOther(const FrameBasePtr& _frm_other) const;
bool hasCaptureOther(const CaptureBasePtr& _cap_other); bool hasCaptureOther(const CaptureBasePtr& _cap_other) const;
bool hasFeatureOther(const FeatureBasePtr& _ftr_other); bool hasFeatureOther(const FeatureBasePtr& _ftr_other) const;
bool hasLandmarkOther(const LandmarkBasePtr& _lmk_other); bool hasLandmarkOther(const LandmarkBasePtr& _lmk_other) const;
public: public:
/** /**
......
...@@ -169,60 +169,60 @@ void FactorBase::setStatus(FactorStatus _status) ...@@ -169,60 +169,60 @@ void FactorBase::setStatus(FactorStatus _status)
status_ = _status; status_ = _status;
} }
bool FactorBase::hasFrameOther(const FrameBasePtr &_frm_other) bool FactorBase::hasFrameOther(const FrameBasePtr &_frm_other) const
{ {
FrameBaseWPtrList::iterator frm_it = find_if(frame_other_list_.begin(), FrameBaseWConstIter frm_it = find_if(frame_other_list_.begin(),
frame_other_list_.end(), frame_other_list_.end(),
[_frm_other](const FrameBaseWPtr &frm_ow) [_frm_other](const FrameBaseWPtr &frm_ow)
{ {
return frm_ow.lock() == _frm_other; return frm_ow.lock() == _frm_other;
} }
); );
if (frm_it != frame_other_list_.end()) if (frm_it != frame_other_list_.end())
return true; return true;
return false; return false;
} }
bool FactorBase::hasCaptureOther(const CaptureBasePtr &_cap_other) bool FactorBase::hasCaptureOther(const CaptureBasePtr &_cap_other) const
{ {
CaptureBaseWPtrList::iterator cap_it = find_if(capture_other_list_.begin(), CaptureBaseWConstIter cap_it = find_if(capture_other_list_.begin(),
capture_other_list_.end(), capture_other_list_.end(),
[_cap_other](const CaptureBaseWPtr &cap_ow) [_cap_other](const CaptureBaseWPtr &cap_ow)
{ {
return cap_ow.lock() == _cap_other; return cap_ow.lock() == _cap_other;
} }
); );
if (cap_it != capture_other_list_.end()) if (cap_it != capture_other_list_.end())
return true; return true;
return false; return false;
} }
bool FactorBase::hasFeatureOther(const FeatureBasePtr &_ftr_other) bool FactorBase::hasFeatureOther(const FeatureBasePtr &_ftr_other) const
{ {
FeatureBaseWPtrList::iterator ftr_it = find_if(feature_other_list_.begin(), FeatureBaseWConstIter ftr_it = find_if(feature_other_list_.begin(),
feature_other_list_.end(), feature_other_list_.end(),
[_ftr_other](const FeatureBaseWPtr &ftr_ow) [_ftr_other](const FeatureBaseWPtr &ftr_ow)
{ {
return ftr_ow.lock() == _ftr_other; return ftr_ow.lock() == _ftr_other;
} }
); );
if (ftr_it != feature_other_list_.end()) if (ftr_it != feature_other_list_.end())
return true; return true;
return false; return false;
} }
bool FactorBase::hasLandmarkOther(const LandmarkBasePtr &_lmk_other) bool FactorBase::hasLandmarkOther(const LandmarkBasePtr &_lmk_other) const
{ {
LandmarkBaseWPtrList::iterator lmk_it = find_if(landmark_other_list_.begin(), LandmarkBaseWConstIter lmk_it = find_if(landmark_other_list_.begin(),
landmark_other_list_.end(), landmark_other_list_.end(),
[_lmk_other](const LandmarkBaseWPtr &lmk_ow) [_lmk_other](const LandmarkBaseWPtr &lmk_ow)
{ {
return lmk_ow.lock() == _lmk_other; return lmk_ow.lock() == _lmk_other;
} }
); );
if (lmk_it != landmark_other_list_.end()) if (lmk_it != landmark_other_list_.end())
return true; return true;
......
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