Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce visp namespace to protect ViSP classes #1410

Merged
merged 70 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
796cfac
Start introduction of visp namespace
fspindle May 21, 2024
66eb0bb
[WIP] Put the to and from json in the global namespace
May 22, 2024
785de1f
[WIP] Added namespace in core/image
May 22, 2024
ada9e77
[WIP] Added namespace in vpMunkres
May 22, 2024
c6189b0
[CORE] visp_core compile in standalone using 'make visp_core' command
May 22, 2024
9edcb33
[TEST] In visp_core, use 'using namespace VISP_NAMESPACE_NAME;' in th…
May 22, 2024
024272d
[WIP] Worked on the detection module. There might be a problem with t…
May 22, 2024
10fc3d5
[WIP] visp_module io compiles
May 23, 2024
d2ca3ae
[WIP] Moved to_json from_json and operator<< of vpDetectorDNNOpenCV i…
May 23, 2024
d312bcf
[WIP] visp_gui compiles
May 23, 2024
d05362a
[WIP] visp_visual_features visp_me visp_tt visp_tt_mi visp_vision com…
May 23, 2024
ce67c68
[WIP] visp_blob compile
May 23, 2024
bb7d93c
[WIP] visp_klt compiles
May 23, 2024
c4079d8
[WIP] visp_vs compiles
May 23, 2024
d3b2501
[WIP] visp_ar compiles
May 23, 2024
b0563c2
[CORE] Moved back the operators in the visp workspace (see https://st…
May 27, 2024
ea80952
[FIX] Fixed compilation problem in vpDetectorDNN: from_json and to_js…
May 27, 2024
f54b7ee
[CLEAN] Fix a typo in vpCHT
May 27, 2024
b932429
[CORE] visp_mbt now compiles + [FIX] Fix some mistakes in core and tr…
May 27, 2024
07705aa
[CORE] visp_modules compiles when using ENABLE_VISP_NAMESPACE=ON
May 27, 2024
13186d6
[TEST][FIX] Fixed some missing using namespace in the tests
May 27, 2024
1a8469e
[FIX] Various fixes related to VISP_BUILD_DEPRECATED_FUNCTIONS
May 27, 2024
ffdf6fe
[WIP] With -DENABLE_VISP_NAMESPACE=OFF, visp_tutorials compiles, wit…
May 27, 2024
3fc3e54
[TUTO][FIX] Fixed forgotten tutorial/robot folder
May 27, 2024
3877225
[TUTO][WIP] Temporary fix for the compilation problem of tutorial/vis…
May 27, 2024
eb1e074
Merge branch 'master' into feat_visp_namespace
fspindle May 27, 2024
a004712
[TUTO][FIX] Fix to_json compilation error in tutorial-ibvs-4pts-json
May 28, 2024
79533c7
[CORE] Added the namespace macros in the demo folder
May 28, 2024
46a8096
[CORE] Added namespace macro in apps folder
May 28, 2024
9342302
[EXAMPLE] Addedf namespace macro in the example folder
May 28, 2024
010c8af
[FIX] Fix vpDisplay is an incomplete type
May 28, 2024
f7e4d2a
[CORE] Added a macro that replaces the #ifdef ENABLE_VISP_NAMESPACE n…
May 28, 2024
89feeb8
[FIX] Fix undefined symbol void swap(vpDetectorAprilTag &, vpDetector…
May 28, 2024
f98d63c
[CI] Pull latest stable version of VTK in ubuntu-dep-src CI
May 29, 2024
fa782ab
Fix cmake when mbt module disabled
fspindle May 30, 2024
c4a4090
[FIX] Create an empty namespace in vpConfig to ensure that 'using nam…
May 31, 2024
4017173
[FIX][CLEAN] Corrected some operators, clean some others and fix Hell…
May 31, 2024
f2cd27d
Add this tutorial as a doxygen example
fspindle May 31, 2024
14850e8
Mute warnings due to PCL and librealsense 3rd parties on macOS Sonoma…
fspindle May 31, 2024
63373bd
Fix misra C++ quality rules around old cast and remove useless limits…
fspindle Jun 4, 2024
264f9f8
[FIX] Forgot to include vpConfig
Jun 4, 2024
30eefc9
[CLEAN] Claened some files: reordered include, removed useless VISP_N…
Jun 4, 2024
14e5d4a
[FIX] Fixed wrongly placed END_VISP_NAMESPACE
Jun 4, 2024
90136e6
[FIX] Moved wrongly placed END_VISP_NAMESPACE + include forgotten vpC…
Jun 4, 2024
7e52eff
[CLEAN] Moved file description at the beginning of the file
Jun 4, 2024
8448332
Introduce new misra c++ quality fixes
fspindle Jun 4, 2024
567441d
[FIX] Fix compilation error on Linux due to cpu_x86_Linux.ipp
Jun 4, 2024
b92de50
[CORE] CMake option WITH_MINIZ permits to deactivate npz I/O function…
Jun 4, 2024
5c5f15a
[FIX] Added incldue of limits required for std::numeric_limits
Jun 4, 2024
af0db83
Fix namespace usage
fspindle Jun 5, 2024
d2feb5d
Improve WITH_MINIZ usage
fspindle Jun 5, 2024
7207004
[FIX] Fix cpuid for Windows
Jun 5, 2024
16a2b57
[FIX] Fix compilation error for windows
Jun 5, 2024
a2aba12
[CORE] Made vp an alias for visp namespace
Jun 5, 2024
186d0fa
[FIX] Added incldue of limits required for std::numeric_limits
Jun 4, 2024
0a1c681
[FIX][TUTO] Fixed compilation of apriltag tutorial
Jun 5, 2024
883785c
[FIX] Fix cpuid for Windows
Jun 5, 2024
cf97506
[FIX] Fix compilation error for windows
Jun 5, 2024
8cfa37e
Merge branch 'feat_visp_namespace' into feat_disable_miniz
Jun 6, 2024
c28e7eb
Fix to consider MSVC_VERSION=1940
fspindle Jun 6, 2024
7d63df1
Add missing quotes in cxx flags used to mute warnings
fspindle Jun 6, 2024
7fb0eb8
Fix uint usage in __cpuidex()
fspindle Jun 6, 2024
2d1d13d
Merge branch 'feat_visp_namespace' into feat_disable_miniz
fspindle Jun 6, 2024
076f306
Fix MSVC 1940 version detection
fspindle Jun 6, 2024
7c57604
Merge branch 'feat_visp_namespace' into feat_disable_miniz
fspindle Jun 6, 2024
f95b137
Fix build under windows when visp namespace enabled
fspindle Jun 7, 2024
b9b482d
[CLEAN] Removed space before */ in the headers to avoid wrong indenta…
Jun 10, 2024
7f25066
Workaround for github action issue when using std::mutex by removing …
fspindle Jun 10, 2024
b567f44
Merge pull request #3 from fspindle/feat_disable_miniz
fspindle Jun 10, 2024
fd63541
Merge pull request #4 from fspindle/fix_indent
fspindle Jun 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Prev Previous commit
Next Next commit
[CORE] Added a macro that replaces the #ifdef ENABLE_VISP_NAMESPACE n…
…amespace ...
  • Loading branch information
rlagneau committed May 28, 2024
commit f7e4d2ab3083a02df1b471cacfe6ae925110b66a
4 changes: 4 additions & 0 deletions cmake/templates/vpConfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,12 @@
#define VISP_NAMESPACE_NAME visp
#ifdef ENABLE_VISP_NAMESPACE
#define VISP_NAMESPACE_ADDRESSING visp::
#define BEGIN_VISP_NAMESPACE namespace visp {
#define END_VISP_NAMESPACE }
#else
#define VISP_NAMESPACE_ADDRESSING
#define BEGIN_VISP_NAMESPACE
#define END_VISP_NAMESPACE
#endif

// Enable debug and trace printings
Expand Down
9 changes: 2 additions & 7 deletions modules/ar/include/visp3/ar/vpAR.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,7 @@
#include <visp3/core/vpRGBa.h>
#include <visp3/core/vpTime.h>

#ifdef ENABLE_VISP_NAMESPACE
namespace VISP_NAMESPACE_NAME
{
#endif
BEGIN_VISP_NAMESPACE
/*!
\class vpAR

Expand Down Expand Up @@ -154,8 +151,6 @@ class VISP_EXPORT vpAR : public vpSimulator
void setImage(vpImage<unsigned char> &I);
void setImage(vpImage<vpRGBa> &I);
};
#ifdef ENABLE_VISP_NAMESPACE
}
#endif
END_VISP_NAMESPACE
#endif
#endif
9 changes: 2 additions & 7 deletions modules/ar/include/visp3/ar/vpAROgre.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,7 @@
#include <OIS.h>
#endif

#ifdef ENABLE_VISP_NAMESPACE
namespace VISP_NAMESPACE_NAME
{
#endif
BEGIN_VISP_NAMESPACE
/*!
\class vpAROgre

Expand Down Expand Up @@ -395,9 +392,7 @@ class VISP_EXPORT vpAROgre : public Ogre::FrameListener,
std::list<std::string> mOptionalResourceLocation; /** Optional resource location (used to
load mesh and material) */
};
#ifdef ENABLE_VISP_NAMESPACE
}
#endif
END_VISP_NAMESPACE
#endif // VISP_HAVE_OGRE

#endif
9 changes: 2 additions & 7 deletions modules/ar/include/visp3/ar/vpSimulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,7 @@
#include <visp3/core/vpImageConvert.h>
#include <visp3/core/vpRGBa.h>

#ifdef ENABLE_VISP_NAMESPACE
namespace VISP_NAMESPACE_NAME
{
#endif
BEGIN_VISP_NAMESPACE
/*!
\class vpSimulator

Expand Down Expand Up @@ -295,8 +292,6 @@ class VISP_EXPORT vpSimulator
//! get the intrinsic parameters of the camera
void getCameraParameters(vpCameraParameters &cam) { cam = internalCameraParameters; }
};
#ifdef ENABLE_VISP_NAMESPACE
}
#endif
END_VISP_NAMESPACE
#endif
#endif
9 changes: 2 additions & 7 deletions modules/ar/include/visp3/ar/vpSimulatorException.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@
#include <iostream> /* Classe std::ostream. */
#include <string> /* Classe string. */

#ifdef ENABLE_VISP_NAMESPACE
namespace VISP_NAMESPACE_NAME
{
#endif
BEGIN_VISP_NAMESPACE
/*!
* \class vpSimulatorException
* \brief Error that can be emitted by the vpSimulator class and its derivatives.
Expand Down Expand Up @@ -86,8 +83,6 @@ class VISP_EXPORT vpSimulatorException : public vpException
*/
explicit vpSimulatorException(int id);
};
#ifdef ENABLE_VISP_NAMESPACE
}
#endif
END_VISP_NAMESPACE
#endif
#endif
9 changes: 2 additions & 7 deletions modules/ar/include/visp3/ar/vpViewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,7 @@
#include <visp3/core/vpDebug.h>
#include <visp3/core/vpHomogeneousMatrix.h>

#ifdef ENABLE_VISP_NAMESPACE
namespace VISP_NAMESPACE_NAME
{
#endif
BEGIN_VISP_NAMESPACE
/*!
\class vpViewer
\ingroup group_ar_simulator
Expand Down Expand Up @@ -158,9 +155,7 @@ class VISP_EXPORT vpViewer : public SoXtExaminerViewer
static void exitMainLoop() { SoXt::exitMainLoop(); };
#endif
};
#ifdef ENABLE_VISP_NAMESPACE
}
#endif
END_VISP_NAMESPACE
#endif // VISP_HAVE_COIN3D_AND_GUI

#endif
9 changes: 2 additions & 7 deletions modules/ar/src/coin-simulator/vpAR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,7 @@
#include <Inventor/nodes/SoGroup.h> /* Groupement de noeuds (sans separation)*/
#include <Inventor/nodes/SoMaterial.h> /* Matiere (couleur) des objets. */

#ifdef ENABLE_VISP_NAMESPACE
namespace VISP_NAMESPACE_NAME
{
#endif
BEGIN_VISP_NAMESPACE
/*!
Basic Destructor that calls the kill() method of the vpSimulator
class.
Expand Down Expand Up @@ -152,9 +149,7 @@ void vpAR::setImage(vpImage<vpRGBa> &I)
}
}
}
#ifdef ENABLE_VISP_NAMESPACE
}
#endif
END_VISP_NAMESPACE
#elif !defined(VISP_BUILD_SHARED_LIBS)
// Work around to avoid warning: libvisp_ar.a(vpAR.cpp.o) has no symbols
void dummy_vpAR() { };
Expand Down
9 changes: 2 additions & 7 deletions modules/ar/src/coin-simulator/vpSimulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,7 @@
#include <Inventor/nodes/SoGroup.h> /* Groupement de noeuds (sans separation)*/
#include <Inventor/nodes/SoMaterial.h> /* Matiere (couleur) des objets. */

#ifdef ENABLE_VISP_NAMESPACE
namespace VISP_NAMESPACE_NAME
{
#endif
BEGIN_VISP_NAMESPACE
// Positions of all of the vertices:
//
static float pyramidVertexes[5][3] = { {0.33f, 0.33f, 0.f},
Expand Down Expand Up @@ -1006,9 +1003,7 @@ void vpSimulator::getInternalImage(vpImage<unsigned char> &I)
vpImageConvert::RGBToGrey(bufferView, I.bitmap, internal_width, internal_height, true);
get = 1;
}
#ifdef ENABLE_VISP_NAMESPACE
}
#endif
END_VISP_NAMESPACE
#elif !defined(VISP_BUILD_SHARED_LIBS)
// Work around to avoid warning: libvisp_ar.a(vpSimulator.cpp.o) has no symbols
void dummy_vpSimulator() { };
Expand Down
9 changes: 2 additions & 7 deletions modules/ar/src/coin-simulator/vpViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@
#include <Inventor/events/SoKeyboardEvent.h>
#include <Inventor/nodes/SoEventCallback.h>

#ifdef ENABLE_VISP_NAMESPACE
namespace VISP_NAMESPACE_NAME
{
#endif
BEGIN_VISP_NAMESPACE
#if defined(VISP_HAVE_SOWIN)
vpViewer::vpViewer(HWND parent, vpSimulator *_simu, vpViewerType type)
: SoWinExaminerViewer(parent, (char *)nullptr, false), viewerType(type), simu(_simu)
Expand Down Expand Up @@ -235,9 +232,7 @@ SbBool vpViewer::processSoEvent(const SoEvent *const event)
return SoXtExaminerViewer::processSoEvent(event);
#endif
}
#ifdef ENABLE_VISP_NAMESPACE
}
#endif
END_VISP_NAMESPACE
#elif !defined(VISP_BUILD_SHARED_LIBS)
// Work around to avoid warning: libvisp_ar.a(vpViewer.cpp.o) has no symbols
void dummy_vpViewer() { };
Expand Down
9 changes: 2 additions & 7 deletions modules/ar/src/ogre-simulator/vpAROgre.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@

#include <OgreRectangle2D.h>

#ifdef ENABLE_VISP_NAMESPACE
namespace VISP_NAMESPACE_NAME
{
#endif
BEGIN_VISP_NAMESPACE
/*!
Constructor.

Expand Down Expand Up @@ -1088,9 +1085,7 @@ void vpAROgre::getRenderingOutput(vpImage<vpRGBa> &I, const vpHomogeneousMatrix
// Unlock the pixel buffer
mPixelBuffer->unlock();
}
#ifdef ENABLE_VISP_NAMESPACE
}
#endif
END_VISP_NAMESPACE
#elif !defined(VISP_BUILD_SHARED_LIBS)
// Work around to avoid warning: libvisp_ar.a(vpAROgre.cpp.o) has no symbols
void dummy_vpAROgre() { };
Expand Down
9 changes: 2 additions & 7 deletions modules/ar/src/vpSimulatorException.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@
#include <visp3/ar/vpSimulatorException.h>

#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
#ifdef ENABLE_VISP_NAMESPACE
namespace VISP_NAMESPACE_NAME
{
#endif
BEGIN_VISP_NAMESPACE
vpSimulatorException::vpSimulatorException(int id, const char *format, ...)
{
this->code = id;
Expand All @@ -57,9 +54,7 @@ vpSimulatorException::vpSimulatorException(int id, const char *format, ...)
vpSimulatorException::vpSimulatorException(int id, const std::string &msg) : vpException(id, msg) { ; }

vpSimulatorException::vpSimulatorException(int id) : vpException(id) { ; }
#ifdef ENABLE_VISP_NAMESPACE
}
#endif
END_VISP_NAMESPACE
#elif !defined(VISP_BUILD_SHARED_LIBS)
// Work around to avoid warning: libvisp_ar.a(vpSimulatorException.cpp.o) has no symbols
void dummy_vpSimulatorException() { };
Expand Down
20 changes: 5 additions & 15 deletions modules/core/include/visp3/core/vpArray2D.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,15 @@
#include <visp3/core/vpConfig.h>
#include <visp3/core/vpException.h>

#if defined(ENABLE_VISP_NAMESPACE)
namespace VISP_NAMESPACE_NAME
{
#endif
BEGIN_VISP_NAMESPACE
template <typename T> class vpArray2D;
#if defined(ENABLE_VISP_NAMESPACE)
}
#endif
END_VISP_NAMESPACE

#ifdef VISP_HAVE_NLOHMANN_JSON
#include <nlohmann/json.hpp>
#endif

#if defined(ENABLE_VISP_NAMESPACE)
namespace VISP_NAMESPACE_NAME
{
#endif
BEGIN_VISP_NAMESPACE
/*!
* \class vpArray2D
* \ingroup group_core_matrices
Expand Down Expand Up @@ -1340,7 +1332,7 @@ template <class Type> bool vpArray2D<Type>::operator!=(const vpArray2D<Type> &A)
template <class Type>
inline void from_json(const nlohmann::json &j, VISP_NAMESPACE_ADDRESSING vpArray2D<Type> &array)
{
#if defined(ENABLE_VISP_NAMESPACE)
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
if (j.is_array()) {
Expand Down Expand Up @@ -1411,8 +1403,6 @@ inline void to_json(nlohmann::json &j, const VISP_NAMESPACE_ADDRESSING vpArray2D
}
#endif

#if defined(ENABLE_VISP_NAMESPACE)
}
#endif
END_VISP_NAMESPACE

#endif
9 changes: 2 additions & 7 deletions modules/core/include/visp3/core/vpBSpline.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,7 @@
#include <vector>
#include <visp3/core/vpMatrix.h>

#ifdef ENABLE_VISP_NAMESPACE
namespace VISP_NAMESPACE_NAME
{
#endif
BEGIN_VISP_NAMESPACE
#ifndef DOXYGEN_SHOULD_SKIP_THIS

/*!
Expand Down Expand Up @@ -238,7 +235,5 @@ public /*protected*/:
const std::vector<double> &l_knots, const std::vector<vpImagePoint> &l_controlPoints);
vpImagePoint *computeCurveDers(double u, unsigned int der) const;
};
#ifdef ENABLE_VISP_NAMESPACE
}
#endif
END_VISP_NAMESPACE
#endif
9 changes: 2 additions & 7 deletions modules/core/include/visp3/core/vpCPUFeatures.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@

