Skip to content

Commit

Permalink
Fix build when visp namespace is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
fspindle committed Nov 7, 2024
1 parent ebcfcae commit 9c13688
Show file tree
Hide file tree
Showing 18 changed files with 62 additions and 38 deletions.
3 changes: 2 additions & 1 deletion modules/ar/include/visp3/ar/vpPanda3DPostProcessFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@
#include "cardMaker.h"
#include "orthographicLens.h"

BEGIN_VISP_NAMESPACE

class vpRGBf;
template <class Type> class vpImage;

BEGIN_VISP_NAMESPACE
/**
* \ingroup group_ar_renderer_panda3d_filters
* \brief Base class for postprocessing filters that map the result of a vpPanda3DBaseRenderer to a new image.
Expand Down
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: 3 additions & 1 deletion modules/core/include/visp3/core/vpCannyEdgeDetection.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
#include <visp3/core/vpImagePoint.h>
#include <visp3/core/vpImage_operators.h>

class vpRGBa;
#ifdef HAVE_OPENCV_CORE
namespace cv { class Mat; }
#endif
Expand All @@ -62,6 +61,9 @@ namespace cv { class Mat; }
#endif

BEGIN_VISP_NAMESPACE

class vpRGBa;

/**
* \brief Class that implements the Canny's edge detector.
* It is possible to use a boolean mask to ignore some pixels of
Expand Down
7 changes: 4 additions & 3 deletions modules/core/include/visp3/core/vpColormap.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,17 @@
* \brief Colormap tool to have a mapping between 256 values and RGB values.
*/

#ifndef _vpColormap_h_
#define _vpColormap_h_
#ifndef VP_COLORMAP_H
#define VP_COLORMAP_H

#include <visp3/core/vpConfig.h>

BEGIN_VISP_NAMESPACE

class vpRGBa;
class vpRGBf;
template <class Type> class vpImage;

BEGIN_VISP_NAMESPACE
/*!
* \class vpColormap
*
Expand Down
3 changes: 2 additions & 1 deletion modules/core/include/visp3/core/vpFont.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@
#include <visp3/core/vpColor.h>
#include <visp3/core/vpImagePoint.h>

BEGIN_VISP_NAMESPACE

class vpColor;
class vpRGBa;
template <class Type> class vpImage;

BEGIN_VISP_NAMESPACE
/*!
\class vpFont
Expand Down
3 changes: 2 additions & 1 deletion modules/core/include/visp3/core/vpFrameGrabber.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@

#include <visp3/core/vpConfig.h>

BEGIN_VISP_NAMESPACE

class vpRGBa;
template <class Type> class vpImage;

BEGIN_VISP_NAMESPACE
/*!
* \class vpFrameGrabber
*
Expand Down
3 changes: 2 additions & 1 deletion modules/core/include/visp3/core/vpImageCircle.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@
#include <opencv2/core/matx.hpp> // for Vec3f
#endif

BEGIN_VISP_NAMESPACE

template <class Type> class vpImage;

BEGIN_VISP_NAMESPACE
/**
* \brief Class that defines a 2D circle in an image.
*/
Expand Down
5 changes: 2 additions & 3 deletions modules/core/include/visp3/core/vpMomentArea.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,14 @@
* Description:
* Just the area m00 = mu00
*/
#ifndef _vpMomentArea_h_
#define _vpMomentArea_h_
#ifndef VP_MOMENT_AREA_H
#define VP_MOMENT_AREA_H

#include <visp3/core/vpConfig.h>
#include <visp3/core/vpMoment.h>

BEGIN_VISP_NAMESPACE
class vpMomentObject;
class vpMomentCentered; // Required for discrete case of vpMomentObject

/*!
* \class vpMomentArea
Expand Down
24 changes: 12 additions & 12 deletions modules/core/include/visp3/core/vpMomentCentered.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
\brief Centered moment descriptor (also referred as \f$\mu_{ij}\f$).
*/

