Skip to content

Commit

Permalink
Add namespace guards so that compiling with namespace is supported
Browse files Browse the repository at this point in the history
  • Loading branch information
SamFlt committed Sep 19, 2024
1 parent 90e288f commit 61856bf
Show file tree
Hide file tree
Showing 45 changed files with 195 additions and 73 deletions.
2 changes: 2 additions & 0 deletions modules/ar/src/panda3d-simulator/vpPanda3DRendererSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ void vpPanda3DRendererSet::enableSharedDepthBuffer(vpPanda3DBaseRenderer &source
}
}

END_VISP_NAMESPACE

#elif !defined(VISP_BUILD_SHARED_LIBS)
// Work around to avoid warning: libvisp_ar.a(vpPanda3DRendererSet.cpp.o) has no symbols
void dummy_vpPanda3DRendererSet() { };
Expand Down
4 changes: 4 additions & 0 deletions modules/tracker/rbt/include/visp3/rbt/vpColorHistogram.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
#include <vector>



BEGIN_VISP_NAMESPACE

template<typename T>
class vpImage;

Expand Down Expand Up @@ -108,6 +111,7 @@ class VISP_EXPORT vpColorHistogram
std::vector<float> m_probas;
unsigned int m_numPixels;
};
END_VISP_NAMESPACE



Expand Down
8 changes: 4 additions & 4 deletions modules/tracker/rbt/include/visp3/rbt/vpColorHistogramMask.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,14 @@
#include <nlohmann/json_fwd.hpp>
#endif


BEGIN_VISP_NAMESPACE

class vpRBFeatureTrackerInput;

/**
* \brief A color histogram based segmentation algorithm.
*
* \ingroup group_rbt_mask
*/
*/
class VISP_EXPORT vpColorHistogramMask : public vpObjectMask
{
public:
Expand Down Expand Up @@ -113,8 +112,8 @@ class VISP_EXPORT vpColorHistogramMask : public vpObjectMask
void loadJsonConfiguration(const nlohmann::json &json) VP_OVERRIDE;
#endif


private:

vpColorHistogram m_histObject, m_histBackground, m_histObjectFrame, m_histBackgroundFrame;
float m_depthErrorTolerance;
float m_objectUpdateRate, m_backgroundUpdateRate;
Expand All @@ -124,5 +123,6 @@ class VISP_EXPORT vpColorHistogramMask : public vpObjectMask

};

END_VISP_NAMESPACE

#endif
2 changes: 2 additions & 0 deletions modules/tracker/rbt/include/visp3/rbt/vpDynamicFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#include <map>
#include <functional>

BEGIN_VISP_NAMESPACE
template<typename T>
class VISP_EXPORT vpDynamicFactory
{
Expand Down Expand Up @@ -89,5 +90,6 @@ class VISP_EXPORT vpDynamicFactory
#endif

};
END_VISP_NAMESPACE

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@
#include <visp3/ar/vpPanda3DRendererSet.h>
#include <visp3/core/vpRect.h>

/*!
BEGIN_VISP_NAMESPACE

/*!
\brief Single object focused renderer
\ingroup group_rbt_rendering
*/
Expand Down Expand Up @@ -119,6 +120,6 @@ class VISP_EXPORT vpObjectCentricRenderer : public vpPanda3DRendererSet
vpPanda3DRenderParameters m_subRenderParams;

};

END_VISP_NAMESPACE
#endif
#endif
14 changes: 9 additions & 5 deletions modules/tracker/rbt/include/visp3/rbt/vpObjectMask.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,23 @@

#include <visp3/core/vpConfig.h>

template <typename T>
class vpImage;

class vpRBFeatureTrackerInput;

#if defined(VISP_HAVE_NLOHMANN_JSON)
#include <nlohmann/json_fwd.hpp>
#endif

BEGIN_VISP_NAMESPACE

template <typename T>
class vpImage;

class vpRBFeatureTrackerInput;

/**
* \brief
*
* \ingroup group_rbt_mask
*/
*/
class VISP_EXPORT vpObjectMask
{
public:
Expand All @@ -68,6 +71,7 @@ class VISP_EXPORT vpObjectMask


};
END_VISP_NAMESPACE


#endif
11 changes: 6 additions & 5 deletions modules/tracker/rbt/include/visp3/rbt/vpObjectMaskFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@
#include <visp3/rbt/vpDynamicFactory.h>
#include <visp3/rbt/vpObjectMask.h>

BEGIN_VISP_NAMESPACE
/**
* \brief A factory that can be used to create Object segmentation algorithms from JSON data.
*
* \ingroup group_rbt_mask
*
*/
*\brief A factory that can be used to create Object segmentation algorithms from JSON data.
*
*\ingroup group_rbt_mask
*/
class VISP_EXPORT vpObjectMaskFactory : public vpDynamicFactory<vpObjectMask>
{
private:
Expand All @@ -59,5 +59,6 @@ class VISP_EXPORT vpObjectMaskFactory : public vpDynamicFactory<vpObjectMask>
return factory;
}
};
END_VISP_NAMESPACE

#endif
5 changes: 3 additions & 2 deletions modules/tracker/rbt/include/visp3/rbt/vpPanda3DDepthFilters.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@
#include <visp3/core/vpRect.h>
#include <visp3/ar/vpPanda3DPostProcessFilter.h>

BEGIN_VISP_NAMESPACE
/**
*
* \ingroup group_rbt_rendering
* \brief
*/
*/
class VISP_EXPORT vpPanda3DDepthGaussianBlur : public vpPanda3DPostProcessFilter
{
public:
Expand Down Expand Up @@ -87,7 +88,7 @@ class VISP_EXPORT vpPanda3DDepthCannyFilter : public vpPanda3DPostProcessFilter
static const char *FRAGMENT_SHADER;
float m_edgeThreshold;
};