#include <visp3/core/vpConfig.h>

#if defined(ENABLE_VISP_NAMESPACE)
namespace VISP_NAMESPACE_NAME
{
#endif
BEGIN_VISP_NAMESPACE
/*!
\ingroup group_core_cpu_features
\brief Check CPU features (hardware capabilities).
Expand Down Expand Up @@ -81,7 +78,5 @@ VISP_EXPORT size_t getCPUCacheL3();
#endif
VISP_EXPORT void printCPUInfo();
} // namespace vpCPUFeatures
#if defined(ENABLE_VISP_NAMESPACE)
}
#endif
END_VISP_NAMESPACE
#endif
9 changes: 2 additions & 7 deletions modules/core/include/visp3/core/vpCameraParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,7 @@
#include<nlohmann/json.hpp>
#endif

#if defined(ENABLE_VISP_NAMESPACE)
namespace VISP_NAMESPACE_NAME
{
#endif
BEGIN_VISP_NAMESPACE
/*!
\class vpCameraParameters

Expand Down Expand Up @@ -550,7 +547,5 @@ inline void from_json(const nlohmann::json &j, vpCameraParameters &cam)
}
}
#endif
#if defined(ENABLE_VISP_NAMESPACE)
}
#endif
END_VISP_NAMESPACE
#endif
9 changes: 2 additions & 7 deletions modules/core/include/visp3/core/vpCannyEdgeDetection.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,7 @@
#include <nlohmann/json.hpp>
#endif

#if defined(ENABLE_VISP_NAMESPACE)
namespace VISP_NAMESPACE_NAME
{
#endif
BEGIN_VISP_NAMESPACE
/**
* \brief Class that implements the Canny's edge detector.
* It is possible to use a boolean mask to ignore some pixels of
Expand Down Expand Up @@ -367,7 +364,5 @@ class VISP_EXPORT vpCannyEdgeDetection
void performEdgeTracking();
//@}
};
#if defined(ENABLE_VISP_NAMESPACE)
}
#endif
END_VISP_NAMESPACE
#endif
9 changes: 2 additions & 7 deletions modules/core/include/visp3/core/vpCircle.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@
#include <visp3/core/vpHomogeneousMatrix.h>
#include <visp3/core/vpMath.h>

#if defined(ENABLE_VISP_NAMESPACE)
namespace VISP_NAMESPACE_NAME
{
#endif
BEGIN_VISP_NAMESPACE
/*!
* \class vpCircle
* \ingroup group_core_geometry
Expand Down Expand Up @@ -170,7 +167,5 @@ class VISP_EXPORT vpCircle : public vpForwardProjection
protected:
void init() vp_override;
};
#if defined(ENABLE_VISP_NAMESPACE)
}
#endif
END_VISP_NAMESPACE
#endif
Loading
Loading