#ifndef _vpMomentCentered_h_
#define _vpMomentCentered_h_
#ifndef VP_MOMENT_CENTERED_H
#define VP_MOMENT_CENTERED_H

#include <visp3/core/vpConfig.h>
#include <visp3/core/vpMoment.h>
Expand Down Expand Up @@ -97,35 +97,35 @@ class VISP_EXPORT vpMomentCentered : public vpMoment

/*!
Returns all centered moment values \f$\mu_{ij}\f$ with \f$i+j \leq order\f$
where order is the object's order.
where order is the object's order.
\return Vector of moment values. To access \f$\mu_{ij}\f$, you have to read
vpMomentObject::get()[j*order+i].
vpMomentObject::get()[j*order+i].
For example, if the maximal order is 3, the following values are provided:
\code
u00 u10 u20 u01 u11 u21 u02 u12 u12 u30 u03
u00 u10 u20 u01 u11 u21 u02 u12 u12 u30 u03
\endcode
To have a better reading of the moments you can picture them as a triangular
matrix:
\code
u00 u10 u20 u30 u01 u11 u21 x u02 u12 x x u30 x x x
u00 u10 u20 u30 u01 u11 u21 x u02 u12 x x u30 x x x
\endcode
The moments of the same order are on each of the matrix reverse diagonals.
To access for example to the centered moment \f$\mu_{12}\f$, you should use
this kind of code:
\code
vpMomentCentered mc;
//[...]
mc.compute();
double mu12;
mu12 = mc.get()[2*(obj.getOrder()+1)+1]; // i=1 and j=2
mu12 = mc.get(1,2); // the same
vpMomentCentered mc;
//[...]
mc.compute();
double mu12;
mu12 = mc.get()[2*(obj.getOrder()+1)+1]; // i=1 and j=2
mu12 = mc.get(1,2); // the same
\endcode
*/
inline const std::vector<double> &vpMomentCentered::get() const { return vpMoment::get(); }
Expand Down
3 changes: 2 additions & 1 deletion modules/core/include/visp3/core/vpUnscentedKalman.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@
#include <visp3/core/vpMatrix.h> // for vpMatrix
#include <visp3/core/vpException.h> // for vpException

BEGIN_VISP_NAMESPACE

class vpUKSigmaDrawerAbstract;

BEGIN_VISP_NAMESPACE
/*!
\class vpUnscentedKalman
\ingroup group_core_kalman
Expand Down
3 changes: 2 additions & 1 deletion modules/core/src/display/vpDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@
#include <visp3/core/vpImageConvert.h> // for vpImageConvert
#include <visp3/core/vpImage_operators.h> // for vpImage::operator=

BEGIN_VISP_NAMESPACE

class vpRGBa;

BEGIN_VISP_NAMESPACE
/*!
Default constructor.
*/
Expand Down
16 changes: 8 additions & 8 deletions modules/core/src/display/vpDisplay_rgba.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,21 @@
#include <visp3/core/vpImagePoint.h>
#include <visp3/core/vpMouseButton.h>

class vpCameraParameters;
class vpColor;
class vpHomogeneousMatrix;
class vpPolygon;
class vpRGBa;
class vpRect;


#include "vpDisplay_impl.h"

//************************************************************************
// Modifications done in this file should be reported in all vpDisplay_*.cpp
// files that implement other types (unsigned char, vpRGB, vpRGBa)
//************************************************************************
BEGIN_VISP_NAMESPACE

class vpCameraParameters;
class vpColor;
class vpHomogeneousMatrix;
class vpPolygon;
class vpRGBa;
class vpRect;

/*!
Close the display attached to I.
*/
Expand Down
5 changes: 3 additions & 2 deletions modules/core/src/image/vpCannyEdgeDetection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ namespace cv { class Mat; }
#endif
#endif

class vpRGBa;

