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 all commits
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
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu-dep-src.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
pwd
echo "GIT_CLONE_PROTECTION_ACTIVE=false" >> $GITHUB_ENV
export GIT_CLONE_PROTECTION_ACTIVE=false
git clone --recursive --depth 1 https://github.com/Kitware/VTK.git ${HOME}/VTK
git clone --recursive --depth 1 --branch v9.3.0 https://github.com/Kitware/VTK.git ${HOME}/VTK
cd ${HOME}/VTK
mkdir build && cd build && mkdir install
cmake .. -DVTK_ANDROID_BUILD=OFF -DVTK_BUILD_DOCUMENTATION=OFF -DVTK_BUILD_EXAMPLES=OFF -DVTK_BUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Release \
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,5 @@
"editor.rulers": [
{"column": 120, "color": "#ffcc00"}
],
"C_Cpp.default.compilerPath": "/usr/bin/g++",
}
25 changes: 16 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,9 @@ VP_OPTION(ENABLE_MOMENTS_COMBINE_MATRICES "" "" "Use linear combination of matr
VP_OPTION(ENABLE_TEST_WITHOUT_DISPLAY "" "" "Don't use display feature when testing" "" ON)
VP_OPTION(ENABLE_FULL_DOC "" "" "Build doc with internal classes that are by default not part of the doc" "" OFF)

# Allow introduction of "visp" namespace. By default disabled to keep compat with previous versions
VP_OPTION(ENABLE_VISP_NAMESPACE "" "" "Enable visp namespace" "" OFF)

if(ENABLE_SOLUTION_FOLDERS)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMakeTargets")
Expand Down Expand Up @@ -777,17 +780,18 @@ endif()
# ----------------------------------------------------------------------------
# Build-in 3rd parties. Should be after c++ standard potential modification
# ----------------------------------------------------------------------------
VP_OPTION(WITH_PTHREAD "" "" "Build pthread as built-in library" "" ON IF (WIN32 OR MINGW) AND (NOT WINRT))
VP_OPTION(WITH_PTHREAD "" "" "Use pthread as built-in library" "" ON IF (WIN32 OR MINGW) AND (NOT WINRT))
# Since C99 is not supported by MSVC 2010 or prior, we disable apriltag if MSVC < 2012
VP_OPTION(WITH_APRILTAG "" "" "Build AprilTag as built-in library" "" ON IF (USE_THREADS OR USE_PTHREAD OR WITH_PTHREAD) AND (NOT WINRT) AND (NOT MSVC_VERSION LESS 1700))
VP_OPTION(WITH_APRILTAG_BIG_FAMILY "" "" "Build AprilTag big family (41h12, 48h12, 49h12, 52h13)" "" OFF IF WITH_APRILTAG)
VP_OPTION(WITH_ATIDAQ "" "" "Build atidaq-c as built-in library" "" ON IF USE_COMEDI AND NOT WINRT)
VP_OPTION(WITH_CLIPPER "" "" "Build clipper as built-in library" "" ON IF USE_OPENCV)
VP_OPTION(WITH_LAPACK "" "" "Build lapack as built-in library" "" ON IF NOT USE_LAPACK)
VP_OPTION(WITH_QBDEVICE "" "" "Build qbdevice-api as built-in library" "" ON IF (NOT WINRT) AND (NOT IOS))
VP_OPTION(WITH_TAKKTILE2 "" "" "Build Right Hand takktile2 driver as built-in library" "" ON IF (NOT WIN32) AND (NOT WINRT) AND (NOT IOS) AND (NOT ANDROID))
VP_OPTION(WITH_APRILTAG "" "" "Use AprilTag as built-in library" "" ON IF (USE_THREADS OR USE_PTHREAD OR WITH_PTHREAD) AND (NOT WINRT) AND (NOT MSVC_VERSION LESS 1700))
VP_OPTION(WITH_APRILTAG_BIG_FAMILY "" "" "Use AprilTag big family (41h12, 48h12, 49h12, 52h13)" "" OFF IF WITH_APRILTAG)
VP_OPTION(WITH_MINIZ "" "" "Use npz related I/O as built-in functions" "" ON)
VP_OPTION(WITH_ATIDAQ "" "" "Use atidaq-c as built-in library" "" ON IF USE_COMEDI AND NOT WINRT)
VP_OPTION(WITH_CLIPPER "" "" "Use clipper as built-in library" "" ON IF USE_OPENCV)
VP_OPTION(WITH_LAPACK "" "" "Use lapack as built-in library" "" ON IF NOT USE_LAPACK)
VP_OPTION(WITH_QBDEVICE "" "" "Use qbdevice-api as built-in library" "" ON IF (NOT WINRT) AND (NOT IOS))
VP_OPTION(WITH_TAKKTILE2 "" "" "Use Right Hand takktile2 driver as built-in library" "" ON IF (NOT WIN32) AND (NOT WINRT) AND (NOT IOS) AND (NOT ANDROID))
VP_OPTION(WITH_CATCH2 "" "" "Use catch2 built-in library" "" ON)
VP_OPTION(WITH_POLOLU "" "" "Build rapa pololu as built-in library" "" ON IF (NOT WINRT) AND (NOT IOS) AND (NOT ANDROID))
VP_OPTION(WITH_POLOLU "" "" "Use rapa pololu as built-in library" "" ON IF (NOT WINRT) AND (NOT IOS) AND (NOT ANDROID))
VP_OPTION(WITH_PUGIXML "" "" "Use pugixml built-in third-party" "" ON)
VP_OPTION(WITH_SIMDLIB "" "" "Use simdlib built-in third-party" "" ON)
VP_OPTION(WITH_STBIMAGE "" "" "Use std_image built-in third-party" "" ON)
Expand Down Expand Up @@ -1146,6 +1150,7 @@ VP_SET(VISP_HAVE_SIMDLIB TRUE IF (BUILD_MODULE_visp_core AND WITH_SIMDLIB))
VP_SET(VISP_HAVE_STBIMAGE TRUE IF (BUILD_MODULE_visp_core AND WITH_STBIMAGE))
VP_SET(VISP_HAVE_TINYEXR TRUE IF (BUILD_MODULE_visp_core AND WITH_TINYEXR))
VP_SET(VISP_HAVE_PUGIXML TRUE IF (BUILD_MODULE_visp_core AND WITH_PUGIXML))
VP_SET(VISP_HAVE_MINIZ TRUE IF (BUILD_MODULE_visp_core AND WITH_MINIZ))

VP_SET(VISP_HAVE_QUALISYS TRUE IF (BUILD_MODULE_visp_sensor AND USE_QUALISYS))
VP_SET(VISP_HAVE_VICON TRUE IF (BUILD_MODULE_visp_sensor AND USE_VICON))
Expand Down Expand Up @@ -1603,6 +1608,7 @@ status(" To be built:" VISP_MODULES_BUILD THEN ${VISP_MOD
status(" Disabled:" VISP_MODULES_DISABLED_USER THEN ${VISP_MODULES_DISABLED_USER_ST} ELSE "-")
status(" Disabled by dependency:" VISP_MODULES_DISABLED_AUTO THEN ${VISP_MODULES_DISABLED_AUTO_ST} ELSE "-")
status(" Unavailable:" VISP_MODULES_DISABLED_FORCE THEN ${VISP_MODULES_DISABLED_FORCE_ST} ELSE "-")
status(" Enable visp namespace:" ENABLE_VISP_NAMESPACE THEN "yes" ELSE "no")

# ========================== Android details ==========================
if(ANDROID)
Expand Down Expand Up @@ -1739,6 +1745,7 @@ status(" Use OpenCV:" USE_OPENCV THEN "yes (ver ${OpenCV_VE
status(" Use stb_image (built-in):" WITH_STBIMAGE THEN "yes (ver ${STBIMAGE_VERSION})" ELSE "no")
status(" Use TinyEXR (built-in):" WITH_TINYEXR THEN "yes (ver ${TINYEXR_VERSION})" ELSE "no")
status(" Use simdlib (built-in):" WITH_SIMDLIB THEN "yes" ELSE "no")
status(" Use npz I/O (built-in):" WITH_MINIZ THEN "yes" ELSE "no")
status("")
status(" Real robots: ")
status(" Use Afma4:" USE_AFMA4 THEN "yes" ELSE "no")
Expand Down
1 change: 1 addition & 0 deletions apps/calibration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ if(VISP_HAVE_REALSENSE2)
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unused-function")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unused-parameter")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unqualified-std-cast-call")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-missing-field-initializers")

visp_set_source_file_compile_flag(visp-acquire-franka-calib-data.cpp ${CXX_FLAGS_MUTE_WARNINGS})
visp_set_source_file_compile_flag(visp-acquire-universal-robots-calib-data.cpp ${CXX_FLAGS_MUTE_WARNINGS})
Expand Down
4 changes: 4 additions & 0 deletions apps/calibration/visp-acquire-franka-calib-data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <iostream>

#include <visp3/core/vpCameraParameters.h>
#include <visp3/core/vpConfig.h>
#include <visp3/core/vpXmlParserCamera.h>
#include <visp3/gui/vpDisplayGDI.h>
#include <visp3/gui/vpDisplayX.h>
Expand Down Expand Up @@ -66,6 +67,9 @@ void usage(const char **argv, int error, const std::string &robot_ip)

int main(int argc, const char **argv)
{
#if defined(ENABLE_VISP_NAMESPACE)
using namespace VISP_NAMESPACE_NAME;
#endif
try {
std::string opt_robot_ip = "192.168.1.1";

Expand Down
4 changes: 4 additions & 0 deletions apps/calibration/visp-acquire-universal-robots-calib-data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <iostream>

#include <visp3/core/vpCameraParameters.h>
#include <visp3/core/vpConfig.h>
#include <visp3/core/vpXmlParserCamera.h>
#include <visp3/gui/vpDisplayGDI.h>
#include <visp3/gui/vpDisplayX.h>
Expand Down Expand Up @@ -66,6 +67,9 @@ void usage(const char **argv, int error, const std::string &robot_ip)

int main(int argc, const char **argv)
{
#if defined(ENABLE_VISP_NAMESPACE)
using namespace VISP_NAMESPACE_NAME;
#endif
try {
std::string opt_robot_ip = "192.168.0.100";

Expand Down
8 changes: 6 additions & 2 deletions apps/calibration/visp-compute-chessboard-poses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
#include <visp3/io/vpVideoReader.h>
#include <visp3/vision/vpPose.h>

#if defined(ENABLE_VISP_NAMESPACE)
using namespace VISP_NAMESPACE_NAME;
#endif

namespace
{
void calcChessboardCorners(int width, int height, double squareSize, std::vector<vpPoint> &corners)
Expand Down Expand Up @@ -224,7 +228,7 @@ int main(int argc, const char **argv)
#elif defined(VISP_HAVE_GTK)
display = new vpDisplayGTK(I);
#endif
}
}
#endif

std::vector<vpPoint> corners_pts;
Expand Down Expand Up @@ -335,7 +339,7 @@ int main(int argc, const char **argv)
}
}
#endif
}
}
catch (const vpException &e) {
std::cout << "Catch an exception: " << e.getMessage() << std::endl;
}
Expand Down
5 changes: 5 additions & 0 deletions apps/calibration/visp-compute-hand-eye-calibration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
//! \example visp-compute-hand-eye-calibration.cpp
#include <map>

#include <visp3/core/vpConfig.h>
#include <visp3/core/vpIoTools.h>
#include <visp3/vision/vpHandEyeCalibration.h>

Expand Down Expand Up @@ -74,6 +75,10 @@ void usage(const char *argv[], int error)

int main(int argc, const char *argv[])
{
#if defined(ENABLE_VISP_NAMESPACE)
using namespace VISP_NAMESPACE_NAME;
#endif

std::string opt_data_path = "./";
std::string opt_fPe_files = "pose_fPe_%d.yaml";
std::string opt_cPo_files = "pose_cPo_%d.yaml";
Expand Down
2 changes: 1 addition & 1 deletion cmake/FindVirtuose.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ elseif(MSVC)
set(VIRTUOSE_MSVC_RUNTIME VC2017)
elseif(MSVC_VERSION MATCHES "^192[0-9]$")
set(VIRTUOSE_MSVC_RUNTIME VC2019)
elseif(MSVC_VERSION MATCHES "^193[0-9]$")
elseif(MSVC_VERSION MATCHES "^19[34][0-9]$")
set(VIRTUOSE_MSVC_RUNTIME VC2022)
endif()

Expand Down
2 changes: 1 addition & 1 deletion cmake/VISPDetectPlatform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ elseif(MSVC)
set(VISP_RUNTIME vc15)
elseif(MSVC_VERSION MATCHES "^192[0-9]$")
set(VISP_RUNTIME vc16)
elseif(MSVC_VERSION MATCHES "^193[0-9]$")
elseif(MSVC_VERSION MATCHES "^19[34][0-9]$")
set(VISP_RUNTIME vc17)
else()
message(WARNING "ViSP does not recognize MSVC_VERSION \"${MSVC_VERSION}\". Cannot set VISP_RUNTIME")
Expand Down
2 changes: 2 additions & 0 deletions cmake/templates/VISPConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ set(VISP_BIN_INSTALL_PATH "@VISP_BIN_INSTALL_PATH@")
#----------------------------------------------------------------------
# Remember VISP third party libs configuration
#----------------------------------------------------------------------
set(ENABLE_VISP_NAMESPACE "@ENABLE_VISP_NAMESPACE@")
set(VISP_HAVE_AFMA4 "@VISP_HAVE_AFMA4@")
set(VISP_HAVE_AFMA6 "@VISP_HAVE_AFMA6@")
set(VISP_HAVE_APRILTAG "@VISP_HAVE_APRILTAG@")
Expand Down Expand Up @@ -228,6 +229,7 @@ set(VISP_HAVE_LIBFREENECT_AND_DEPENDENCIES "@VISP_HAVE_LIBFREENECT_AND_DEPENDENC
set(VISP_HAVE_LIBFREENECT_OLD "@VISP_HAVE_LIBFREENECT_OLD@")
set(VISP_HAVE_LIBUSB_1 "@VISP_HAVE_LIBUSB_1@")
set(VISP_HAVE_MAVSDK "@VISP_HAVE_MAVSDK@")
set(VISP_HAVE_MINIZ "@VISP_HAVE_MINIZ@")
set(VISP_HAVE_MKL "@VISP_HAVE_MKL@")
set(VISP_HAVE_NETLIB "@VISP_HAVE_NETLIB@")
set(VISP_HAVE_NULLPTR "@VISP_HAVE_NULLPTR@")
Expand Down
2 changes: 1 addition & 1 deletion cmake/templates/VISPConfig.root-WIN32.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ elseif(MSVC)
set(VISP_RUNTIME vc14) # selecting previous compatible runtime version
endif()
endif()
elseif(MSVC_VERSION MATCHES "^193[0-9]$")
elseif(MSVC_VERSION MATCHES "^19[34][0-9]$")
set(VISP_RUNTIME vc17)
check_one_config(has_VS2022)
if(NOT has_VS2022)
Expand Down
21 changes: 21 additions & 0 deletions cmake/templates/vpConfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,24 @@
VISP_VERSION_MINOR, \
VISP_VERSION_PATCH)

// Defined if the user wants to protect the classes in a dedicated visp namespace
#cmakedefine ENABLE_VISP_NAMESPACE
#define VISP_NAMESPACE_NAME visp
#ifdef ENABLE_VISP_NAMESPACE
#define VISP_NAMESPACE_ADDRESSING visp::
#define BEGIN_VISP_NAMESPACE namespace visp {
#define END_VISP_NAMESPACE }
// Create an empty namespace to ensure that "using VISP_NAMESPACE_NAME;" does not raise an error
namespace VISP_NAMESPACE_NAME {}

// Create an alias for compatibility with older versions of ViSP
namespace vp = VISP_NAMESPACE_NAME;
#else
#define VISP_NAMESPACE_ADDRESSING
#define BEGIN_VISP_NAMESPACE
#define END_VISP_NAMESPACE
#endif

// Enable debug and trace printings
#cmakedefine VP_TRACE
#cmakedefine VP_DEBUG
Expand Down Expand Up @@ -143,6 +161,9 @@
// Always define pugixml for compatibility.
#cmakedefine VISP_HAVE_PUGIXML

// Defined if basisu_miniz is used internally
#cmakedefine VISP_HAVE_MINIZ

// Defined if XML2 library available.
#cmakedefine VISP_HAVE_XML2

Expand Down
4 changes: 4 additions & 0 deletions demo/wireframe-simulator/servoSimu4Points.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@

#if defined(VISP_HAVE_DISPLAY) && (defined(VISP_HAVE_LAPACK) || defined(VISP_HAVE_EIGEN3) || defined(VISP_HAVE_OPENCV))

#if defined(ENABLE_VISP_NAMESPACE)
using namespace VISP_NAMESPACE_NAME;
#endif

/*!

Print the program options.
Expand Down
4 changes: 4 additions & 0 deletions demo/wireframe-simulator/servoSimuCylinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@

#if defined(VISP_HAVE_DISPLAY) && (defined(VISP_HAVE_LAPACK) || defined(VISP_HAVE_EIGEN3) || defined(VISP_HAVE_OPENCV))

#if defined(ENABLE_VISP_NAMESPACE)
using namespace VISP_NAMESPACE_NAME;
#endif

/*!

Print the program options.
Expand Down
5 changes: 5 additions & 0 deletions demo/wireframe-simulator/servoSimuSphere.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include <stdlib.h>

#include <visp3/core/vpCameraParameters.h>
#include <visp3/core/vpConfig.h>
#include <visp3/core/vpHomogeneousMatrix.h>
#include <visp3/core/vpImage.h>
#include <visp3/core/vpIoTools.h>
Expand All @@ -69,6 +70,10 @@

#if defined(VISP_HAVE_DISPLAY) && (defined(VISP_HAVE_LAPACK) || defined(VISP_HAVE_EIGEN3) || defined(VISP_HAVE_OPENCV))

#if defined(ENABLE_VISP_NAMESPACE)
using namespace VISP_NAMESPACE_NAME;
#endif

/*!

Print the program options.
Expand Down
1 change: 1 addition & 0 deletions doc/config-doxygen.in
Original file line number Diff line number Diff line change
Expand Up @@ -2390,6 +2390,7 @@ PREDEFINED = @DOXYGEN_SHOULD_SKIP_THIS@ \
VISP_HAVE_LIBFREENECT_AND_DEPENDENCIES \
VISP_HAVE_LIBUSB_1 \
VISP_HAVE_MAVSDK \
VISP_HAVE_MINIZ \
VISP_HAVE_NLOHMANN_JSON \
VISP_HAVE_NULLPTR \
VISP_HAVE_OCCIPITAL_STRUCTURE \
Expand Down
2 changes: 1 addition & 1 deletion example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,6 @@ visp_add_subdirectory(servo-universal-robots REQUIRED_DEPS visp_core visp_robo
visp_add_subdirectory(servo-viper650 REQUIRED_DEPS visp_core visp_blob visp_vs visp_robot visp_sensor visp_vision visp_gui)
visp_add_subdirectory(servo-viper850 REQUIRED_DEPS visp_core visp_blob visp_vs visp_robot visp_sensor visp_vision visp_gui)
visp_add_subdirectory(tools REQUIRED_DEPS visp_core visp_robot visp_io visp_gui)
visp_add_subdirectory(tracking REQUIRED_DEPS visp_core visp_io visp_gui)
visp_add_subdirectory(tracking REQUIRED_DEPS visp_core visp_core visp_blob visp_io visp_gui visp_mbt visp_me visp_tt visp_tt_mi)
visp_add_subdirectory(video REQUIRED_DEPS visp_core visp_io visp_gui)
visp_add_subdirectory(wireframe-simulator REQUIRED_DEPS visp_core visp_robot visp_io visp_gui)
6 changes: 5 additions & 1 deletion example/calibration/calibrate-camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ void usage(const char *argv[], int error)

int main(int argc, const char *argv[])
{
#if defined(ENABLE_VISP_NAMESPACE)
using namespace VISP_NAMESPACE_NAME;
#endif

try {
if (argc == 1) {
usage(argv, 0);
Expand Down Expand Up @@ -679,5 +683,5 @@ int main()
std::cout << "pugixml built-in 3rdparty is requested to run the calibration." << std::endl;
#endif
return EXIT_SUCCESS;
}
}
#endif
6 changes: 5 additions & 1 deletion example/calibration/calibrate-hand-eye.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include <stdio.h>
#include <vector>

#include <visp3/core/vpConfig.h>
#include <visp3/core/vpDebug.h>
#include <visp3/core/vpExponentialMap.h>
#include <visp3/core/vpIoTools.h>
Expand All @@ -54,6 +55,9 @@
int main()
{
#if (defined(VISP_HAVE_LAPACK) || defined(VISP_HAVE_EIGEN3) || defined(VISP_HAVE_OPENCV))
#if defined(ENABLE_VISP_NAMESPACE)
using namespace VISP_NAMESPACE_NAME;
#endif
try {
// We want to calibrate the hand-eye extrinsic camera parameters from 6
// couple of poses: cMo and wMe
Expand Down Expand Up @@ -167,4 +171,4 @@ int main()
std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl;
return EXIT_SUCCESS;
#endif
}
}
Loading
Loading