Skip to content

Commit

Permalink
Make vpPoseFeature available only if c++ standard >= c++11
Browse files Browse the repository at this point in the history
  • Loading branch information
fspindle committed Mar 18, 2024
1 parent 14b9fdc commit e480bc2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
9 changes: 1 addition & 8 deletions modules/vision/include/visp3/vision/vpPoseFeatures.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

#include <visp3/core/vpConfig.h>

#ifdef VISP_HAVE_MODULE_VISUAL_FEATURES
#if defined(VISP_HAVE_MODULE_VISUAL_FEATURES) && (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)

#include <visp3/core/vpCircle.h>
#include <visp3/core/vpCylinder.h>
Expand All @@ -60,8 +60,6 @@

#include <iostream>
#include <vector>

#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
#include <tuple>

#ifndef DOXYGEN_SHOULD_SKIP_THIS
Expand Down Expand Up @@ -384,7 +382,6 @@ class vpPoseSpecificFeatureTemplateObject : public vpPoseSpecificFeature
}
};
#endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
#endif // (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)

/*!
* \class vpPoseFeatures
Expand Down Expand Up @@ -494,7 +491,6 @@ class VISP_EXPORT vpPoseFeatures
*/
void addFeatureSegment(vpPoint &, vpPoint &);

#if ((__cplusplus >= 201103L) || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201103L))) // Check if cxx11 or higher
/*!
* Add a specific feature for the pose computation.
*/
Expand All @@ -506,7 +502,6 @@ class VISP_EXPORT vpPoseFeatures
*/
template <typename ObjType, typename RetType, typename... ArgsFunc, typename... Args>
void addSpecificFeature(ObjType *obj, RetType(ObjType:: *fct_ptr)(ArgsFunc...), Args &&...args);
#endif

/*!
* Clear all the features
Expand Down Expand Up @@ -666,7 +661,6 @@ class VISP_EXPORT vpPoseFeatures
void computePoseRobustVVS(vpHomogeneousMatrix &cMo);
};

#if ((__cplusplus >= 201103L) || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201103L))) // Check if cxx11 or higher
/*!
* Add a specific feature for the pose computation.
*
Expand Down Expand Up @@ -813,6 +807,5 @@ void vpPoseFeatures::addSpecificFeature(ObjType *obj, RetType(ObjType:: *fct_ptr
m_maxSize = static_cast<unsigned int>(m_featureSpecific_list.size());
}
#endif
#endif //#ifdef VISP_HAVE_MODULE_VISUAL_FEATURES

#endif
12 changes: 5 additions & 7 deletions modules/vision/src/pose-estimation/vpPoseFeatures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*/
#include <visp3/vision/vpPoseFeatures.h>

#ifdef VISP_HAVE_MODULE_VISUAL_FEATURES
#if defined(VISP_HAVE_MODULE_VISUAL_FEATURES) && (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)

vpPoseFeatures::vpPoseFeatures()
: m_maxSize(0), m_totalSize(0), m_vvsIterMax(200), m_lambda(1.0), m_verbose(false), m_computeCovariance(false),
Expand Down Expand Up @@ -81,11 +81,9 @@ void vpPoseFeatures::clear()
delete m_featureSegment_DuoPoints_list[(unsigned int)i].desiredFeature;
m_featureSegment_DuoPoints_list.clear();

#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
for (int i = (int)m_featureSpecific_list.size() - 1; i >= 0; i--)
delete m_featureSpecific_list[(unsigned int)i];
m_featureSpecific_list.clear();
#endif

m_maxSize = 0;
m_totalSize = 0;
Expand Down Expand Up @@ -305,14 +303,12 @@ void vpPoseFeatures::error_and_interaction(vpHomogeneousMatrix &cMo, vpColVector
L.stack(fs.interaction());
}

#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
//--------------Specific Feature--------------
if (i < m_featureSpecific_list.size()) {
m_featureSpecific_list[i]->createCurrent(cMo);
err.stack(m_featureSpecific_list[i]->error());
L.stack(m_featureSpecific_list[i]->currentInteraction());
}
#endif
}
}

Expand Down Expand Up @@ -466,5 +462,7 @@ void vpPoseFeatures::computePoseRobustVVS(vpHomogeneousMatrix &cMo)
throw;
}
}

#endif //#ifdef VISP_HAVE_MODULE_VISUAL_FEATURES
#elif !defined(VISP_BUILD_SHARED_LIBS)
// Work around to avoid warning: libvisp_vision.a(vpPoseFeatures.cpp.o) has no symbols
void dummy_vpPoseFeatures() { };
#endif

0 comments on commit e480bc2

Please sign in to comment.