END_VISP_NAMESPACE

#endif
#endif
9 changes: 3 additions & 6 deletions modules/tracker/rbt/include/visp3/rbt/vpRBDenseDepthTracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@
#include <nlohmann/json.hpp>
#endif


BEGIN_VISP_NAMESPACE
/**
* @brief A tracker based on dense depth point-plane alignement
*
* \ingroup group_rbt_trackers
*
*/
*/
class VISP_EXPORT vpRBDenseDepthTracker : public vpRBFeatureTracker
{
public:
Expand Down Expand Up @@ -162,9 +162,6 @@ class VISP_EXPORT vpRBDenseDepthTracker : public vpRBFeatureTracker


};




END_VISP_NAMESPACE

#endif
8 changes: 6 additions & 2 deletions modules/tracker/rbt/include/visp3/rbt/vpRBDriftDetector.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@
#include <nlohmann/json_fwd.hpp>
#endif


BEGIN_VISP_NAMESPACE

class vpRBFeatureTrackerInput;
class vpHomogeneousMatrix;
class vpRGBa;
template <typename T> class vpImage;


/**
* \brief Base interface for algorithms that should detect tracking drift for the render-based tracker.
*
Expand All @@ -58,7 +60,7 @@ template <typename T> class vpImage;
* - use vpRBDriftDetector::hasDiverged to detect the drift, or vpRBDriftDetector::getScore to use the estimated tracking reliability.
*
* \ingroup group_rbt_drift
*/
*/
class VISP_EXPORT vpRBDriftDetector
{
public:
Expand Down Expand Up @@ -105,4 +107,6 @@ class VISP_EXPORT vpRBDriftDetector

};

END_VISP_NAMESPACE

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@
#include <visp3/rbt/vpDynamicFactory.h>
#include <visp3/rbt/vpRBDriftDetector.h>

BEGIN_VISP_NAMESPACE

/**
* \brief A factory that can be used to instanciate drift detection algorithms from JSON data.
*
* \ingroup group_rbt_drift
*/
*/
class VISP_EXPORT vpRBDriftDetectorFactory : public vpDynamicFactory<vpRBDriftDetector>
{
private:
Expand All @@ -58,8 +60,5 @@ class VISP_EXPORT vpRBDriftDetectorFactory : public vpDynamicFactory<vpRBDriftDe
return factory;
}
};




END_VISP_NAMESPACE
#endif
7 changes: 3 additions & 4 deletions modules/tracker/rbt/include/visp3/rbt/vpRBFeatureTracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ enum vpRBFeatureDisplayType
ERROR = 2
};


BEGIN_VISP_NAMESPACE
/**
* \brief A base class for all features that can be used and tracked in the vpRBTracker
*
* \ingroup group_rbt_trackers
*/
*/
class VISP_EXPORT vpRBFeatureTracker
{
public:
Expand Down Expand Up @@ -228,7 +228,6 @@ class VISP_EXPORT vpRBFeatureTracker
bool m_vvsConverged; //! Whether VVS has converged, should be updated every VVS iteration

};


END_VISP_NAMESPACE

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@
#include <visp3/rbt/vpRBFeatureTracker.h>
#include <visp3/rbt/vpDynamicFactory.h>

BEGIN_VISP_NAMESPACE
/**
* \brief A factory to instantiate feature trackers from JSON data
*
* \ingroup group_rbt_trackers
*/
*/
class VISP_EXPORT vpRBFeatureTrackerFactory : public vpDynamicFactory<vpRBFeatureTracker>
{
private:
Expand All @@ -58,5 +59,5 @@ class VISP_EXPORT vpRBFeatureTrackerFactory : public vpDynamicFactory<vpRBFeatur
return factory;
}
};

END_VISP_NAMESPACE
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,14 @@

#include <visp3/rbt/vpRBSilhouettePoint.h>

BEGIN_VISP_NAMESPACE


/**
* \brief Render data storage
*
* \ingroup group_rbt_core
*/
*/
struct VISP_EXPORT vpRBRenderData
{
vpImage<vpRGBf> normals; //! Image containing the per-pixel normal vector (RGB, in object space)
Expand Down Expand Up @@ -153,4 +156,6 @@ class VISP_EXPORT vpRBFeatureTrackerInput
*this = std::move(other);
}
};

END_VISP_NAMESPACE
#endif
11 changes: 5 additions & 6 deletions modules/tracker/rbt/include/visp3/rbt/vpRBInitializationHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@
#include <string>
#include <iostream>


BEGIN_VISP_NAMESPACE
template <typename T>
class vpImage;


/**
* \brief A set of utilities to perform initialization.
*
* \group core
*/
* \ingroup group_rbt_core
*/
class VISP_EXPORT vpRBInitializationHelper
{
public:
Expand All @@ -39,7 +40,5 @@ class VISP_EXPORT vpRBInitializationHelper
vpHomogeneousMatrix m_cMo;
vpCameraParameters m_cam;
};



END_VISP_NAMESPACE
#endif
7 changes: 6 additions & 1 deletion modules/tracker/rbt/include/visp3/rbt/vpRBKltTracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,14 @@

#include <opencv2/core/mat.hpp>


BEGIN_VISP_NAMESPACE

/**
* \brief KLT-Based features
*
* \ingroup group_rbt_trackers
*/
*/
class VISP_EXPORT vpRBKltTracker : public vpRBFeatureTracker
{
public:
Expand Down Expand Up @@ -266,5 +269,7 @@ class VISP_EXPORT vpRBKltTracker : public vpRBFeatureTracker
float m_minMaskConfidence;

};

END_VISP_NAMESPACE
#endif
#endif
Loading

0 comments on commit 61856bf

Please sign in to comment.