#ifdef VISP_USE_MSVC
#pragma comment(linker, "/STACK:65532000") // Increase max recursion depth
#endif
Expand Down Expand Up @@ -95,6 +93,9 @@ static void scaleFilter(
#endif

BEGIN_VISP_NAMESPACE

class vpRGBa;

#ifdef VISP_HAVE_NLOHMANN_JSON
void from_json(const nlohmann::json &j, vpCannyEdgeDetection &detector)
{
Expand Down
3 changes: 2 additions & 1 deletion modules/core/src/tracking/forward-projection/vpCircle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@
#include <visp3/core/vpMath.h> // for vpMath
#include <visp3/core/vpColVector.h> // for vpColVector

BEGIN_VISP_NAMESPACE

class vpColor;
class vpRGBa;
template <class Type> class vpImage;

BEGIN_VISP_NAMESPACE
void vpCircle::init()
{
oP.resize(7);
Expand Down
3 changes: 2 additions & 1 deletion modules/core/src/tracking/forward-projection/vpCylinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@
#include <visp3/core/vpHomogeneousMatrix.h> // for vpHomogeneousMatrix
#include <visp3/core/vpColVector.h> // for vpColVector

BEGIN_VISP_NAMESPACE

class vpCameraParameters;
class vpColor;
class vpRGBa;
template <class Type> class vpImage;

BEGIN_VISP_NAMESPACE
void vpCylinder::init()
{
oP.resize(7);
Expand Down
4 changes: 4 additions & 0 deletions modules/io/src/image/vpImageIo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,14 @@
#include <opencv2/opencv_modules.hpp> // for HAVE_OPENCV_IMGCODECS, HAVE...
#endif

BEGIN_VISP_NAMESPACE

class vpRGBa;
class vpRGBf;
template <class Type> class vpImage;

END_VISP_NAMESPACE

#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#include <visp3/core/vpMomentCentered.h> // for vpMomentCent...
#include <visp3/core/vpMomentGravityCenter.h> // for vpMomentGrav...
#include <visp3/core/vpMomentObject.h> // for vpMomentObject
#include <visp3/visual_features/vpFeatureMomentAlpha.h> // for vpFeatureMom...
#include <visp3/core/vpArray2D.h> // for vpArray2D
#include <visp3/core/vpColVector.h> // for vpColVector
#include <visp3/core/vpConfig.h> // for BEGIN_VISP_N...
Expand All @@ -47,6 +46,12 @@
#include <visp3/core/vpMoment.h> // for vpMoment
#include <visp3/core/vpMomentDatabase.h> // for vpMomentData...
#include <visp3/visual_features/vpBasicFeature.h> // for vpBasicFeature
#include <visp3/visual_features/vpFeatureMomentAlpha.h> // for vpFeatureMom...

#ifdef VISP_MOMENTS_COMBINE_MATRICES
#include <visp3/visual_features/vpFeatureMomentCentered.h> // for vpFeatureMom...
#include <visp3/visual_features/vpFeatureMomentDatabase.h> // for vpFeatureMom...
#endif

BEGIN_VISP_NAMESPACE
#ifdef VISP_MOMENTS_COMBINE_MATRICES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
#include <visp3/core/vpMomentObject.h> // for vpMomentO...
#include <visp3/visual_features/vpFeatureMomentBasic.h> // for vpFeature...
#include <visp3/visual_features/vpFeatureMomentCentered.h> // for vpFeature...
#include <visp3/visual_features/vpFeatureMomentGravityCenter.h> // for vpFeature...
#include <visp3/visual_features/vpFeatureMomentDatabase.h> // for vpFeature...
#include <visp3/core/vpArray2D.h> // for vpArray2D
#include <visp3/core/vpException.h> // for vpException
#include <visp3/core/vpMath.h> // for vpMath
Expand Down

0 comments on commit 9c13688

Please sign in to comment.