diff --git a/example/calibration/calibrate-camera.cpp b/example/calibration/calibrate-camera.cpp index 560f65a4f1..dc6059fa6f 100644 --- a/example/calibration/calibrate-camera.cpp +++ b/example/calibration/calibrate-camera.cpp @@ -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); @@ -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 diff --git a/example/calibration/calibrate-hand-eye.cpp b/example/calibration/calibrate-hand-eye.cpp index 86dc0ec52b..eca9831650 100644 --- a/example/calibration/calibrate-hand-eye.cpp +++ b/example/calibration/calibrate-hand-eye.cpp @@ -45,6 +45,7 @@ #include #include +#include #include #include #include @@ -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 @@ -167,4 +171,4 @@ int main() std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl; return EXIT_SUCCESS; #endif -} + } diff --git a/example/calibration/calibration-helper.hpp b/example/calibration/calibration-helper.hpp index daf4a41d92..4c09ce25ad 100644 --- a/example/calibration/calibration-helper.hpp +++ b/example/calibration/calibration-helper.hpp @@ -67,14 +67,14 @@ class Settings bool read(const std::string &filename) // Read the parameters { // reading configuration file - if (!vpIoTools::loadConfigFile(filename)) + if (!VISP_NAMESPACE_ADDRESSING vpIoTools::loadConfigFile(filename)) return false; - vpIoTools::readConfigVar("BoardSize_Width:", boardSize.width); - vpIoTools::readConfigVar("BoardSize_Height:", boardSize.height); - vpIoTools::readConfigVar("Square_Size:", squareSize); - vpIoTools::readConfigVar("Calibrate_Pattern:", patternToUse); - vpIoTools::readConfigVar("Input:", input); - vpIoTools::readConfigVar("Tempo:", tempo); + VISP_NAMESPACE_ADDRESSING vpIoTools::readConfigVar("BoardSize_Width:", boardSize.width); + VISP_NAMESPACE_ADDRESSING vpIoTools::readConfigVar("BoardSize_Height:", boardSize.height); + VISP_NAMESPACE_ADDRESSING vpIoTools::readConfigVar("Square_Size:", squareSize); + VISP_NAMESPACE_ADDRESSING vpIoTools::readConfigVar("Calibrate_Pattern:", patternToUse); + VISP_NAMESPACE_ADDRESSING vpIoTools::readConfigVar("Input:", input); + VISP_NAMESPACE_ADDRESSING vpIoTools::readConfigVar("Tempo:", tempo); std::cout << "grid width : " << boardSize.width << std::endl; std::cout << "grid height: " << boardSize.height << std::endl; @@ -128,20 +128,20 @@ class Settings std::string patternToUse; }; -struct CalibInfo { - CalibInfo(const vpImage &img, const std::vector &points, - const std::vector &imPts, const std::string &frame_name) +struct CalibInfo +{ + CalibInfo(const VISP_NAMESPACE_ADDRESSING vpImage &img, const std::vector &points, + const std::vector &imPts, const std::string &frame_name) : m_img(img), m_points(points), m_imPts(imPts), m_frame_name(frame_name) - { - } + { } - vpImage m_img; - std::vector m_points; - std::vector m_imPts; + VISP_NAMESPACE_ADDRESSING vpImage m_img; + std::vector m_points; + std::vector m_imPts; std::string m_frame_name; }; -void drawCalibrationOccupancy(vpImage &I, const std::vector &calib_info, +void drawCalibrationOccupancy(VISP_NAMESPACE_ADDRESSING vpImage &I, const std::vector &calib_info, unsigned int patternW) { I = 0; @@ -149,16 +149,16 @@ void drawCalibrationOccupancy(vpImage &I, const std::vector corners; + std::vector corners; corners.push_back(calib.m_imPts.front()); corners.push_back(*(calib.m_imPts.begin() + patternW - 1)); corners.push_back(calib.m_imPts.back()); corners.push_back(*(calib.m_imPts.end() - patternW)); - vpPolygon poly(corners); + VISP_NAMESPACE_ADDRESSING vpPolygon poly(corners); for (unsigned int i = 0; i < I.getHeight(); i++) { for (unsigned int j = 0; j < I.getWidth(); j++) { - if (poly.isInside(vpImagePoint(i, j))) { + if (poly.isInside(VISP_NAMESPACE_ADDRESSING vpImagePoint(i, j))) { I[i][j] += pixel_value; } } @@ -166,17 +166,17 @@ void drawCalibrationOccupancy(vpImage &I, const std::vector undistort(const vpCameraParameters &cam_dist, const std::vector &imPts) +std::vector undistort(const VISP_NAMESPACE_ADDRESSING vpCameraParameters &cam_dist, const std::vector &imPts) { - std::vector imPts_undist; + std::vector imPts_undist; - vpCameraParameters cam(cam_dist.get_px(), cam_dist.get_py(), cam_dist.get_u0(), cam_dist.get_v0()); + VISP_NAMESPACE_ADDRESSING vpCameraParameters cam(cam_dist.get_px(), cam_dist.get_py(), cam_dist.get_u0(), cam_dist.get_v0()); for (size_t i = 0; i < imPts.size(); i++) { double x = 0, y = 0; - vpPixelMeterConversion::convertPoint(cam_dist, imPts[i], x, y); + VISP_NAMESPACE_ADDRESSING vpPixelMeterConversion::convertPoint(cam_dist, imPts[i], x, y); - vpImagePoint imPt; - vpMeterPixelConversion::convertPoint(cam, x, y, imPt); + VISP_NAMESPACE_ADDRESSING vpImagePoint imPt; + VISP_NAMESPACE_ADDRESSING vpMeterPixelConversion::convertPoint(cam, x, y, imPt); imPts_undist.push_back(imPt); } @@ -190,11 +190,11 @@ bool extractCalibrationPoints(const Settings &s, const cv::Mat &cvI, std::vector { case Settings::CHESSBOARD: found = - findChessboardCorners(cvI, s.boardSize, pointBuf, + findChessboardCorners(cvI, s.boardSize, pointBuf, #if (VISP_HAVE_OPENCV_VERSION >= 0x030000) - cv::CALIB_CB_ADAPTIVE_THRESH | cv::CALIB_CB_FAST_CHECK | cv::CALIB_CB_NORMALIZE_IMAGE); + cv::CALIB_CB_ADAPTIVE_THRESH | cv::CALIB_CB_FAST_CHECK | cv::CALIB_CB_NORMALIZE_IMAGE); #else - CV_CALIB_CB_ADAPTIVE_THRESH | CV_CALIB_CB_FAST_CHECK | CV_CALIB_CB_NORMALIZE_IMAGE); + CV_CALIB_CB_ADAPTIVE_THRESH | CV_CALIB_CB_FAST_CHECK | CV_CALIB_CB_NORMALIZE_IMAGE); #endif break; case Settings::CIRCLES_GRID: @@ -207,7 +207,7 @@ bool extractCalibrationPoints(const Settings &s, const cv::Mat &cvI, std::vector if (found) // If done with success, { - std::vector data; + std::vector data; if (s.calibrationPattern == Settings::CHESSBOARD) { // improve the found corners' coordinate accuracy for chessboard @@ -215,7 +215,7 @@ bool extractCalibrationPoints(const Settings &s, const cv::Mat &cvI, std::vector #if (VISP_HAVE_OPENCV_VERSION >= 0x030000) cv::TermCriteria(cv::TermCriteria::EPS + cv::TermCriteria::COUNT, 30, 0.1)); #else - cv::TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1)); + cv::TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1)); #endif } } diff --git a/example/coin-simulator/simulateCircle2DCamVelocity.cpp b/example/coin-simulator/simulateCircle2DCamVelocity.cpp index 093fdb7af2..17b843c02e 100644 --- a/example/coin-simulator/simulateCircle2DCamVelocity.cpp +++ b/example/coin-simulator/simulateCircle2DCamVelocity.cpp @@ -66,6 +66,10 @@ #define GETOPTARGS "cdi:h" #define SAVE 0 +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! Print the program options. diff --git a/example/coin-simulator/simulateFourPoints2DCartesianCamVelocity.cpp b/example/coin-simulator/simulateFourPoints2DCartesianCamVelocity.cpp index 683ae4c92d..d1f3111b9e 100644 --- a/example/coin-simulator/simulateFourPoints2DCartesianCamVelocity.cpp +++ b/example/coin-simulator/simulateFourPoints2DCartesianCamVelocity.cpp @@ -66,6 +66,10 @@ #define GETOPTARGS "di:h" #define SAVE 0 +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! Print the program options. diff --git a/example/coin-simulator/simulateFourPoints2DPolarCamVelocity.cpp b/example/coin-simulator/simulateFourPoints2DPolarCamVelocity.cpp index e6b98431cc..633d4b29b0 100644 --- a/example/coin-simulator/simulateFourPoints2DPolarCamVelocity.cpp +++ b/example/coin-simulator/simulateFourPoints2DPolarCamVelocity.cpp @@ -64,6 +64,10 @@ #define GETOPTARGS "di:h" #define SAVE 0 +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! Print the program options. diff --git a/example/device/display/displayD3D.cpp b/example/device/display/displayD3D.cpp index 6d892470a2..a931f20aed 100644 --- a/example/device/display/displayD3D.cpp +++ b/example/device/display/displayD3D.cpp @@ -66,6 +66,10 @@ // List of allowed command line options #define GETOPTARGS "cdi:o:h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! Print the program options. diff --git a/example/device/display/displayGDI.cpp b/example/device/display/displayGDI.cpp index 92728dec92..68139cfc17 100644 --- a/example/device/display/displayGDI.cpp +++ b/example/device/display/displayGDI.cpp @@ -67,6 +67,10 @@ // List of allowed command line options #define GETOPTARGS "cdi:o:h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! Print the program options. diff --git a/example/device/display/displayGTK.cpp b/example/device/display/displayGTK.cpp index 5ed0623fe8..8d9ffd1719 100644 --- a/example/device/display/displayGTK.cpp +++ b/example/device/display/displayGTK.cpp @@ -70,6 +70,10 @@ // List of allowed command line options #define GETOPTARGS "cdi:o:h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! Print the program options. diff --git a/example/device/display/displayOpenCV.cpp b/example/device/display/displayOpenCV.cpp index 9a3a9aa54a..ec965e745c 100644 --- a/example/device/display/displayOpenCV.cpp +++ b/example/device/display/displayOpenCV.cpp @@ -68,6 +68,10 @@ // List of allowed command line options #define GETOPTARGS "cdi:o:p:h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! Print the program options. @@ -459,5 +463,5 @@ int main() std::cout << "Tip:" << std::endl; std::cout << "- Install OpenCV, configure again ViSP using cmake and build again this example" << std::endl; return EXIT_SUCCESS; -} + } #endif diff --git a/example/device/display/displaySequence.cpp b/example/device/display/displaySequence.cpp index b8647b5b0d..01abe9a6df 100644 --- a/example/device/display/displaySequence.cpp +++ b/example/device/display/displaySequence.cpp @@ -72,6 +72,10 @@ // List of allowed command line options #define GETOPTARGS "di:p:hf:l:s:w" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! Print the program options. @@ -402,5 +406,5 @@ int main() std::cout << "Tip if you are on a windows-like system:" << std::endl; std::cout << "- Install GDI, configure again ViSP using cmake and build again this example" << std::endl; return EXIT_SUCCESS; -} + } #endif diff --git a/example/device/display/displayX.cpp b/example/device/display/displayX.cpp index 47a52eae04..339e1c239d 100644 --- a/example/device/display/displayX.cpp +++ b/example/device/display/displayX.cpp @@ -66,6 +66,10 @@ // List of allowed command line options #define GETOPTARGS "cdi:o:p:h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! Print the program options. @@ -447,5 +451,5 @@ int main() std::cout << "Tip if you are on a unix-like system:" << std::endl; std::cout << "- Install X11, configure again ViSP using cmake and build again this example" << std::endl; return EXIT_SUCCESS; -} + } #endif diff --git a/example/device/display/displayXMulti.cpp b/example/device/display/displayXMulti.cpp index 4666e71377..876200fe11 100644 --- a/example/device/display/displayXMulti.cpp +++ b/example/device/display/displayXMulti.cpp @@ -69,6 +69,10 @@ // List of allowed command line options #define GETOPTARGS "cdi:o:h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! Print the program options. @@ -411,5 +415,5 @@ int main() std::cout << "Tip if you are on a unix-like system:" << std::endl; std::cout << "- Install X11, configure again ViSP using cmake and build again this example" << std::endl; return EXIT_SUCCESS; -} + } #endif diff --git a/example/device/framegrabber/getRealSense2Info.cpp b/example/device/framegrabber/getRealSense2Info.cpp index bd8c2f5dd2..a816f5ea2f 100644 --- a/example/device/framegrabber/getRealSense2Info.cpp +++ b/example/device/framegrabber/getRealSense2Info.cpp @@ -40,12 +40,16 @@ */ #include +#include #include #if defined(VISP_HAVE_REALSENSE2) && (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11) int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif try { vpRealSense2 rs; rs.open(); diff --git a/example/device/framegrabber/grab1394CMU.cpp b/example/device/framegrabber/grab1394CMU.cpp index dd48c36ea9..f5276129d6 100644 --- a/example/device/framegrabber/grab1394CMU.cpp +++ b/example/device/framegrabber/grab1394CMU.cpp @@ -57,6 +57,11 @@ // List of allowed command line options #define GETOPTARGS "dhn:o:" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + + void usage(const char *name, const char *badparam, unsigned &nframes, std::string &opath); bool getOptions(int argc, const char **argv, bool &display, unsigned int &nframes, bool &save, std::string &opath); diff --git a/example/device/framegrabber/grab1394Two.cpp b/example/device/framegrabber/grab1394Two.cpp index 77018c3c1e..aeb3bafd0b 100644 --- a/example/device/framegrabber/grab1394Two.cpp +++ b/example/device/framegrabber/grab1394Two.cpp @@ -70,6 +70,10 @@ #define GETOPTARGS "b:c:df:g:hH:L:mn:io:p:rsT:v:W:" #define DUAL_ACQ +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! Print the program options. @@ -685,6 +689,6 @@ int main() std::cout << "Tip if you are on a unix-like system:" << std::endl; std::cout << "- Install libdc1394-2, configure again ViSP using cmake and build again this example" << std::endl; return EXIT_SUCCESS; -} + } #endif diff --git a/example/device/framegrabber/grabDirectShow.cpp b/example/device/framegrabber/grabDirectShow.cpp index 3e53fc53c7..6f57613dd6 100644 --- a/example/device/framegrabber/grabDirectShow.cpp +++ b/example/device/framegrabber/grabDirectShow.cpp @@ -58,6 +58,10 @@ // List of allowed command line options #define GETOPTARGS "dhn:o:" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! Print the program options. @@ -94,7 +98,7 @@ OPTIONS: Default\n\ -h \n\ Print the help.\n\ \n", - nframes, opath.c_str()); +nframes, opath.c_str()); if (badparam) { fprintf(stderr, "ERROR: \n"); fprintf(stderr, "\nBad parameter [%s]\n", badparam); @@ -254,7 +258,8 @@ int main(int argc, const char **argv) // Release the framegrabber delete grabber; return EXIT_SUCCESS; - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "Catch an exception: " << e << std::endl; return EXIT_FAILURE; } @@ -264,7 +269,7 @@ int main(int argc, const char **argv) int main() { std::cout << "You do not have GDI (Graphical Device Interface), or GTK functionalities to display images..." - << std::endl; + << std::endl; std::cout << "Tip if you are on a windows-like system:" << std::endl; std::cout << "- Install GDI, configure again ViSP using cmake and build again this example" << std::endl; return EXIT_SUCCESS; diff --git a/example/device/framegrabber/grabDirectShowMulti.cpp b/example/device/framegrabber/grabDirectShowMulti.cpp index 26c707b847..4d03b16dbd 100644 --- a/example/device/framegrabber/grabDirectShowMulti.cpp +++ b/example/device/framegrabber/grabDirectShowMulti.cpp @@ -64,6 +64,10 @@ #define GRAB_COLOR +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! Print the program options. @@ -136,7 +140,7 @@ OPTIONS Default\n\ -h \n\ Print the help.\n\ \n", - camera, nframes, opath.c_str()); +camera, nframes, opath.c_str()); exit(0); } @@ -297,7 +301,8 @@ int main(int argc, const char **argv) g[i].open(); } - } else { + } + else { ncameras = 1; // acquisition from only one camera delete[] g; g = new vpDirectShowGrabber[1]; @@ -355,19 +360,19 @@ int main(int argc, const char **argv) unsigned int width, height; g[i].getFormat(width, height, framerate); std::cout << "----------------------------------------------------------" << std::endl - << "---- MediaType and framerate currently used by device " << std::endl - << "---- (or camera) " << c << std::endl - << "---- Current MediaType : " << g[i].getMediaType() << std::endl - << "---- Current format : " << width << " x " << height << " at " << framerate << " fps" - << std::endl - << "----------------------------------------------------------" << std::endl; + << "---- MediaType and framerate currently used by device " << std::endl + << "---- (or camera) " << c << std::endl + << "---- Current MediaType : " << g[i].getMediaType() << std::endl + << "---- Current format : " << width << " x " << height << " at " << framerate << " fps" + << std::endl + << "----------------------------------------------------------" << std::endl; } if (verbose_settings) { std::cout << "----------------------------------------------------------" << std::endl - << "---- MediaTypes supported by device (or camera) " << c << std::endl - << "---- One of the MediaType below can be set using " << std::endl - << "---- option -t ." << std::endl - << "----------------------------------------------------------" << std::endl; + << "---- MediaTypes supported by device (or camera) " << c << std::endl + << "---- One of the MediaType below can be set using " << std::endl + << "---- option -t ." << std::endl + << "----------------------------------------------------------" << std::endl; g[i].getStreamCapabilities(); } } @@ -390,7 +395,7 @@ int main(int argc, const char **argv) c = camera; std::cout << "Image size for camera " << c << " : width: " << I[i].getWidth() << " height: " << I[i].getHeight() - << std::endl; + << std::endl; if (display) { // Initialise the display @@ -444,7 +449,8 @@ int main(int argc, const char **argv) delete[] d; return EXIT_SUCCESS; - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "Catch an exception: " << e << std::endl; return EXIT_FAILURE; } @@ -453,7 +459,7 @@ int main(int argc, const char **argv) int main() { std::cout << "You do not have GDI (Graphical Device Interface), or GTK functionalities to display images..." - << std::endl; + << std::endl; std::cout << "Tip if you are on a windows-like system:" << std::endl; std::cout << "- Install GDI, configure again ViSP using cmake and build again this example" << std::endl; return EXIT_SUCCESS; diff --git a/example/device/framegrabber/grabDisk.cpp b/example/device/framegrabber/grabDisk.cpp index c3c3424fef..a095af2c46 100644 --- a/example/device/framegrabber/grabDisk.cpp +++ b/example/device/framegrabber/grabDisk.cpp @@ -33,6 +33,16 @@ * *****************************************************************************/ +/*! + \file grabDisk.cpp + + \brief Example of image sequence reading from the disk using vpDiskGrabber + class. + + The sequence is made of separate images. Each image corresponds to a PGM + file. +*/ + #include #include #include @@ -47,19 +57,13 @@ #include #include -/*! - \file grabDisk.cpp - - \brief Example of image sequence reading from the disk using vpDiskGrabber - class. - - The sequence is made of separate images. Each image corresponds to a PGM - file. -*/ - // List of allowed command line options #define GETOPTARGS "b:de:f:hi:l:s:z:" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /* Print the program options. @@ -357,5 +361,5 @@ int main() std::cout << "Tip if you are on a windows-like system:" << std::endl; std::cout << "- Install GDI, configure again ViSP using cmake and build again this example" << std::endl; return EXIT_SUCCESS; -} + } #endif diff --git a/example/device/framegrabber/grabFlyCapture.cpp b/example/device/framegrabber/grabFlyCapture.cpp index ff218e7735..d4299cc2ca 100644 --- a/example/device/framegrabber/grabFlyCapture.cpp +++ b/example/device/framegrabber/grabFlyCapture.cpp @@ -57,6 +57,10 @@ #define GETOPTARGS "cdhi:n:o:" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! Print the program options. @@ -95,7 +99,7 @@ OPTIONS: Default\n\ -h \n\ Print the help.\n\ \n", - icamera, opath.c_str()); +icamera, opath.c_str()); if (badparam) { fprintf(stderr, "ERROR: \n"); @@ -220,7 +224,8 @@ int main(int argc, const char **argv) if (opt_click && opt_display) { if (vpDisplay::getClick(I, false) == true) break; - } else { + } + else { static unsigned int cpt = 0; if (cpt++ == 10) break; @@ -232,7 +237,8 @@ int main(int argc, const char **argv) // The camera connection will be closed automatically in vpFlyCapture // destructor return EXIT_SUCCESS; - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "Catch an exception: " << e.getStringMessage() << std::endl; return EXIT_FAILURE; } diff --git a/example/device/framegrabber/grabRealSense2.cpp b/example/device/framegrabber/grabRealSense2.cpp index b1d7c3bebd..5b2d75be6a 100644 --- a/example/device/framegrabber/grabRealSense2.cpp +++ b/example/device/framegrabber/grabRealSense2.cpp @@ -54,6 +54,10 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + try { vpRealSense2 rs; diff --git a/example/device/framegrabber/grabRealSense2_T265.cpp b/example/device/framegrabber/grabRealSense2_T265.cpp index 26ac71efdf..5f3d554cd1 100644 --- a/example/device/framegrabber/grabRealSense2_T265.cpp +++ b/example/device/framegrabber/grabRealSense2_T265.cpp @@ -55,6 +55,10 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + vpHomogeneousMatrix cMw, cMw_0; vpHomogeneousMatrix cextMw(0, 0, 2, 0, 0, 0); // External camera view for pose visualization vpColVector odo_vel, odo_acc, imu_acc, imu_vel; diff --git a/example/device/framegrabber/grabV4l2.cpp b/example/device/framegrabber/grabV4l2.cpp index 9590a57a42..a3d66dea5f 100644 --- a/example/device/framegrabber/grabV4l2.cpp +++ b/example/device/framegrabber/grabV4l2.cpp @@ -34,9 +34,6 @@ * *****************************************************************************/ -#include -#include -#include /*! \file grabV4l2.cpp @@ -44,6 +41,10 @@ */ +#include +#include +#include + #ifdef VISP_HAVE_V4L2 #if (defined(VISP_HAVE_X11) || defined(VISP_HAVE_GTK)) @@ -60,7 +61,12 @@ // List of allowed command line options #define GETOPTARGS "df:i:hn:o:p:s:t:v:x" -typedef enum { +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + +typedef enum +{ grey_image = 0, // for ViSP unsigned char grey images color_image // for ViSP vpRGBa color images } vpImage_type; @@ -292,8 +298,9 @@ int main(int argc, const char **argv) // Acquire an image g.acquire(Ig); std::cout << "Grey image size: width : " << Ig.getWidth() << " height: " << Ig.getHeight() << std::endl; - } else { - // Open the framegrabber with the specified settings on color images + } + else { + // Open the framegrabber with the specified settings on color images g.open(Ic); // Acquire an image g.acquire(Ic); @@ -318,7 +325,8 @@ int main(int argc, const char **argv) display.init(Ig, 100, 100, "V4L2 grey images framegrabbing"); vpDisplay::display(Ig); vpDisplay::flush(Ig); - } else { + } + else { display.init(Ic, 100, 100, "V4L2 color images framegrabbing"); vpDisplay::display(Ic); vpDisplay::flush(Ic); @@ -338,7 +346,8 @@ int main(int argc, const char **argv) // Flush the display vpDisplay::flush(Ig); } - } else { + } + else { g.acquire(Ic); if (opt_display) { // Display the image @@ -355,7 +364,8 @@ int main(int argc, const char **argv) std::cout << "Write: " << filename << std::endl; if (opt_image_type == grey_image) { vpImageIo::write(Ig, filename); - } else { + } + else { vpImageIo::write(Ic, filename); } } @@ -366,7 +376,8 @@ int main(int argc, const char **argv) g.close(); return EXIT_SUCCESS; - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "Catch an exception: " << e << std::endl; return EXIT_FAILURE; } diff --git a/example/device/framegrabber/grabV4l2MultiCpp11Thread.cpp b/example/device/framegrabber/grabV4l2MultiCpp11Thread.cpp index 2f4333cc31..b342de21bc 100644 --- a/example/device/framegrabber/grabV4l2MultiCpp11Thread.cpp +++ b/example/device/framegrabber/grabV4l2MultiCpp11Thread.cpp @@ -66,6 +66,10 @@ #define GETOPTARGS "d:oh" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + namespace { diff --git a/example/device/framegrabber/readRealSenseData.cpp b/example/device/framegrabber/readRealSenseData.cpp index 079cb7270d..4999f5cc1c 100644 --- a/example/device/framegrabber/readRealSenseData.cpp +++ b/example/device/framegrabber/readRealSenseData.cpp @@ -70,6 +70,10 @@ #define GETOPTARGS "ci:e:jbzodh" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + namespace { @@ -324,13 +328,13 @@ bool readData(int cpt, const std::string &input_directory, const std::string &pa #if defined(VISP_HAVE_PCL_IO) if (pcl::io::loadPCDFile(filename_pointcloud, *point_cloud) == -1) { std::cerr << "Cannot read PCD: " << filename_pointcloud << std::endl; - } + } #else throw(vpIoException(vpIoException::ioError, "Cannot read pcd file without PCL io module")); -#endif - } #endif } +#endif +} return true; } diff --git a/example/device/framegrabber/saveRealSenseData.cpp b/example/device/framegrabber/saveRealSenseData.cpp index 580cfdbd3b..b98a960c9a 100644 --- a/example/device/framegrabber/saveRealSenseData.cpp +++ b/example/device/framegrabber/saveRealSenseData.cpp @@ -76,6 +76,10 @@ #define GETOPTARGS "se:o:acdpzijCf:bvh" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + namespace { void usage(const char *name, const char *badparam, int fps) @@ -360,7 +364,7 @@ class vpFrameQueue ptr_infraredImg = std::make_unique>(m_queueInfrared.front()); m_queueInfrared.pop(); } - } + } bool empty() { @@ -383,7 +387,7 @@ class vpFrameQueue std::queue> m_queueInfrared; size_t m_maxQueueSize; std::mutex m_mutex; -}; + }; class vpStorageWorker { @@ -911,7 +915,7 @@ int main(int argc, const char *argv[]) } save_queue.push(ptr_colorImg, ptr_depthImg, ptr_pointCloud, ptr_infraredImg); #endif - } + } double delta_time = vpTime::measureTimeMs() - start; vec_delta_time.push_back(delta_time); @@ -958,7 +962,7 @@ int main(int argc, const char *argv[]) } save_queue.push(ptr_colorImg, ptr_depthImg, ptr_pointCloud, ptr_infraredImg); #endif - } + } break; case vpMouseButton::button2: @@ -968,10 +972,10 @@ int main(int argc, const char *argv[]) quit = true; save_queue.cancel(); break; + } } } } - } double mean_vec_delta_time = vpMath::getMean(vec_delta_time); double median_vec_delta_time = vpMath::getMedian(vec_delta_time); @@ -994,5 +998,5 @@ int main() std::cout << "pugixml built-in 3rdparty is requested." << std::endl; #endif return EXIT_SUCCESS; -} + } #endif diff --git a/example/device/kinect/kinectAcquisition.cpp b/example/device/kinect/kinectAcquisition.cpp index adbfa8ecb1..547cb8df29 100644 --- a/example/device/kinect/kinectAcquisition.cpp +++ b/example/device/kinect/kinectAcquisition.cpp @@ -57,6 +57,9 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif try { // Init Kinect #ifdef VISP_HAVE_LIBFREENECT_OLD diff --git a/example/device/laserscanner/SickLDMRS-Acq.cpp b/example/device/laserscanner/SickLDMRS-Acq.cpp index 15c204441e..4fb008d411 100644 --- a/example/device/laserscanner/SickLDMRS-Acq.cpp +++ b/example/device/laserscanner/SickLDMRS-Acq.cpp @@ -43,6 +43,7 @@ platforms since the Sick LD-MRS driver was not ported to Windows. */ +#include #include #include #include @@ -51,6 +52,10 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + try { vpSickLDMRS laser; std::string ip = "131.254.12.119"; @@ -83,5 +88,5 @@ int main() << "since the Sick LD-MRS driver was not ported to Windows." << std::endl; return EXIT_SUCCESS; -} + } #endif // #ifdef UNIX diff --git a/example/device/laserscanner/SickLDMRS-Process.cpp b/example/device/laserscanner/SickLDMRS-Process.cpp index 63cddab2c6..5e29a39a5f 100644 --- a/example/device/laserscanner/SickLDMRS-Process.cpp +++ b/example/device/laserscanner/SickLDMRS-Process.cpp @@ -54,6 +54,7 @@ select the layers to proceed. */ +#include #include #include #include @@ -74,6 +75,10 @@ #include #include +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + static int save = 0; static int layerToDisplay = 0xF; // 0xF = 1111 => all the layers are selected static vpLaserScan shm_laserscan[4]; @@ -355,6 +360,6 @@ int main() std::cout << "This example is only working on unix-like platforms \n" << "since the Sick LD-MRS driver was not ported to Windows." << std::endl; return EXIT_SUCCESS; -} + } #endif // #ifdef UNIX diff --git a/example/device/light/ringLight.cpp b/example/device/light/ringLight.cpp index a0c908af88..068d0b2317 100644 --- a/example/device/light/ringLight.cpp +++ b/example/device/light/ringLight.cpp @@ -56,6 +56,10 @@ // List of allowed command line options #define GETOPTARGS "d:hn:ot:" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! Print the program options. diff --git a/example/direct-visual-servoing/photometricVisualServoing.cpp b/example/direct-visual-servoing/photometricVisualServoing.cpp index 84f634f970..ff189bed98 100644 --- a/example/direct-visual-servoing/photometricVisualServoing.cpp +++ b/example/direct-visual-servoing/photometricVisualServoing.cpp @@ -36,6 +36,7 @@ Implemented from \cite Collewet08c. */ +#include #include #include #include @@ -66,6 +67,10 @@ // List of allowed command line options #define GETOPTARGS "cdi:n:h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam, std::string ipath, int niter); bool getOptions(int argc, const char **argv, std::string &ipath, bool &click_allowed, bool &display, int &niter); @@ -435,4 +440,4 @@ int main(int argc, const char **argv) std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl; return EXIT_SUCCESS; #endif -} + } diff --git a/example/direct-visual-servoing/photometricVisualServoingWithoutVpServo.cpp b/example/direct-visual-servoing/photometricVisualServoingWithoutVpServo.cpp index 1b400271e3..023bf73a84 100644 --- a/example/direct-visual-servoing/photometricVisualServoingWithoutVpServo.cpp +++ b/example/direct-visual-servoing/photometricVisualServoingWithoutVpServo.cpp @@ -36,6 +36,7 @@ Implemented from \cite Collewet08c. */ +#include #include #include @@ -67,6 +68,10 @@ // List of allowed command line options #define GETOPTARGS "cdi:n:h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam, std::string ipath, int niter); bool getOptions(int argc, const char **argv, std::string &ipath, bool &click_allowed, bool &display, int &niter); @@ -486,4 +491,4 @@ int main(int argc, const char **argv) std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl; return EXIT_SUCCESS; #endif -} + } diff --git a/example/homography/homographyHLM2DObject.cpp b/example/homography/homographyHLM2DObject.cpp index ef357b8043..6ef655d552 100644 --- a/example/homography/homographyHLM2DObject.cpp +++ b/example/homography/homographyHLM2DObject.cpp @@ -49,6 +49,7 @@ */ +#include #include #include #include @@ -66,6 +67,10 @@ #define L 0.1 #define nbpt 5 +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv); @@ -273,4 +278,4 @@ int main(int argc, const char **argv) std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl; return EXIT_SUCCESS; #endif -} + } diff --git a/example/homography/homographyHLM3DObject.cpp b/example/homography/homographyHLM3DObject.cpp index ffafeab16a..25cb7c3e22 100644 --- a/example/homography/homographyHLM3DObject.cpp +++ b/example/homography/homographyHLM3DObject.cpp @@ -49,6 +49,7 @@ */ +#include #include #include #include @@ -67,6 +68,10 @@ #define L 0.1 #define nbpt 11 +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv); @@ -245,4 +250,4 @@ int main(int argc, const char **argv) std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl; return EXIT_SUCCESS; #endif -} + } diff --git a/example/homography/homographyHartleyDLT2DObject.cpp b/example/homography/homographyHartleyDLT2DObject.cpp index cce2a041ba..9c73dd56a4 100644 --- a/example/homography/homographyHartleyDLT2DObject.cpp +++ b/example/homography/homographyHartleyDLT2DObject.cpp @@ -47,6 +47,7 @@ */ +#include #include #include #include @@ -65,6 +66,10 @@ #define L 0.1 #define nbpt 5 +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv); @@ -241,4 +246,4 @@ int main(int argc, const char **argv) std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl; return EXIT_SUCCESS; #endif -} + } diff --git a/example/homography/homographyRansac2DObject.cpp b/example/homography/homographyRansac2DObject.cpp index 184f1dcf00..3232a140ff 100644 --- a/example/homography/homographyRansac2DObject.cpp +++ b/example/homography/homographyRansac2DObject.cpp @@ -49,6 +49,7 @@ */ +#include #include #include #include @@ -66,6 +67,10 @@ // List of allowed command line options #define GETOPTARGS "h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv); @@ -237,4 +242,4 @@ int main(int argc, const char **argv) std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl; return EXIT_SUCCESS; #endif -} + } diff --git a/example/image/imageDiskRW.cpp b/example/image/imageDiskRW.cpp index a26addbfc6..05a1881f28 100644 --- a/example/image/imageDiskRW.cpp +++ b/example/image/imageDiskRW.cpp @@ -53,6 +53,7 @@ #include #include +#include #include #include #include @@ -61,6 +62,10 @@ // List of allowed command line options #define GETOPTARGS "i:o:h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! Print the program options. diff --git a/example/kalman/ukf-linear-example.cpp b/example/kalman/ukf-linear-example.cpp index 7ff71e57b9..48c3bd1e99 100644 --- a/example/kalman/ukf-linear-example.cpp +++ b/example/kalman/ukf-linear-example.cpp @@ -67,6 +67,11 @@ #endif #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11) + +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /** * \brief The process function, that updates the prior. * diff --git a/example/kalman/ukf-nonlinear-complex-example.cpp b/example/kalman/ukf-nonlinear-complex-example.cpp index 5fa5550bf1..81a3bc25b8 100644 --- a/example/kalman/ukf-nonlinear-complex-example.cpp +++ b/example/kalman/ukf-nonlinear-complex-example.cpp @@ -83,6 +83,11 @@ #endif #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11) + +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + namespace { /** diff --git a/example/kalman/ukf-nonlinear-example.cpp b/example/kalman/ukf-nonlinear-example.cpp index eb4f88e5e1..f362f4a8e5 100644 --- a/example/kalman/ukf-nonlinear-example.cpp +++ b/example/kalman/ukf-nonlinear-example.cpp @@ -90,6 +90,11 @@ #endif #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11) + +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + namespace { /** diff --git a/example/manual/geometric-features/manGeometricFeatures.cpp b/example/manual/geometric-features/manGeometricFeatures.cpp index 2e9636524e..319f6f9998 100644 --- a/example/manual/geometric-features/manGeometricFeatures.cpp +++ b/example/manual/geometric-features/manGeometricFeatures.cpp @@ -45,6 +45,7 @@ */ +#include #include #include // For 2D image @@ -71,6 +72,10 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + try { std::cout << "ViSP geometric features display example" << std::endl; unsigned int height = 288; diff --git a/example/manual/hello-world/Autotools/HelloWorld.cpp b/example/manual/hello-world/Autotools/HelloWorld.cpp index 5d9e3607b1..8b95c87829 100644 --- a/example/manual/hello-world/Autotools/HelloWorld.cpp +++ b/example/manual/hello-world/Autotools/HelloWorld.cpp @@ -1,11 +1,16 @@ #include +#include #include #include #include int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + std::cout << "ViSP Hello World example" << std::endl; vpImage I(288, 384); diff --git a/example/manual/hello-world/CMake/HelloWorld.cpp b/example/manual/hello-world/CMake/HelloWorld.cpp index 257a76c4c2..5c09fbb119 100644 --- a/example/manual/hello-world/CMake/HelloWorld.cpp +++ b/example/manual/hello-world/CMake/HelloWorld.cpp @@ -35,12 +35,17 @@ #include #include +#include #include #include #include int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + try { vpThetaUVector tu; diff --git a/example/manual/hello-world/Makefile/HelloWorld.cpp b/example/manual/hello-world/Makefile/HelloWorld.cpp index 5d9e3607b1..8b95c87829 100644 --- a/example/manual/hello-world/Makefile/HelloWorld.cpp +++ b/example/manual/hello-world/Makefile/HelloWorld.cpp @@ -1,11 +1,16 @@ #include +#include #include #include #include int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + std::cout << "ViSP Hello World example" << std::endl; vpImage I(288, 384); diff --git a/example/manual/image-manipulation/manDisplay.cpp b/example/manual/image-manipulation/manDisplay.cpp index e9da06e56e..4463644eb1 100644 --- a/example/manual/image-manipulation/manDisplay.cpp +++ b/example/manual/image-manipulation/manDisplay.cpp @@ -41,6 +41,7 @@ */ #include +#include #include #include #include @@ -48,6 +49,10 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + try { // Create a grey level image vpImage I; diff --git a/example/manual/image-manipulation/manGrab1394.cpp b/example/manual/image-manipulation/manGrab1394.cpp index 0841d2c0a3..0b6cc89192 100644 --- a/example/manual/image-manipulation/manGrab1394.cpp +++ b/example/manual/image-manipulation/manGrab1394.cpp @@ -47,12 +47,18 @@ #include #include +#include #include #include int main() { #ifdef VISP_HAVE_DC1394 + +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + try { unsigned int ncameras; // Number of cameras on the bus vp1394TwoGrabber g; diff --git a/example/manual/image-manipulation/manGrabDirectShow.cpp b/example/manual/image-manipulation/manGrabDirectShow.cpp index 2a2b01c57e..7de60b9c73 100644 --- a/example/manual/image-manipulation/manGrabDirectShow.cpp +++ b/example/manual/image-manipulation/manGrabDirectShow.cpp @@ -52,6 +52,10 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + try { vpImage I; // Grey level image diff --git a/example/manual/image-manipulation/manGrabDisk.cpp b/example/manual/image-manipulation/manGrabDisk.cpp index 0103ff9dcb..6152c0e336 100644 --- a/example/manual/image-manipulation/manGrabDisk.cpp +++ b/example/manual/image-manipulation/manGrabDisk.cpp @@ -52,6 +52,10 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + try { vpImage I; // Grey level image diff --git a/example/manual/image-manipulation/manGrabV4l2.cpp b/example/manual/image-manipulation/manGrabV4l2.cpp index 05f26cbea0..32013f7167 100644 --- a/example/manual/image-manipulation/manGrabV4l2.cpp +++ b/example/manual/image-manipulation/manGrabV4l2.cpp @@ -45,11 +45,16 @@ */ +#include #include #include int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + try { vpImage I; // Grey level image diff --git a/example/manual/moments/manServoMomentsSimple.cpp b/example/manual/moments/manServoMomentsSimple.cpp index 0ba5b221a9..429789a58b 100644 --- a/example/manual/moments/manServoMomentsSimple.cpp +++ b/example/manual/moments/manServoMomentsSimple.cpp @@ -39,6 +39,7 @@ robot */ +#include #include //the basic tracker #include //some console output @@ -51,9 +52,13 @@ #include #include //init the feature database using the information about moment dependencies #include //visual servoing task + +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + // this function converts the plane defined by the cMo to 1/Z=Ax+By+C plane // form - void cMoToABC(vpHomogeneousMatrix &cMo, double &A, double &B, double &C); void cMoToABC(vpHomogeneousMatrix &cMo, double &A, double &B, double &C) diff --git a/example/manual/ogre/HelloWorldOgre.cpp b/example/manual/ogre/HelloWorldOgre.cpp index 96eba8cf33..36083fcf96 100644 --- a/example/manual/ogre/HelloWorldOgre.cpp +++ b/example/manual/ogre/HelloWorldOgre.cpp @@ -43,6 +43,7 @@ #include #include +#include #include #include #include @@ -54,6 +55,10 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + try { #if defined(VISP_HAVE_OGRE) #if defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_DC1394) || defined(HAVE_OPENCV_VIDEOIO) @@ -80,7 +85,7 @@ int main() if (!grabber.isOpened()) { // check if we succeeded std::cout << "Failed to open the camera" << std::endl; return EXIT_FAILURE; - } + } cv::Mat frame; grabber >> frame; // get a new frame from camera vpImageConvert::convert(frame, I); @@ -154,7 +159,7 @@ int main() std::cout << "You need Ogre3D to run this example" << std::endl; #endif return EXIT_SUCCESS; - } +} catch (const vpException &e) { std::cout << "Catch an exception: " << e << std::endl; return EXIT_FAILURE; diff --git a/example/manual/ogre/HelloWorldOgreAdvanced.cpp b/example/manual/ogre/HelloWorldOgreAdvanced.cpp index 2ca3f16904..e5ba4249dc 100644 --- a/example/manual/ogre/HelloWorldOgreAdvanced.cpp +++ b/example/manual/ogre/HelloWorldOgreAdvanced.cpp @@ -43,6 +43,7 @@ #include #include +#include #include #include #include @@ -54,6 +55,10 @@ #if defined(VISP_HAVE_OGRE) +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + #ifndef DOXYGEN_SHOULD_SKIP_THIS class vpAROgreAdvanced : public vpAROgre @@ -140,7 +145,7 @@ int main() if (!grabber.isOpened()) { // check if we succeeded std::cout << "Failed to open the camera" << std::endl; return EXIT_FAILURE; - } + } cv::Mat frame; grabber >> frame; // get a new frame from camera vpImageConvert::convert(frame, I); @@ -183,7 +188,7 @@ int main() std::cout << "You need Ogre3D to run this example" << std::endl; #endif return EXIT_SUCCESS; - } +} catch (const vpException &e) { std::cout << "Catch an exception: " << e << std::endl; return EXIT_FAILURE; diff --git a/example/manual/simulation/manServo4PointsDisplay.cpp b/example/manual/simulation/manServo4PointsDisplay.cpp index 58c5d7db00..995a155b77 100644 --- a/example/manual/simulation/manServo4PointsDisplay.cpp +++ b/example/manual/simulation/manServo4PointsDisplay.cpp @@ -69,6 +69,10 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + try { ////////////////////////////////////////// // sets the initial camera location @@ -223,5 +227,5 @@ int main() std::cout << "Tip if you are on a windows-like system:" << std::endl; std::cout << "- Install GDI, configure again ViSP using cmake and build again this example" << std::endl; return EXIT_SUCCESS; -} + } #endif diff --git a/example/manual/simulation/manSimu4Dots.cpp b/example/manual/simulation/manSimu4Dots.cpp index b2547edbfb..1a755d8e2f 100644 --- a/example/manual/simulation/manSimu4Dots.cpp +++ b/example/manual/simulation/manSimu4Dots.cpp @@ -77,6 +77,10 @@ #include #include +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + static void *mainLoop(void *_simu) { // pointer copy of the vpSimulator instance diff --git a/example/manual/simulation/manSimu4Points.cpp b/example/manual/simulation/manSimu4Points.cpp index 99502c3c62..3a14f3d45e 100644 --- a/example/manual/simulation/manSimu4Points.cpp +++ b/example/manual/simulation/manSimu4Points.cpp @@ -64,6 +64,10 @@ #include #include +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + static void *mainLoop(void *_simu) { // pointer copy of the vpSimulator instance diff --git a/example/math/BSpline.cpp b/example/math/BSpline.cpp index b3507584fb..e6f9ce696a 100644 --- a/example/math/BSpline.cpp +++ b/example/math/BSpline.cpp @@ -44,6 +44,7 @@ Describe a curve thanks to a BSpline. */ +#include #include #include @@ -71,6 +72,10 @@ // List of allowed command line options #define GETOPTARGS "cdh" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv, bool &click_allowed, bool &display); @@ -284,11 +289,11 @@ int main(int argc, const char **argv) } if (N != nullptr) - delete [] N; + delete[] N; if (N2 != nullptr) { for (unsigned int j = 0; j <= 2; j++) - delete [] N2[j]; - delete [] N2; + delete[] N2[j]; + delete[] N2; } return EXIT_SUCCESS; @@ -310,5 +315,5 @@ int main() std::cout << "Tip if you are on a windows-like system:" << std::endl; std::cout << "- Install GDI, configure again ViSP using cmake and build again this example" << std::endl; return EXIT_SUCCESS; -} + } #endif diff --git a/example/math/exponentialMap.cpp b/example/math/exponentialMap.cpp index 119a0b6b87..4304e25ee2 100644 --- a/example/math/exponentialMap.cpp +++ b/example/math/exponentialMap.cpp @@ -40,6 +40,7 @@ */ #include +#include #include #include #include @@ -49,6 +50,9 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif try { vpTranslationVector t; t[0] = 0.1; // t_x in m/s diff --git a/example/math/qp_plot.h b/example/math/qp_plot.h index 300acff88c..ecfe55f871 100644 --- a/example/math/qp_plot.h +++ b/example/math/qp_plot.h @@ -43,18 +43,18 @@ #include #ifndef DOXYGEN_SHOULD_SKIP_THIS -vpMatrix randM(int n, int m) +VISP_NAMESPACE_ADDRESSING vpMatrix randM(int n, int m) { - vpMatrix M(n, m); + VISP_NAMESPACE_ADDRESSING vpMatrix M(n, m); for (int i = 0; i < n; ++i) for (int j = 0; j < m; ++j) M[i][j] = (2. * rand()) / RAND_MAX - 1; return M; } -vpColVector randV(int n) +VISP_NAMESPACE_ADDRESSING vpColVector randV(int n) { - vpColVector M(n); + VISP_NAMESPACE_ADDRESSING vpColVector M(n); for (int i = 0; i < n; ++i) M[i] = (2. * rand()) / RAND_MAX - 1; return M; @@ -67,12 +67,12 @@ class QPlot virtual ~QPlot() { delete P; } QPlot(int graphNum, int total, std::vector legend) { - P = new vpPlot(graphNum, 700, 700, 100, 200, "Resolution time"); + P = new VISP_NAMESPACE_ADDRESSING vpPlot(graphNum, 700, 700, 100, 200, "Resolution time"); for (int i = 0; i < graphNum; ++i) { P->initGraph(i, 2); - P->setColor(i, 0, vpColor::red); - P->setColor(i, 1, vpColor::blue); + P->setColor(i, 0, VISP_NAMESPACE_ADDRESSING vpColor::red); + P->setColor(i, 1, VISP_NAMESPACE_ADDRESSING vpColor::blue); P->setGraphThickness(i, 2); P->initRange(i, 0, total, 0, 0.1); P->setUnitY(i, "ms"); @@ -82,10 +82,10 @@ class QPlot } } - void plot(int g, int c, int i, double t) { P->plot(g, c, i, vpTime::measureTimeMs() - t); } + void plot(int g, int c, int i, double t) { P->plot(g, c, i, VISP_NAMESPACE_ADDRESSING vpTime::measureTimeMs() - t); } void wait() { P->I.display->getClick(); } - vpPlot *P; + VISP_NAMESPACE_ADDRESSING vpPlot *P; private: // Copy constructor not allowed. diff --git a/example/math/quadprog.cpp b/example/math/quadprog.cpp index 6d89a741a2..617d08f31e 100644 --- a/example/math/quadprog.cpp +++ b/example/math/quadprog.cpp @@ -56,6 +56,10 @@ int main(int argc, char **argv) { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + const int n = 20; // x dim const int m = 10; // equality m < n const int p = 30; // inequality diff --git a/example/math/quadprog_eq.cpp b/example/math/quadprog_eq.cpp index 72d9ef40b1..85c3a00717 100644 --- a/example/math/quadprog_eq.cpp +++ b/example/math/quadprog_eq.cpp @@ -55,6 +55,10 @@ int main(int argc, char **argv) { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + const int n = 20; // x dim const int m = 10; // equality m < n const int p = 30; // inequality diff --git a/example/math/random.cpp b/example/math/random.cpp index 331b9c314f..13fafefc3b 100644 --- a/example/math/random.cpp +++ b/example/math/random.cpp @@ -1,8 +1,13 @@ #include +#include #include int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + vpUniRand rng; for (int i = 0; i < 10; i++) { std::cout << rng.uniform(0, 6) << std::endl; // produces int values @@ -10,22 +15,19 @@ int main() } std::vector v; - for(unsigned int i = 0; i < 10; i++) - { + for (unsigned int i = 0; i < 10; i++) { v.push_back(i); } std::vector shuffled_v = vpUniRand::shuffleVector(v); std::cout << "Original vector = [\t"; - for(unsigned int i = 0; i < 10; i++) - { + for (unsigned int i = 0; i < 10; i++) { std::cout << v[i] << "\t"; } std::cout << "]" << std::endl; std::cout << "Shuffled vector = [\t"; - for(unsigned int i = 0; i < 10; i++) - { + for (unsigned int i = 0; i < 10; i++) { std::cout << shuffled_v[i] << "\t"; } std::cout << "]" << std::endl; diff --git a/example/moments/image/servoMomentImage.cpp b/example/moments/image/servoMomentImage.cpp index e1c345b0a5..250a738333 100644 --- a/example/moments/image/servoMomentImage.cpp +++ b/example/moments/image/servoMomentImage.cpp @@ -42,6 +42,7 @@ #include #include +#include #include #include #include @@ -78,6 +79,10 @@ int main() } #else +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + #ifndef DOXYGEN_SHOULD_SKIP_THIS class servoMoment { diff --git a/example/moments/points/servoMomentPoints.cpp b/example/moments/points/servoMomentPoints.cpp index 9caf01c575..15d9d658b1 100644 --- a/example/moments/points/servoMomentPoints.cpp +++ b/example/moments/points/servoMomentPoints.cpp @@ -77,6 +77,10 @@ int main() } #else +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + #ifndef DOXYGEN_SHOULD_SKIP_THIS class servoMoment { diff --git a/example/moments/polygon/servoMomentPolygon.cpp b/example/moments/polygon/servoMomentPolygon.cpp index 6a55afb8fd..ad2dae20a8 100644 --- a/example/moments/polygon/servoMomentPolygon.cpp +++ b/example/moments/polygon/servoMomentPolygon.cpp @@ -76,6 +76,10 @@ int main() } #else +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + #ifndef DOXYGEN_SHOULD_SKIP_THIS class servoMoment { diff --git a/example/ogre-simulator/AROgre.cpp b/example/ogre-simulator/AROgre.cpp index 9e6699830b..3bb85a4c08 100644 --- a/example/ogre-simulator/AROgre.cpp +++ b/example/ogre-simulator/AROgre.cpp @@ -75,6 +75,10 @@ // List of allowed command line options #define GETOPTARGS "ci:p:h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! Print the program options. @@ -730,5 +734,5 @@ int main() std::cout << "- Install Ogre3D, configure again ViSP using cmake and build again this example" << std::endl; #endif return EXIT_SUCCESS; -} + } #endif diff --git a/example/ogre-simulator/AROgreBasic.cpp b/example/ogre-simulator/AROgreBasic.cpp index fd6869b368..774156e558 100644 --- a/example/ogre-simulator/AROgreBasic.cpp +++ b/example/ogre-simulator/AROgreBasic.cpp @@ -75,6 +75,10 @@ // List of allowed command line options #define GETOPTARGS "ci:p:h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! Print the program options. diff --git a/example/parse-argv/parse-argv1.cpp b/example/parse-argv/parse-argv1.cpp index 0764f3fa9b..b0b6117b69 100644 --- a/example/parse-argv/parse-argv1.cpp +++ b/example/parse-argv/parse-argv1.cpp @@ -50,11 +50,16 @@ #include #include #include +#include #include #include // List of allowed command line options #define GETOPTARGS "d:f:i:h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam, int i_val, float f_val, double d_val); bool getOptions(int argc, const char **argv, int &i_val, float &f_val, double &d_val); @@ -77,7 +82,7 @@ Parsing command line arguments example.\n\ SYNOPSIS\n\ %s [-i ] [-f ] [-d [-h]\n\ ", - name); +name); fprintf(stdout, "\n\ OPTIONS: Default\n\ @@ -173,7 +178,8 @@ int main(int argc, const char **argv) cout << "Call " << argv[0] << " -h to see how to change these parameters." << endl; return EXIT_SUCCESS; - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "Catch a ViSP exception: " << e << std::endl; return EXIT_FAILURE; } diff --git a/example/parse-argv/parse-argv2.cpp b/example/parse-argv/parse-argv2.cpp index bf8534c8a0..f23df14e1b 100644 --- a/example/parse-argv/parse-argv2.cpp +++ b/example/parse-argv/parse-argv2.cpp @@ -50,11 +50,16 @@ #include #include +#include #include #include int main(int argc, const char **argv) { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + try { using ::std::cout; using ::std::endl; @@ -74,7 +79,7 @@ int main(int argc, const char **argv) {"-double", vpParseArgv::ARGV_DOUBLE, (char *)nullptr, (char *)&double_val, "A double value."}, {"-string", vpParseArgv::ARGV_STRING, (char *)nullptr, (char *)&string_val, "A chain value."}, {"-h", vpParseArgv::ARGV_HELP, (char *)nullptr, (char *)nullptr, "Print the help."}, - {(char *)nullptr, vpParseArgv::ARGV_END, (char *)nullptr, (char *)nullptr, (char *)nullptr}}; + {(char *)nullptr, vpParseArgv::ARGV_END, (char *)nullptr, (char *)nullptr, (char *)nullptr} }; // Read the command line options if (vpParseArgv::parse(&argc, argv, argTable, vpParseArgv::ARGV_NO_DEFAULTS)) { @@ -95,7 +100,8 @@ int main(int argc, const char **argv) cout << "Call " << argv[0] << " -h to see how to change these parameters." << endl; return EXIT_SUCCESS; - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "Catch a ViSP exception: " << e.getStringMessage() << std::endl; return EXIT_FAILURE; } diff --git a/example/pose-estimation/poseVirtualVS.cpp b/example/pose-estimation/poseVirtualVS.cpp index d7cc269439..f3f70bc000 100644 --- a/example/pose-estimation/poseVirtualVS.cpp +++ b/example/pose-estimation/poseVirtualVS.cpp @@ -83,6 +83,10 @@ // List of allowed command line options #define GETOPTARGS "cdi:p:hf:l:s:" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! Print the program options. @@ -251,8 +255,8 @@ int main(int argc, const char **argv) std::cout << " poseVirtualVS.cpp" << std::endl << std::endl; std::cout << " Example of dots tracking in an image sequence and pose " - "computation" - << std::endl; + "computation" + << std::endl; std::cout << "-------------------------------------------------------" << std::endl; std::cout << std::endl; @@ -280,8 +284,8 @@ int main(int argc, const char **argv) if (ipath != env_ipath) { std::cout << std::endl << "WARNING: " << std::endl; std::cout << " Since -i " - << " is different from VISP_IMAGE_PATH=" << env_ipath << std::endl - << " we skip the environment variable." << std::endl; + << " is different from VISP_IMAGE_PATH=" << env_ipath << std::endl + << " we skip the environment variable." << std::endl; } } // Test if an input path is set @@ -289,11 +293,11 @@ int main(int argc, const char **argv) usage(argv[0], nullptr, ipath, opt_ppath, opt_first, opt_last, opt_step); std::cerr << std::endl << "ERROR:" << std::endl; std::cerr << " Use -i option or set VISP_INPUT_IMAGE_PATH " << std::endl - << " environment variable to specify the location of the " << std::endl - << " image path where test images are located." << std::endl - << " Use -p option if you want to " << std::endl - << " use personal images" << std::endl - << std::endl; + << " environment variable to specify the location of the " << std::endl + << " image path where test images are located." << std::endl + << " Use -p option if you want to " << std::endl + << " use personal images" << std::endl + << std::endl; return EXIT_FAILURE; } @@ -316,7 +320,8 @@ int main(int argc, const char **argv) s.setf(std::ios::right, std::ios::adjustfield); s << "image." << std::setw(4) << std::setfill('0') << iter << "." << ext; filename = vpIoTools::createFilePath(dirname, s.str()); - } else { + } + else { snprintf(cfilename, FILENAME_MAX, opt_ppath.c_str(), iter); filename = cfilename; @@ -333,7 +338,8 @@ int main(int argc, const char **argv) if (opt_display) { d[i].setGraphics(true); - } else { + } + else { d[i].setGraphics(false); } } @@ -341,13 +347,15 @@ int main(int argc, const char **argv) // Read image named filename and put the bitmap into in I. try { vpImageIo::read(I, filename); - } catch (...) { + } + catch (...) { if (opt_ppath.empty()) { std::cerr << std::endl << "ERROR:" << std::endl; std::cerr << " Cannot read " << filename << std::endl; std::cerr << " Check your -i " << ipath << " option, " << std::endl - << " or VISP_INPUT_IMAGE_PATH environment variable" << std::endl; - } else { + << " or VISP_INPUT_IMAGE_PATH environment variable" << std::endl; + } + else { std::cerr << std::endl << "ERROR:" << std::endl; std::cerr << " Cannot read " << filename << std::endl; std::cerr << " or your -p " << opt_ppath << " option " << std::endl << std::endl; @@ -406,7 +414,8 @@ int main(int argc, const char **argv) d[i].track(I, cog[i]); vpDisplay::flush(I); } - } else { + } + else { cog[0].set_u(194); cog[0].set_v(88); d[0].initTracking(I, cog[0]); @@ -533,7 +542,8 @@ int main(int argc, const char **argv) s.str(""); s << "image." << std::setw(4) << std::setfill('0') << iter << "." << ext; filename = vpIoTools::createFilePath(dirname, s.str()); - } else { + } + else { snprintf(cfilename, FILENAME_MAX, opt_ppath.c_str(), iter); filename = cfilename; } @@ -590,7 +600,8 @@ int main(int argc, const char **argv) iter += opt_step; } return EXIT_SUCCESS; - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "Catch a ViSP exception: " << e << std::endl; return EXIT_FAILURE; } @@ -605,7 +616,7 @@ int main() int main() { std::cout << "You do not have X11, or GTK, or GDI (Graphical Device Interface) functionalities to display images..." - << std::endl; + << std::endl; std::cout << "Tip if you are on a unix-like system:" << std::endl; std::cout << "- Install X11, configure again ViSP using cmake and build again this example" << std::endl; std::cout << "Tip if you are on a windows-like system:" << std::endl; diff --git a/example/reflex-takktile/takktile2-control.cpp b/example/reflex-takktile/takktile2-control.cpp index c264f5c481..92d9611d49 100644 --- a/example/reflex-takktile/takktile2-control.cpp +++ b/example/reflex-takktile/takktile2-control.cpp @@ -43,10 +43,15 @@ #include #include +#include #include int main(int argc, char *argv[]) { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + std::string opt_network_interface = "eth0"; std::string opt_finger_file_name = "yaml/finger_calibrate.yaml"; std::string opt_tactile_file_name = "yaml/tactile_calibrate.yaml"; @@ -63,12 +68,12 @@ int main(int argc, char *argv[]) opt_motor_file_name = atoi(argv[i + 1]); else if (std::string(argv[i]) == "--help" || std::string(argv[i]) == "-h") { std::cout << "\nUsage: " << argv[0] - << " [--network ] " - " [--finger ]" - " [--tactile ]" - " [--motor ]" - " [--help] [-h]\n" - << std::endl; + << " [--network ] " + " [--finger ]" + " [--tactile ]" + " [--motor ]" + " [--help] [-h]\n" + << std::endl; std::cout << "Options:" << std::endl; std::cout << " --network " << std::endl; std::cout << "\tNetwork interface name. Default: " << opt_network_interface << std::endl << std::endl; @@ -106,7 +111,7 @@ int main(int argc, char *argv[]) std::cout << "Moving fingers..." << std::endl; std::vector finger_positions = { - {0.0, 0.0, 0.0, 0.0}, {0.5, 0.5, 0.5, 0.0}, {1.0, 1.0, 1.0, 0.0}, {0.5, 0.5, 0.5, 0.0}, {0.0, 0.0, 0.0, 0.0}}; + {0.0, 0.0, 0.0, 0.0}, {0.5, 0.5, 0.5, 0.0}, {1.0, 1.0, 1.0, 0.0}, {0.5, 0.5, 0.5, 0.0}, {0.0, 0.0, 0.0, 0.0} }; for (size_t i = 0; i < finger_positions.size(); i++) { reflex.setPosition(finger_positions[i]); @@ -122,7 +127,7 @@ int main(int argc, char *argv[]) std::cout << "Moving preshape joint..." << std::endl; std::vector preshape_positions = { - {0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.5}, {0.0, 0.0, 0.0, 1.5}, {0.0, 0.0, 0.0, 0.5}, {0.0, 0.0, 0.0, 0.0}}; + {0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.5}, {0.0, 0.0, 0.0, 1.5}, {0.0, 0.0, 0.0, 0.5}, {0.0, 0.0, 0.0, 0.0} }; for (size_t i = 0; i < preshape_positions.size(); i++) { reflex.setPosition(preshape_positions[i]); @@ -136,7 +141,7 @@ int main(int argc, char *argv[]) // Demonstration of changing velocity std::cout << "Changing to faster speed..." << std::endl; - vpColVector faster_velocities = {7.0, 7.0, 7.0, 7.0}; + vpColVector faster_velocities = { 7.0, 7.0, 7.0, 7.0 }; reflex.setPositioningVelocity(faster_velocities); for (size_t i = 0; i < finger_positions.size(); i++) { @@ -145,7 +150,7 @@ int main(int argc, char *argv[]) } std::cout << "Changing to slower speed..." << std::endl; - vpColVector slower_velocities = {0.5, 0.5, 0.5, 0.5}; + vpColVector slower_velocities = { 0.5, 0.5, 0.5, 0.5 }; reflex.setPositioningVelocity(slower_velocities); for (size_t i = 0; i < finger_positions.size(); i++) { @@ -160,7 +165,7 @@ int main(int argc, char *argv[]) // Demonstration of blended control std::cout << "Starting blended control..." << std::endl; - vpColVector mixed_speeds = {0.5, 1.0, 1.5, 0.0}; + vpColVector mixed_speeds = { 0.5, 1.0, 1.5, 0.0 }; reflex.setPositioningVelocity(mixed_speeds); for (int i = 0; i < 5; i++) { @@ -177,8 +182,8 @@ int main(int argc, char *argv[]) // Demonstration of tactile feedback and setting sensor thresholds std::cout << "Starting tactile feedback..." << std::endl - << "All fingers will stop moving when any one makes contact" << std::endl; - vpColVector move_speeds = {1.25, 1.25, 1.25, 0}; + << "All fingers will stop moving when any one makes contact" << std::endl; + vpColVector move_speeds = { 1.25, 1.25, 1.25, 0 }; reflex.setTactileThreshold(15); @@ -191,8 +196,8 @@ int main(int argc, char *argv[]) /****************************************************/ std::cout << "Now each finger will only stop moving once it makes contact" << std::endl; - std::vector thresholds = {10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30}; + std::vector thresholds = { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30 }; reflex.setTactileThreshold(thresholds); diff --git a/example/reflex-takktile/takktile2-read-data.cpp b/example/reflex-takktile/takktile2-read-data.cpp index 8893304cfc..8a04cb7aa8 100644 --- a/example/reflex-takktile/takktile2-read-data.cpp +++ b/example/reflex-takktile/takktile2-read-data.cpp @@ -43,10 +43,15 @@ #include #include +#include #include -int main(int argc, char *argv []) +int main(int argc, char *argv[]) { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + std::string opt_network_interface = "eth0"; std::string opt_finger_file_name = "yaml/finger_calibrate.yaml"; std::string opt_tactile_file_name = "yaml/tactile_calibrate.yaml"; diff --git a/example/robot-simulator/afma6/servoSimuAfma6FourPoints2DCamVelocity.cpp b/example/robot-simulator/afma6/servoSimuAfma6FourPoints2DCamVelocity.cpp index cceca787e7..da6db8c56a 100644 --- a/example/robot-simulator/afma6/servoSimuAfma6FourPoints2DCamVelocity.cpp +++ b/example/robot-simulator/afma6/servoSimuAfma6FourPoints2DCamVelocity.cpp @@ -82,6 +82,10 @@ // List of allowed command line options #define GETOPTARGS "cdh" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv, bool &click_allowed, bool &display); diff --git a/example/robot-simulator/camera/servoSimu3D_cMcd_CamVelocity.cpp b/example/robot-simulator/camera/servoSimu3D_cMcd_CamVelocity.cpp index ba1b3875ba..0ff5f12aa5 100644 --- a/example/robot-simulator/camera/servoSimu3D_cMcd_CamVelocity.cpp +++ b/example/robot-simulator/camera/servoSimu3D_cMcd_CamVelocity.cpp @@ -54,6 +54,7 @@ #include #include +#include #include #include #include @@ -66,6 +67,10 @@ // List of allowed command line options #define GETOPTARGS "h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv); @@ -302,4 +307,4 @@ int main(int argc, const char **argv) std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl; return EXIT_SUCCESS; #endif -} + } diff --git a/example/robot-simulator/camera/servoSimu3D_cMcd_CamVelocityWithoutVpServo.cpp b/example/robot-simulator/camera/servoSimu3D_cMcd_CamVelocityWithoutVpServo.cpp index b855f56441..0a2a7c832e 100644 --- a/example/robot-simulator/camera/servoSimu3D_cMcd_CamVelocityWithoutVpServo.cpp +++ b/example/robot-simulator/camera/servoSimu3D_cMcd_CamVelocityWithoutVpServo.cpp @@ -78,6 +78,7 @@ #include #include +#include #include #include #include @@ -90,6 +91,10 @@ // List of allowed command line options #define GETOPTARGS "h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv); diff --git a/example/robot-simulator/camera/servoSimu3D_cdMc_CamVelocity.cpp b/example/robot-simulator/camera/servoSimu3D_cdMc_CamVelocity.cpp index 0f54aefe77..28f350cc43 100644 --- a/example/robot-simulator/camera/servoSimu3D_cdMc_CamVelocity.cpp +++ b/example/robot-simulator/camera/servoSimu3D_cdMc_CamVelocity.cpp @@ -55,6 +55,7 @@ #include #include +#include #include #include #include @@ -67,6 +68,10 @@ // List of allowed command line options #define GETOPTARGS "h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv); @@ -298,4 +303,4 @@ int main(int argc, const char **argv) std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl; return EXIT_SUCCESS; #endif -} + } diff --git a/example/robot-simulator/camera/servoSimu3D_cdMc_CamVelocityWithoutVpServo.cpp b/example/robot-simulator/camera/servoSimu3D_cdMc_CamVelocityWithoutVpServo.cpp index 37cb1dfb9c..aa6d867348 100644 --- a/example/robot-simulator/camera/servoSimu3D_cdMc_CamVelocityWithoutVpServo.cpp +++ b/example/robot-simulator/camera/servoSimu3D_cdMc_CamVelocityWithoutVpServo.cpp @@ -71,6 +71,7 @@ #include #include +#include #include #include #include @@ -82,6 +83,10 @@ // List of allowed command line options #define GETOPTARGS "h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv); diff --git a/example/robot-simulator/camera/servoSimuCircle2DCamVelocity.cpp b/example/robot-simulator/camera/servoSimuCircle2DCamVelocity.cpp index 2ab28359fc..f2f6b1f04f 100644 --- a/example/robot-simulator/camera/servoSimuCircle2DCamVelocity.cpp +++ b/example/robot-simulator/camera/servoSimuCircle2DCamVelocity.cpp @@ -54,6 +54,7 @@ #include #include +#include #include #include #include @@ -65,6 +66,10 @@ // List of allowed command line options #define GETOPTARGS "h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv); @@ -240,4 +245,4 @@ int main(int argc, const char **argv) std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl; return EXIT_SUCCESS; #endif -} + } diff --git a/example/robot-simulator/camera/servoSimuCircle2DCamVelocityDisplay.cpp b/example/robot-simulator/camera/servoSimuCircle2DCamVelocityDisplay.cpp index e8679dc4ee..ea79faf6da 100644 --- a/example/robot-simulator/camera/servoSimuCircle2DCamVelocityDisplay.cpp +++ b/example/robot-simulator/camera/servoSimuCircle2DCamVelocityDisplay.cpp @@ -71,6 +71,10 @@ // List of allowed command line options #define GETOPTARGS "cdh" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv, bool &click_allowed, bool &display); diff --git a/example/robot-simulator/camera/servoSimuCylinder2DCamVelocityDisplay.cpp b/example/robot-simulator/camera/servoSimuCylinder2DCamVelocityDisplay.cpp index 303387dd4a..95f3746640 100644 --- a/example/robot-simulator/camera/servoSimuCylinder2DCamVelocityDisplay.cpp +++ b/example/robot-simulator/camera/servoSimuCylinder2DCamVelocityDisplay.cpp @@ -71,6 +71,10 @@ // List of allowed command line options #define GETOPTARGS "cdh" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv, bool &click_allowed, bool &display); diff --git a/example/robot-simulator/camera/servoSimuCylinder2DCamVelocityDisplaySecondaryTask.cpp b/example/robot-simulator/camera/servoSimuCylinder2DCamVelocityDisplaySecondaryTask.cpp index 7599c18c77..c263b4ee1c 100644 --- a/example/robot-simulator/camera/servoSimuCylinder2DCamVelocityDisplaySecondaryTask.cpp +++ b/example/robot-simulator/camera/servoSimuCylinder2DCamVelocityDisplaySecondaryTask.cpp @@ -53,6 +53,7 @@ #include #include +#include #include #include #include @@ -73,6 +74,10 @@ // List of allowed command line options #define GETOPTARGS "cdho" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv, bool &click_allowed, bool &display); @@ -422,13 +427,14 @@ int main(int argc, const char **argv) if (opt_display && opt_click_allowed) { std::stringstream ss; ss << std::string("New projection operator: ") + - (opt_new_proj_operator ? std::string("yes (use option -o to use old one)") : std::string("no")); + (opt_new_proj_operator ? std::string("yes (use option -o to use old one)") : std::string("no")); vpDisplay::displayText(Iint, 20, 20, "Secondary task enabled: yes", vpColor::white); vpDisplay::displayText(Iint, 40, 20, ss.str(), vpColor::white); } iter_sec++; - } else { + } + else { if (opt_display && opt_click_allowed) { vpDisplay::displayText(Iint, 20, 20, "Secondary task: no", vpColor::white); } @@ -462,7 +468,8 @@ int main(int argc, const char **argv) // Display task information task.print(); return EXIT_SUCCESS; - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "Catch a ViSP exception: " << e << std::endl; return EXIT_FAILURE; } @@ -472,4 +479,4 @@ int main(int argc, const char **argv) std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl; return EXIT_SUCCESS; #endif -} + } diff --git a/example/robot-simulator/camera/servoSimuFourPoints2DCamVelocity.cpp b/example/robot-simulator/camera/servoSimuFourPoints2DCamVelocity.cpp index ef9b263aa9..c02062c1a5 100644 --- a/example/robot-simulator/camera/servoSimuFourPoints2DCamVelocity.cpp +++ b/example/robot-simulator/camera/servoSimuFourPoints2DCamVelocity.cpp @@ -62,6 +62,10 @@ // List of allowed command line options #define GETOPTARGS "h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv); @@ -271,4 +275,4 @@ int main(int argc, const char **argv) std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl; return EXIT_SUCCESS; #endif -} + } diff --git a/example/robot-simulator/camera/servoSimuFourPoints2DCamVelocityDisplay.cpp b/example/robot-simulator/camera/servoSimuFourPoints2DCamVelocityDisplay.cpp index 219d880f03..c544164ae6 100644 --- a/example/robot-simulator/camera/servoSimuFourPoints2DCamVelocityDisplay.cpp +++ b/example/robot-simulator/camera/servoSimuFourPoints2DCamVelocityDisplay.cpp @@ -78,6 +78,10 @@ // List of allowed command line options #define GETOPTARGS "cdh" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv, bool &click_allowed, bool &display); diff --git a/example/robot-simulator/camera/servoSimuFourPoints2DPolarCamVelocityDisplay.cpp b/example/robot-simulator/camera/servoSimuFourPoints2DPolarCamVelocityDisplay.cpp index 7612b05139..e2eaceb36d 100644 --- a/example/robot-simulator/camera/servoSimuFourPoints2DPolarCamVelocityDisplay.cpp +++ b/example/robot-simulator/camera/servoSimuFourPoints2DPolarCamVelocityDisplay.cpp @@ -80,6 +80,10 @@ // List of allowed command line options #define GETOPTARGS "cdh" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv, bool &click_allowed, bool &display); @@ -191,7 +195,8 @@ int main(int argc, const char **argv) try { // Create the dirname vpIoTools::makeDirectory(logdirname); - } catch (...) { + } + catch (...) { std::cerr << std::endl << "ERROR:" << std::endl; std::cerr << " Cannot create " << logdirname << std::endl; return EXIT_FAILURE; @@ -468,7 +473,8 @@ int main(int argc, const char **argv) vpDisplay::getClick(Iint); } return EXIT_SUCCESS; - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "Catch a ViSP exception: " << e << std::endl; return EXIT_FAILURE; } @@ -477,11 +483,11 @@ int main(int argc, const char **argv) int main() { std::cout << "You do not have X11, or GTK, or GDI (Graphical Device Interface) functionalities to display images..." - << std::endl; + << std::endl; std::cout << "Tip if you are on a unix-like system:" << std::endl; std::cout << "- Install X11, configure again ViSP using cmake and build again this example" << std::endl; std::cout << "Tip if you are on a windows-like system:" << std::endl; std::cout << "- Install GDI, configure again ViSP using cmake and build again this example" << std::endl; return EXIT_SUCCESS; -} + } #endif diff --git a/example/robot-simulator/camera/servoSimuLine2DCamVelocityDisplay.cpp b/example/robot-simulator/camera/servoSimuLine2DCamVelocityDisplay.cpp index 7b5df1375c..05c8cb7921 100644 --- a/example/robot-simulator/camera/servoSimuLine2DCamVelocityDisplay.cpp +++ b/example/robot-simulator/camera/servoSimuLine2DCamVelocityDisplay.cpp @@ -69,6 +69,10 @@ // List of allowed command line options #define GETOPTARGS "cdh" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv, bool &click_allowed, bool &display); @@ -190,7 +194,8 @@ int main(int argc, const char **argv) // display variable. vpDisplay::display(I); vpDisplay::flush(I); - } catch (...) { + } + catch (...) { vpERROR_TRACE("Error while displaying the image"); return EXIT_FAILURE; } @@ -308,7 +313,8 @@ int main(int argc, const char **argv) // Display task information task.print(); return EXIT_SUCCESS; - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "Catch a ViSP exception: " << e << std::endl; return EXIT_FAILURE; } @@ -324,7 +330,7 @@ int main() int main() { std::cout << "You do not have X11, or GTK, or GDI (Graphical Device Interface) functionalities to display images..." - << std::endl; + << std::endl; std::cout << "Tip if you are on a unix-like system:" << std::endl; std::cout << "- Install X11, configure again ViSP using cmake and build again this example" << std::endl; std::cout << "Tip if you are on a windows-like system:" << std::endl; diff --git a/example/robot-simulator/camera/servoSimuPoint2DCamVelocity1.cpp b/example/robot-simulator/camera/servoSimuPoint2DCamVelocity1.cpp index c08dbc4585..ea5743dbcf 100644 --- a/example/robot-simulator/camera/servoSimuPoint2DCamVelocity1.cpp +++ b/example/robot-simulator/camera/servoSimuPoint2DCamVelocity1.cpp @@ -44,6 +44,7 @@ #include #include +#include #include #include #include @@ -55,6 +56,10 @@ // List of allowed command line options #define GETOPTARGS "h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv); @@ -218,4 +223,4 @@ int main(int argc, const char **argv) std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl; return EXIT_SUCCESS; #endif -} + } diff --git a/example/robot-simulator/camera/servoSimuPoint2DCamVelocity2.cpp b/example/robot-simulator/camera/servoSimuPoint2DCamVelocity2.cpp index d6c81008fa..c91d12493d 100644 --- a/example/robot-simulator/camera/servoSimuPoint2DCamVelocity2.cpp +++ b/example/robot-simulator/camera/servoSimuPoint2DCamVelocity2.cpp @@ -52,6 +52,7 @@ #include #include +#include #include #include #include @@ -63,6 +64,10 @@ // List of allowed command line options #define GETOPTARGS "h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv); @@ -250,4 +255,4 @@ int main(int argc, const char **argv) std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl; return EXIT_SUCCESS; #endif -} + } diff --git a/example/robot-simulator/camera/servoSimuPoint2DCamVelocity3.cpp b/example/robot-simulator/camera/servoSimuPoint2DCamVelocity3.cpp index b8cc4108a7..dd6f6f0aa4 100644 --- a/example/robot-simulator/camera/servoSimuPoint2DCamVelocity3.cpp +++ b/example/robot-simulator/camera/servoSimuPoint2DCamVelocity3.cpp @@ -50,6 +50,7 @@ #include #include +#include #include #include #include @@ -61,6 +62,10 @@ // List of allowed command line options #define GETOPTARGS "h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv); @@ -246,4 +251,4 @@ int main(int argc, const char **argv) std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl; return EXIT_SUCCESS; #endif -} + } diff --git a/example/robot-simulator/camera/servoSimuPoint2DhalfCamVelocity1.cpp b/example/robot-simulator/camera/servoSimuPoint2DhalfCamVelocity1.cpp index ba6cbbab63..a40dcae8d8 100644 --- a/example/robot-simulator/camera/servoSimuPoint2DhalfCamVelocity1.cpp +++ b/example/robot-simulator/camera/servoSimuPoint2DhalfCamVelocity1.cpp @@ -46,6 +46,7 @@ #include #include +#include #include #include #include @@ -60,6 +61,10 @@ // List of allowed command line options #define GETOPTARGS "h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv); @@ -262,4 +267,4 @@ int main(int argc, const char **argv) std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl; return EXIT_SUCCESS; #endif -} + } diff --git a/example/robot-simulator/camera/servoSimuPoint2DhalfCamVelocity2.cpp b/example/robot-simulator/camera/servoSimuPoint2DhalfCamVelocity2.cpp index b7f2d5b898..bb010efd48 100644 --- a/example/robot-simulator/camera/servoSimuPoint2DhalfCamVelocity2.cpp +++ b/example/robot-simulator/camera/servoSimuPoint2DhalfCamVelocity2.cpp @@ -45,6 +45,7 @@ #include #include +#include #include #include #include @@ -59,6 +60,10 @@ // List of allowed command line options #define GETOPTARGS "h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv); @@ -351,4 +356,4 @@ int main(int argc, const char **argv) std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl; return EXIT_SUCCESS; #endif -} + } diff --git a/example/robot-simulator/camera/servoSimuPoint2DhalfCamVelocity3.cpp b/example/robot-simulator/camera/servoSimuPoint2DhalfCamVelocity3.cpp index 9756d6d924..121ae424df 100644 --- a/example/robot-simulator/camera/servoSimuPoint2DhalfCamVelocity3.cpp +++ b/example/robot-simulator/camera/servoSimuPoint2DhalfCamVelocity3.cpp @@ -45,6 +45,7 @@ #include #include +#include #include #include #include @@ -59,6 +60,10 @@ // List of allowed command line options #define GETOPTARGS "h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv); @@ -329,4 +334,4 @@ int main(int argc, const char **argv) std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl; return EXIT_SUCCESS; #endif -} + } diff --git a/example/robot-simulator/camera/servoSimuPoint3DCamVelocity.cpp b/example/robot-simulator/camera/servoSimuPoint3DCamVelocity.cpp index d83137b22a..b5b6a2876f 100644 --- a/example/robot-simulator/camera/servoSimuPoint3DCamVelocity.cpp +++ b/example/robot-simulator/camera/servoSimuPoint3DCamVelocity.cpp @@ -46,6 +46,7 @@ #include #include +#include #include #include #include @@ -57,6 +58,10 @@ // List of allowed command line options #define GETOPTARGS "h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv); @@ -228,4 +233,4 @@ int main(int argc, const char **argv) std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl; return EXIT_SUCCESS; #endif -} + } diff --git a/example/robot-simulator/camera/servoSimuSphere2DCamVelocity.cpp b/example/robot-simulator/camera/servoSimuSphere2DCamVelocity.cpp index d0fda0cc78..d63a988b2c 100644 --- a/example/robot-simulator/camera/servoSimuSphere2DCamVelocity.cpp +++ b/example/robot-simulator/camera/servoSimuSphere2DCamVelocity.cpp @@ -45,6 +45,7 @@ #include #include +#include #include #include #include @@ -57,6 +58,10 @@ // List of allowed command line options #define GETOPTARGS "h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv); @@ -220,7 +225,8 @@ int main(int argc, const char **argv) // Display task information task.print(); return EXIT_SUCCESS; - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "Catch a ViSP exception: " << e << std::endl; return EXIT_FAILURE; } @@ -230,4 +236,4 @@ int main(int argc, const char **argv) std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl; return EXIT_SUCCESS; #endif -} + } diff --git a/example/robot-simulator/camera/servoSimuSphere2DCamVelocityDisplay.cpp b/example/robot-simulator/camera/servoSimuSphere2DCamVelocityDisplay.cpp index c0d1dffc75..5f27292174 100644 --- a/example/robot-simulator/camera/servoSimuSphere2DCamVelocityDisplay.cpp +++ b/example/robot-simulator/camera/servoSimuSphere2DCamVelocityDisplay.cpp @@ -45,6 +45,7 @@ #include #include +#include #include #include #include @@ -62,6 +63,10 @@ // List of allowed command line options #define GETOPTARGS "cdh" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv, bool &click_allowed, bool &display); @@ -279,7 +284,8 @@ int main(int argc, const char **argv) // Display task information task.print(); return EXIT_SUCCESS; - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "Catch a ViSP exception: " << e << std::endl; return EXIT_FAILURE; } @@ -289,4 +295,4 @@ int main(int argc, const char **argv) std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl; return EXIT_SUCCESS; #endif -} + } diff --git a/example/robot-simulator/camera/servoSimuSphere2DCamVelocityDisplaySecondaryTask.cpp b/example/robot-simulator/camera/servoSimuSphere2DCamVelocityDisplaySecondaryTask.cpp index 99b0da9da4..b6700ad69a 100644 --- a/example/robot-simulator/camera/servoSimuSphere2DCamVelocityDisplaySecondaryTask.cpp +++ b/example/robot-simulator/camera/servoSimuSphere2DCamVelocityDisplaySecondaryTask.cpp @@ -46,6 +46,7 @@ #include #include +#include #include #include #include @@ -65,6 +66,10 @@ // List of allowed command line options #define GETOPTARGS "cdho" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv, bool &click_allowed, bool &display); @@ -342,11 +347,12 @@ int main(int argc, const char **argv) if (opt_display && opt_click_allowed) { std::stringstream ss; ss << std::string("New projection operator: ") + - (opt_new_proj_operator ? std::string("yes (use option -o to use old one)") : std::string("no")); + (opt_new_proj_operator ? std::string("yes (use option -o to use old one)") : std::string("no")); vpDisplay::displayText(I, 20, 20, "Secondary task enabled: yes", vpColor::white); vpDisplay::displayText(I, 40, 20, ss.str(), vpColor::white); } - } else { + } + else { if (opt_display && opt_click_allowed) { vpDisplay::displayText(I, 20, 20, "Secondary task enabled: no", vpColor::white); } @@ -378,7 +384,8 @@ int main(int argc, const char **argv) // Display task information task.print(); return EXIT_SUCCESS; - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "Catch a ViSP exception: " << e << std::endl; return EXIT_FAILURE; } @@ -388,4 +395,4 @@ int main(int argc, const char **argv) std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl; return EXIT_SUCCESS; #endif -} + } diff --git a/example/robot-simulator/camera/servoSimuSquareLine2DCamVelocityDisplay.cpp b/example/robot-simulator/camera/servoSimuSquareLine2DCamVelocityDisplay.cpp index 06defae5d3..ec13d35c09 100644 --- a/example/robot-simulator/camera/servoSimuSquareLine2DCamVelocityDisplay.cpp +++ b/example/robot-simulator/camera/servoSimuSquareLine2DCamVelocityDisplay.cpp @@ -70,6 +70,10 @@ // List of allowed command line options #define GETOPTARGS "cdh" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv, bool &click_allowed, bool &display); @@ -191,7 +195,8 @@ int main(int argc, const char **argv) // display variable. vpDisplay::display(I); vpDisplay::flush(I); - } catch (...) { + } + catch (...) { vpERROR_TRACE("Error while displaying the image"); return EXIT_FAILURE; } @@ -319,7 +324,8 @@ int main(int argc, const char **argv) // Display task information task.print(); return EXIT_SUCCESS; - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "Catch a ViSP exception: " << e << std::endl; return EXIT_FAILURE; } @@ -335,8 +341,8 @@ int main() int main() { std::cout << "You do not have X11, or GTK, or GDI (Graphical Device Interface) or OpenCV functionalities to display " - "images..." - << std::endl; + "images..." + << std::endl; std::cout << "Tip if you are on a unix-like system:" << std::endl; std::cout << "- Install X11, configure again ViSP using cmake and build again this example" << std::endl; std::cout << "Tip if you are on a windows-like system:" << std::endl; diff --git a/example/robot-simulator/camera/servoSimuThetaUCamVelocity.cpp b/example/robot-simulator/camera/servoSimuThetaUCamVelocity.cpp index 2d4553acc4..f0df9b5be6 100644 --- a/example/robot-simulator/camera/servoSimuThetaUCamVelocity.cpp +++ b/example/robot-simulator/camera/servoSimuThetaUCamVelocity.cpp @@ -48,6 +48,7 @@ #include #include +#include #include #include #include @@ -58,6 +59,11 @@ // List of allowed command line options #define GETOPTARGS "h" + +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv); /*! @@ -220,4 +226,4 @@ int main(int argc, const char **argv) std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl; return EXIT_SUCCESS; #endif -} + } diff --git a/example/robot-simulator/viper850/servoSimuViper850FourPoints2DCamVelocity.cpp b/example/robot-simulator/viper850/servoSimuViper850FourPoints2DCamVelocity.cpp index 64e82c5d71..29136037b8 100644 --- a/example/robot-simulator/viper850/servoSimuViper850FourPoints2DCamVelocity.cpp +++ b/example/robot-simulator/viper850/servoSimuViper850FourPoints2DCamVelocity.cpp @@ -82,6 +82,10 @@ // List of allowed command line options #define GETOPTARGS "cdh" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv, bool &click_allowed, bool &display); diff --git a/example/servo-afma4/moveAfma4.cpp b/example/servo-afma4/moveAfma4.cpp index 5594c45864..1dc5ad25a6 100644 --- a/example/servo-afma4/moveAfma4.cpp +++ b/example/servo-afma4/moveAfma4.cpp @@ -63,6 +63,10 @@ // List of allowed command line options #define GETOPTARGS "mh" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! Print the program options. @@ -80,7 +84,7 @@ of the Afma4 robot.\n\ SYNOPSIS\n\ %s [-m] [-h]\n\ ", - name); +name); fprintf(stdout, "\n\ OPTIONS: Default\n\ @@ -184,39 +188,39 @@ int main(int argc, const char **argv) // std::cout << "Velocity control: in articular..." << std::endl; - q = 0 ; - q[0] = vpMath::rad(2) ; // rotation around vertical axis + q = 0; + q[0] = vpMath::rad(2); // rotation around vertical axis std::cout << " rotation around vertical axis: " << q[0] << std::endl; if (control) - robot.setVelocity(vpRobot::ARTICULAR_FRAME, q) ; - sleep(5) ; + robot.setVelocity(vpRobot::ARTICULAR_FRAME, q); + sleep(5); - q = 0 ; - q[1] = 0.2 ; // Vertical translation + q = 0; + q[1] = 0.2; // Vertical translation std::cout << " vertical translation: " << q[1] << std::endl; if (control) - robot.setVelocity(vpRobot::ARTICULAR_FRAME, q) ; - sleep(5) ; + robot.setVelocity(vpRobot::ARTICULAR_FRAME, q); + sleep(5); - q = 0 ; - q[1] = -0.2 ; // Vertical translation + q = 0; + q[1] = -0.2; // Vertical translation std::cout << " vertical translation: " << q[1] << std::endl; if (control) - robot.setVelocity(vpRobot::ARTICULAR_FRAME, q) ; - sleep(5) ; - q = 0 ; - q[2] = vpMath::rad(3) ; // pan + robot.setVelocity(vpRobot::ARTICULAR_FRAME, q); + sleep(5); + q = 0; + q[2] = vpMath::rad(3); // pan std::cout << " pan rotation: " << q[2] << std::endl; if (control) - robot.setVelocity(vpRobot::ARTICULAR_FRAME, q) ; - sleep(5) ; + robot.setVelocity(vpRobot::ARTICULAR_FRAME, q); + sleep(5); - q = 0 ; - q[3] = vpMath::rad(2) ; // tilt + q = 0; + q[3] = vpMath::rad(2); // tilt std::cout << " tilt rotation: " << q[3] << std::endl; if (control) - robot.setVelocity(vpRobot::ARTICULAR_FRAME, q) ; - sleep(5) ; + robot.setVelocity(vpRobot::ARTICULAR_FRAME, q); + sleep(5); #endif // // Velocity control in camera frame @@ -241,7 +245,8 @@ int main(int argc, const char **argv) std::cout << "The end" << std::endl; return EXIT_SUCCESS; - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "Catch a ViSP exception: " << e << std::endl; return EXIT_FAILURE; } diff --git a/example/servo-afma4/servoAfma4Point2DArtVelocity.cpp b/example/servo-afma4/servoAfma4Point2DArtVelocity.cpp index d6f9fa9033..f573583197 100644 --- a/example/servo-afma4/servoAfma4Point2DArtVelocity.cpp +++ b/example/servo-afma4/servoAfma4Point2DArtVelocity.cpp @@ -89,6 +89,10 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + try { // Log file creation in /tmp/$USERNAME/log.dat // This file contains by line: diff --git a/example/servo-afma4/servoAfma4Point2DCamVelocity.cpp b/example/servo-afma4/servoAfma4Point2DCamVelocity.cpp index 495d65c96a..7d42b92cc6 100644 --- a/example/servo-afma4/servoAfma4Point2DCamVelocity.cpp +++ b/example/servo-afma4/servoAfma4Point2DCamVelocity.cpp @@ -85,6 +85,10 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + try { // Log file creation in /tmp/$USERNAME/log.dat // This file contains by line: diff --git a/example/servo-afma4/servoAfma4Point2DCamVelocityKalman.cpp b/example/servo-afma4/servoAfma4Point2DCamVelocityKalman.cpp index 92b6e79237..ed853419f3 100644 --- a/example/servo-afma4/servoAfma4Point2DCamVelocityKalman.cpp +++ b/example/servo-afma4/servoAfma4Point2DCamVelocityKalman.cpp @@ -79,6 +79,10 @@ // List of allowed command line options #define GETOPTARGS "hK:l:" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + typedef enum { K_NONE, K_VELOCITY, K_ACCELERATION } KalmanType; /*! diff --git a/example/servo-afma6/servoAfma62DhalfCamVelocity.cpp b/example/servo-afma6/servoAfma62DhalfCamVelocity.cpp index 1933aa3007..f9fd83024c 100644 --- a/example/servo-afma6/servoAfma62DhalfCamVelocity.cpp +++ b/example/servo-afma6/servoAfma62DhalfCamVelocity.cpp @@ -96,6 +96,10 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + try { vpImage I; diff --git a/example/servo-afma6/servoAfma6AprilTagIBVS.cpp b/example/servo-afma6/servoAfma6AprilTagIBVS.cpp index c18c321ef5..af8c1f6535 100644 --- a/example/servo-afma6/servoAfma6AprilTagIBVS.cpp +++ b/example/servo-afma6/servoAfma6AprilTagIBVS.cpp @@ -54,6 +54,7 @@ #include #include +#include #include #include #include @@ -68,6 +69,10 @@ #if defined(VISP_HAVE_REALSENSE2) && (defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)) && defined(VISP_HAVE_AFMA6) +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void display_point_trajectory(const vpImage &I, const std::vector &vip, std::vector *traj_vip) { diff --git a/example/servo-afma6/servoAfma6AprilTagPBVS.cpp b/example/servo-afma6/servoAfma6AprilTagPBVS.cpp index e5e567549b..7481d7a968 100644 --- a/example/servo-afma6/servoAfma6AprilTagPBVS.cpp +++ b/example/servo-afma6/servoAfma6AprilTagPBVS.cpp @@ -51,6 +51,7 @@ #include #include +#include #include #include #include @@ -65,6 +66,10 @@ #if defined(VISP_HAVE_REALSENSE2) && (defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)) && defined(VISP_HAVE_AFMA6) +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void display_point_trajectory(const vpImage &I, const std::vector &vip, std::vector *traj_vip) { diff --git a/example/servo-afma6/servoAfma6Cylinder2DCamVelocity.cpp b/example/servo-afma6/servoAfma6Cylinder2DCamVelocity.cpp index dd9b5a756b..f795460c20 100644 --- a/example/servo-afma6/servoAfma6Cylinder2DCamVelocity.cpp +++ b/example/servo-afma6/servoAfma6Cylinder2DCamVelocity.cpp @@ -79,6 +79,10 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + try { vpImage I; diff --git a/example/servo-afma6/servoAfma6Cylinder2DCamVelocitySecondaryTask.cpp b/example/servo-afma6/servoAfma6Cylinder2DCamVelocitySecondaryTask.cpp index 82598ebebb..171e24f705 100644 --- a/example/servo-afma6/servoAfma6Cylinder2DCamVelocitySecondaryTask.cpp +++ b/example/servo-afma6/servoAfma6Cylinder2DCamVelocitySecondaryTask.cpp @@ -83,6 +83,10 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + try { vpImage I; diff --git a/example/servo-afma6/servoAfma6Ellipse2DCamVelocity.cpp b/example/servo-afma6/servoAfma6Ellipse2DCamVelocity.cpp index 3bbb90bc34..f417fd8b37 100644 --- a/example/servo-afma6/servoAfma6Ellipse2DCamVelocity.cpp +++ b/example/servo-afma6/servoAfma6Ellipse2DCamVelocity.cpp @@ -83,6 +83,10 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + try { vpServo task; diff --git a/example/servo-afma6/servoAfma6FourPoints2DArtVelocity.cpp b/example/servo-afma6/servoAfma6FourPoints2DArtVelocity.cpp index eb9580def4..dfed3fbf53 100644 --- a/example/servo-afma6/servoAfma6FourPoints2DArtVelocity.cpp +++ b/example/servo-afma6/servoAfma6FourPoints2DArtVelocity.cpp @@ -94,6 +94,10 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + // Log file creation in /tmp/$USERNAME/log.dat // This file contains by line: // - the 6 computed joint velocities (m/s, rad/s) to achieve the task diff --git a/example/servo-afma6/servoAfma6FourPoints2DCamVelocityLs_cur.cpp b/example/servo-afma6/servoAfma6FourPoints2DCamVelocityLs_cur.cpp index 9cc611dd43..a34fd93593 100644 --- a/example/servo-afma6/servoAfma6FourPoints2DCamVelocityLs_cur.cpp +++ b/example/servo-afma6/servoAfma6FourPoints2DCamVelocityLs_cur.cpp @@ -90,6 +90,10 @@ #define L 0.06 // to deal with a 12cm by 12cm square +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! Compute the pose \e cMo from the 3D coordinates of the points \e point and diff --git a/example/servo-afma6/servoAfma6FourPoints2DCamVelocityLs_des.cpp b/example/servo-afma6/servoAfma6FourPoints2DCamVelocityLs_des.cpp index 8da9ff666d..ce31d9306b 100644 --- a/example/servo-afma6/servoAfma6FourPoints2DCamVelocityLs_des.cpp +++ b/example/servo-afma6/servoAfma6FourPoints2DCamVelocityLs_des.cpp @@ -91,6 +91,10 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + // Log file creation in /tmp/$USERNAME/log.dat // This file contains by line: // - the 6 computed camera velocities (m/s, rad/s) to achieve the task diff --git a/example/servo-afma6/servoAfma6Line2DCamVelocity.cpp b/example/servo-afma6/servoAfma6Line2DCamVelocity.cpp index 609d342d5a..b59498161e 100644 --- a/example/servo-afma6/servoAfma6Line2DCamVelocity.cpp +++ b/example/servo-afma6/servoAfma6Line2DCamVelocity.cpp @@ -79,6 +79,10 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + try { vpImage I; diff --git a/example/servo-afma6/servoAfma6MegaposePBVS.cpp b/example/servo-afma6/servoAfma6MegaposePBVS.cpp index ad9b59eb86..4016c14888 100644 --- a/example/servo-afma6/servoAfma6MegaposePBVS.cpp +++ b/example/servo-afma6/servoAfma6MegaposePBVS.cpp @@ -63,6 +63,7 @@ #include #include +#include #include #include #include @@ -89,6 +90,10 @@ using json = nlohmann::json; //! json namespace shortcut #endif +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + std::optional detectObjectForInitMegaposeClick(const vpImage &I) { const bool startLabelling = vpDisplay::getClick(I, false); diff --git a/example/servo-afma6/servoAfma6Point2DArtVelocity.cpp b/example/servo-afma6/servoAfma6Point2DArtVelocity.cpp index c18f38a93e..e0d96a6dc8 100644 --- a/example/servo-afma6/servoAfma6Point2DArtVelocity.cpp +++ b/example/servo-afma6/servoAfma6Point2DArtVelocity.cpp @@ -88,6 +88,10 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + // Log file creation in /tmp/$USERNAME/log.dat // This file contains by line: // - the 6 computed joint velocities (m/s, rad/s) to achieve the task diff --git a/example/servo-afma6/servoAfma6Point2DCamVelocity.cpp b/example/servo-afma6/servoAfma6Point2DCamVelocity.cpp index a2f8e06c0c..f2cbf4c61b 100644 --- a/example/servo-afma6/servoAfma6Point2DCamVelocity.cpp +++ b/example/servo-afma6/servoAfma6Point2DCamVelocity.cpp @@ -80,6 +80,10 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + // Log file creation in /tmp/$USERNAME/log.dat // This file contains by line: // - the 6 computed cam velocities (m/s, rad/s) to achieve the task diff --git a/example/servo-afma6/servoAfma6Points2DCamVelocityEyeToHand.cpp b/example/servo-afma6/servoAfma6Points2DCamVelocityEyeToHand.cpp index aaae0a0205..e648fbc99f 100644 --- a/example/servo-afma6/servoAfma6Points2DCamVelocityEyeToHand.cpp +++ b/example/servo-afma6/servoAfma6Points2DCamVelocityEyeToHand.cpp @@ -87,6 +87,10 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + try { std::string username = vpIoTools::getUserName(); std::string logdirname = "/tmp/" + username; diff --git a/example/servo-afma6/servoAfma6Segment2DCamVelocity.cpp b/example/servo-afma6/servoAfma6Segment2DCamVelocity.cpp index c39eaac2ee..fb07398fcc 100644 --- a/example/servo-afma6/servoAfma6Segment2DCamVelocity.cpp +++ b/example/servo-afma6/servoAfma6Segment2DCamVelocity.cpp @@ -74,6 +74,10 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + // Log file creation in /tmp/$USERNAME/log.dat // This file contains by line: // - the 6 computed cam velocities (m/s, rad/s) to achieve the task diff --git a/example/servo-afma6/servoAfma6SquareLines2DCamVelocity.cpp b/example/servo-afma6/servoAfma6SquareLines2DCamVelocity.cpp index 130afff54d..d0bc247c77 100644 --- a/example/servo-afma6/servoAfma6SquareLines2DCamVelocity.cpp +++ b/example/servo-afma6/servoAfma6SquareLines2DCamVelocity.cpp @@ -85,6 +85,10 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + try { vpImage I; diff --git a/example/servo-afma6/servoAfma6TwoLines2DCamVelocity.cpp b/example/servo-afma6/servoAfma6TwoLines2DCamVelocity.cpp index c0b496b4df..73bdd66dae 100644 --- a/example/servo-afma6/servoAfma6TwoLines2DCamVelocity.cpp +++ b/example/servo-afma6/servoAfma6TwoLines2DCamVelocity.cpp @@ -86,6 +86,10 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + try { vpImage I; diff --git a/example/servo-bebop2/keyboardControlBebop2.cpp b/example/servo-bebop2/keyboardControlBebop2.cpp index dc53acf7b5..bdf03033e8 100644 --- a/example/servo-bebop2/keyboardControlBebop2.cpp +++ b/example/servo-bebop2/keyboardControlBebop2.cpp @@ -48,6 +48,10 @@ #ifdef VISP_HAVE_ARSDK +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! Sends movement commands to the \e drone based on a keyboard input \e key. @@ -129,7 +133,8 @@ bool handleKeyboardInput(vpRobotBebop2 &drone, int key) break; } vpTime::wait(25); // We wait 25ms to give the drone the time to process the command - } else { + } + else { running = false; } return running; @@ -159,37 +164,41 @@ int main(int argc, char **argv) if (std::string(argv[i]) == "--ip" && i + 1 < argc) { ip_address = std::string(argv[i + 1]); i++; - } else if (std::string(argv[i]) == "--hd_stream") { + } + else if (std::string(argv[i]) == "--hd_stream") { stream_res = 1; - } else if (std::string(argv[i]) == "--verbose" || std::string(argv[i]) == "-v") { + } + else if (std::string(argv[i]) == "--verbose" || std::string(argv[i]) == "-v") { verbose = true; - } else if (argc >= 2 && (std::string(argv[1]) == "--help" || std::string(argv[1]) == "-h")) { + } + else if (argc >= 2 && (std::string(argv[1]) == "--help" || std::string(argv[1]) == "-h")) { std::cout << "\nUsage:\n" - << " " << argv[0] << "[--ip ] [--hd_stream] [--verbose] [-v] [--help] [-h]\n" - << std::endl - << "Description:\n" - << " --ip \n" - << " Ip address of the drone to which you want to connect (default : 192.168.42.1).\n\n" - << " --hd_stream\n" - << " Enables HD 720p streaming instead of default 480p.\n" - << " --verbose, -v\n" - << " Enables verbose (drone information messages and velocity commands\n" - << " are then displayed).\n\n" - << " --help, -h\n" - << " Print help message.\n" - << std::endl; + << " " << argv[0] << "[--ip ] [--hd_stream] [--verbose] [-v] [--help] [-h]\n" + << std::endl + << "Description:\n" + << " --ip \n" + << " Ip address of the drone to which you want to connect (default : 192.168.42.1).\n\n" + << " --hd_stream\n" + << " Enables HD 720p streaming instead of default 480p.\n" + << " --verbose, -v\n" + << " Enables verbose (drone information messages and velocity commands\n" + << " are then displayed).\n\n" + << " --help, -h\n" + << " Print help message.\n" + << std::endl; return EXIT_SUCCESS; - } else { + } + else { std::cout << "Error : unknown parameter " << argv[i] << std::endl - << "See " << argv[0] << " --help" << std::endl; + << "See " << argv[0] << " --help" << std::endl; return EXIT_FAILURE; } } std::cout << "\nWARNING: this program does no sensing or avoiding of obstacles, " - "the drone WILL collide with any objects in the way! Make sure the " - "drone has approximately 3 meters of free space on all sides.\n" - << std::endl; + "the drone WILL collide with any objects in the way! Make sure the " + "drone has approximately 3 meters of free space on all sides.\n" + << std::endl; vpRobotBebop2 drone(verbose, true, ip_address); // Create the drone with low verbose level, settings reset and corresponding IP @@ -221,10 +230,10 @@ int main(int argc, char **argv) vpKeyboard keyboard; std::cout << "\n| Control the drone with the keyboard :\n" - "| 't' to takeoff / spacebar to land / 'e' for emergency stop\n" - "| ('r','f','d','g') and ('i','k','j','l') to move\n" - "| 'q' to quit.\n" - << std::endl; + "| 't' to takeoff / spacebar to land / 'e' for emergency stop\n" + "| ('r','f','d','g') and ('i','k','j','l') to move\n" + "| 'q' to quit.\n" + << std::endl; while (running && drone.isRunning() && drone.isStreaming()) { @@ -243,11 +252,13 @@ int main(int argc, char **argv) } std::cout << "\nQuitting ...\n" << std::endl; - } else { + } + else { std::cout << "ERROR : failed to setup drone control." << std::endl; return EXIT_FAILURE; } - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "\nCaught an exception: " << e << std::endl; return EXIT_FAILURE; } diff --git a/example/servo-bebop2/servoBebop2.cpp b/example/servo-bebop2/servoBebop2.cpp index 90fe22ab2f..69e94fec9d 100644 --- a/example/servo-bebop2/servoBebop2.cpp +++ b/example/servo-bebop2/servoBebop2.cpp @@ -82,6 +82,10 @@ int main() #else +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + bool compareImagePoint(std::pair p1, std::pair p2) { return (p1.second.get_v() < p2.second.get_v()); diff --git a/example/servo-biclops/moveBiclops.cpp b/example/servo-biclops/moveBiclops.cpp index 55cce1c1a8..a0f1161aaa 100644 --- a/example/servo-biclops/moveBiclops.cpp +++ b/example/servo-biclops/moveBiclops.cpp @@ -53,6 +53,10 @@ // List of allowed command line options #define GETOPTARGS "c:h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /* * Print the program options. * diff --git a/example/servo-biclops/servoBiclopsPoint2DArtVelocity.cpp b/example/servo-biclops/servoBiclopsPoint2DArtVelocity.cpp index 1f0bef8868..442263f789 100644 --- a/example/servo-biclops/servoBiclopsPoint2DArtVelocity.cpp +++ b/example/servo-biclops/servoBiclopsPoint2DArtVelocity.cpp @@ -67,6 +67,10 @@ // List of allowed command line options #define GETOPTARGS "c:d:h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! * Print the program options. * diff --git a/example/servo-flir-ptu/servoFlirPtuIBVS.cpp b/example/servo-flir-ptu/servoFlirPtuIBVS.cpp index 6676140d35..f6145229f5 100644 --- a/example/servo-flir-ptu/servoFlirPtuIBVS.cpp +++ b/example/servo-flir-ptu/servoFlirPtuIBVS.cpp @@ -58,6 +58,7 @@ #include #include +#include #include #include #include @@ -74,6 +75,10 @@ #if defined(VISP_HAVE_FLIR_PTU_SDK) && defined(VISP_HAVE_FLYCAPTURE) && \ (defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)) && defined(VISP_HAVE_PUGIXML) +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void display_point_trajectory(const vpImage &I, const vpImagePoint &ip, std::vector &traj_ip) { diff --git a/example/servo-franka/frankaGripper.cpp b/example/servo-franka/frankaGripper.cpp index eafd67d8b9..76a5c73938 100644 --- a/example/servo-franka/frankaGripper.cpp +++ b/example/servo-franka/frankaGripper.cpp @@ -40,11 +40,13 @@ #include +#include #include #if defined(VISP_HAVE_FRANKA) -typedef enum { +typedef enum +{ Gripper_Home, Gripper_Open, Gripper_Close, @@ -56,6 +58,10 @@ typedef enum { int main(int argc, char **argv) { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + std::string opt_robot_ip = "192.168.1.1"; double opt_grasping_width = 0.; GripperState_t opt_gripper_state = Gripper_None; @@ -63,28 +69,34 @@ int main(int argc, char **argv) for (int i = 1; i < argc; i++) { if (std::string(argv[i]) == "--ip" && i + 1 < argc) { opt_robot_ip = std::string(argv[i + 1]); - } else if (std::string(argv[i]) == "--home") { + } + else if (std::string(argv[i]) == "--home") { opt_gripper_state = Gripper_Home; - } else if (std::string(argv[i]) == "--open") { + } + else if (std::string(argv[i]) == "--open") { opt_gripper_state = Gripper_Open; - } else if (std::string(argv[i]) == "--close") { + } + else if (std::string(argv[i]) == "--close") { opt_gripper_state = Gripper_Close; - } else if (std::string(argv[i]) == "--grasp" && i + 1 < argc) { + } + else if (std::string(argv[i]) == "--grasp" && i + 1 < argc) { opt_gripper_state = Gripper_Grasp; opt_grasping_width = std::atof(argv[i + 1]); - } else if (std::string(argv[i]) == "--test" && i + 1 < argc) { + } + else if (std::string(argv[i]) == "--test" && i + 1 < argc) { opt_gripper_state = Gripper_Test; opt_grasping_width = std::atof(argv[i + 1]); - } else if (std::string(argv[i]) == "--help" || std::string(argv[i]) == "-h") { + } + else if (std::string(argv[i]) == "--help" || std::string(argv[i]) == "-h") { std::cout << "Control Panda gripper." << std::endl; std::cout << argv[0] << " [--ip ] [--home] [--open] [--close] [--grasp ] [--release] [--test ] [--help] [-h]\n" - << std::endl; + << ">] [--home] [--open] [--close] [--grasp ] [--release] [--test ] [--help] [-h]\n" + << std::endl; std::cout << "Example to grasp a 4cm width object by first opening the gripper, then grasping the object :\n" - << argv[0] << " --ip 192.168.100.1 --open\n" - << argv[0] << " --ip 192.168.100.1 --grasp 0.04\n" - << std::endl; + << argv[0] << " --ip 192.168.100.1 --open\n" + << argv[0] << " --ip 192.168.100.1 --grasp 0.04\n" + << std::endl; return EXIT_SUCCESS; } @@ -92,11 +104,12 @@ int main(int argc, char **argv) if (opt_gripper_state == Gripper_None) { std::cout << "Specify which action you want to achieve. Run \"" << argv[0] - << " --help\" to see how to use this binary." << std::endl; + << " --help\" to see how to use this binary." << std::endl; return EXIT_SUCCESS; - } else if ((opt_gripper_state == Gripper_Grasp || opt_gripper_state == Gripper_Test) && opt_grasping_width <= 0) { + } + else if ((opt_gripper_state == Gripper_Grasp || opt_gripper_state == Gripper_Test) && opt_grasping_width <= 0) { std::cout << "Object with in meter should be > 0. Run \"" << argv[0] << " --help\" to see how to use this binary." - << std::endl; + << std::endl; return EXIT_SUCCESS; } @@ -108,19 +121,24 @@ int main(int argc, char **argv) if (opt_gripper_state == Gripper_Home) { std::cout << "Gripper homing..." << std::endl; robot.gripperHoming(); - } else if (opt_gripper_state == Gripper_Close) { + } + else if (opt_gripper_state == Gripper_Close) { std::cout << "Gripper closing..." << std::endl; robot.gripperClose(); - } else if (opt_gripper_state == Gripper_Open) { + } + else if (opt_gripper_state == Gripper_Open) { std::cout << "Gripper opening..." << std::endl; robot.gripperOpen(); - } else if (opt_gripper_state == Gripper_Grasp) { + } + else if (opt_gripper_state == Gripper_Grasp) { std::cout << "Gripper grasp " << opt_grasping_width << "m object width..." << std::endl; robot.gripperGrasp(opt_grasping_width); - } else if (opt_gripper_state == Gripper_Release) { + } + else if (opt_gripper_state == Gripper_Release) { std::cout << "Gripper release object..." << std::endl; robot.gripperRelease(); - } else if (opt_gripper_state == Gripper_Test) { + } + else if (opt_gripper_state == Gripper_Test) { std::cout << "Test gripper performing the following actions:" << std::endl; std::cout << "- Gripper homing..." << std::endl; robot.gripperHoming(); @@ -141,16 +159,19 @@ int main(int argc, char **argv) robot.gripperRelease(); } std::cout << "The end!" << std::endl; - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "ViSP exception: " << e.what() << std::endl; return EXIT_FAILURE; - } catch (const franka::NetworkException &e) { + } + catch (const franka::NetworkException &e) { std::cout << "Franka network exception: " << e.what() << std::endl; std::cout << "Check if you are connected to the Franka robot" - << " or if you specified the right IP using --ip command line option set by default to 192.168.1.1. " - << std::endl; + << " or if you specified the right IP using --ip command line option set by default to 192.168.1.1. " + << std::endl; return EXIT_FAILURE; - } catch (const std::exception &e) { + } + catch (const std::exception &e) { std::cout << "Franka exception: " << e.what() << std::endl; return EXIT_FAILURE; } diff --git a/example/servo-franka/frankaMoveToPosition.cpp b/example/servo-franka/frankaMoveToPosition.cpp index 1bf6b6129e..6934f24599 100644 --- a/example/servo-franka/frankaMoveToPosition.cpp +++ b/example/servo-franka/frankaMoveToPosition.cpp @@ -40,6 +40,7 @@ #include +#include #include #include @@ -47,18 +48,24 @@ int main(int argc, char **argv) { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + std::string opt_robot_ip = "192.168.1.1"; std::string opt_position_filename = ""; for (int i = 1; i < argc; i++) { if (std::string(argv[i]) == "--ip" && i + 1 < argc) { opt_robot_ip = std::string(argv[i + 1]); - } else if (std::string(argv[i]) == "--read" && i + 1 < argc) { + } + else if (std::string(argv[i]) == "--read" && i + 1 < argc) { opt_position_filename = std::string(argv[i + 1]); - } else if (std::string(argv[i]) == "--help" || std::string(argv[i]) == "-h") { + } + else if (std::string(argv[i]) == "--help" || std::string(argv[i]) == "-h") { std::cout << "Move Panda robot to a position specified from a file." << std::endl; std::cout << argv[0] << " [--ip ] [--read ] [--help] [-h]\n" - << std::endl; + << std::endl; std::cout << "Example:\n" << argv[0] << " --ip 192.168.100.1 --read position.pos\n" << std::endl; return EXIT_SUCCESS; @@ -72,7 +79,7 @@ int main(int argc, char **argv) } if (!vpIoTools::checkFilename(opt_position_filename)) { std::cout << "\nError: position filename \"" << opt_position_filename << "\" given as input doesn't exist. " - << std::endl; + << std::endl; std::cout << "Call \"" << argv[0] << " --help\" to get usage" << std::endl; return EXIT_FAILURE; } @@ -83,18 +90,21 @@ int main(int argc, char **argv) robot.connect(opt_robot_ip); robot.move(opt_position_filename); - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "ViSP exception: " << e.what() << std::endl; std::cout << "Stop the robot " << std::endl; robot.setRobotState(vpRobot::STATE_STOP); return EXIT_FAILURE; - } catch (const franka::NetworkException &e) { + } + catch (const franka::NetworkException &e) { std::cout << "Franka network exception: " << e.what() << std::endl; std::cout << "Check if you are connected to the Franka robot" - << " or if you specified the right IP using --ip command line option set by default to 192.168.1.1. " - << std::endl; + << " or if you specified the right IP using --ip command line option set by default to 192.168.1.1. " + << std::endl; return EXIT_FAILURE; - } catch (const std::exception &e) { + } + catch (const std::exception &e) { std::cout << "Franka exception: " << e.what() << std::endl; return EXIT_FAILURE; } diff --git a/example/servo-franka/frankaSavePosition.cpp b/example/servo-franka/frankaSavePosition.cpp index a9ea627981..f10dbbbeba 100644 --- a/example/servo-franka/frankaSavePosition.cpp +++ b/example/servo-franka/frankaSavePosition.cpp @@ -40,25 +40,31 @@ #include +#include #include #if defined(VISP_HAVE_FRANKA) int main(int argc, char **argv) { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif std::string opt_robot_ip = "192.168.1.1"; std::string opt_position_filename = "position.pos"; for (int i = 1; i < argc; i++) { if (std::string(argv[i]) == "--ip" && i + 1 < argc) { opt_robot_ip = std::string(argv[i + 1]); - } else if (std::string(argv[i]) == "--save" && i + 1 < argc) { + } + else if (std::string(argv[i]) == "--save" && i + 1 < argc) { opt_position_filename = std::string(argv[i + 1]); - } else if (std::string(argv[i]) == "--help" || std::string(argv[i]) == "-h") { + } + else if (std::string(argv[i]) == "--help" || std::string(argv[i]) == "-h") { std::cout << "Save Panda robot position in a file." << std::endl; std::cout << "Usage:\n" << std::endl; std::cout << argv[0] << " [--ip ] [--save ] [--help] [-h]\n" - << std::endl; + << std::endl; std::cout << "Example:\n" << argv[0] << " --ip 192.168.100.1 --save position.pos\n" << std::endl; return EXIT_SUCCESS; @@ -75,18 +81,21 @@ int main(int argc, char **argv) robot.savePosFile(opt_position_filename, q); std::cout << "Robot position saved in \"" << opt_position_filename << "\"" << std::endl; - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "ViSP exception: " << e.what() << std::endl; std::cout << "Stop the robot " << std::endl; robot.setRobotState(vpRobot::STATE_STOP); return EXIT_FAILURE; - } catch (const franka::NetworkException &e) { + } + catch (const franka::NetworkException &e) { std::cout << "Franka network exception: " << e.what() << std::endl; std::cout << "Check if you are connected to the Franka robot" - << " or if you specified the right IP using --ip command line option set by default to 192.168.1.1. " - << std::endl; + << " or if you specified the right IP using --ip command line option set by default to 192.168.1.1. " + << std::endl; return EXIT_FAILURE; - } catch (const std::exception &e) { + } + catch (const std::exception &e) { std::cout << "Franka exception: " << e.what() << std::endl; return EXIT_FAILURE; } diff --git a/example/servo-franka/servoFrankaIBVS.cpp b/example/servo-franka/servoFrankaIBVS.cpp index ebc5433d64..b255252a3d 100644 --- a/example/servo-franka/servoFrankaIBVS.cpp +++ b/example/servo-franka/servoFrankaIBVS.cpp @@ -62,6 +62,7 @@ #include #include +#include #include #include #include @@ -76,6 +77,10 @@ #if defined(VISP_HAVE_REALSENSE2) && (defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)) && defined(VISP_HAVE_FRANKA) +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void display_point_trajectory(const vpImage &I, const std::vector &vip, std::vector *traj_vip) { diff --git a/example/servo-franka/servoFrankaPBVS.cpp b/example/servo-franka/servoFrankaPBVS.cpp index d758747fbf..2f79bd7f74 100644 --- a/example/servo-franka/servoFrankaPBVS.cpp +++ b/example/servo-franka/servoFrankaPBVS.cpp @@ -59,6 +59,7 @@ #include #include +#include #include #include #include @@ -73,6 +74,10 @@ #if defined(VISP_HAVE_REALSENSE2) && (defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)) && defined(VISP_HAVE_FRANKA) +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void display_point_trajectory(const vpImage &I, const std::vector &vip, std::vector *traj_vip) { diff --git a/example/servo-kinova/servoKinovaJacoCart.cpp b/example/servo-kinova/servoKinovaJacoCart.cpp index deb8af0803..bd1f1a75b0 100644 --- a/example/servo-kinova/servoKinovaJacoCart.cpp +++ b/example/servo-kinova/servoKinovaJacoCart.cpp @@ -48,6 +48,10 @@ int main(int argc, char *argv[]) { #ifdef VISP_HAVE_JACOSDK +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + std::string opt_plugin_path = "./"; vpRobotKinova::CommandLayer opt_command_layer = vpRobotKinova::CMD_LAYER_UNSET; bool opt_verbose = false; @@ -61,44 +65,49 @@ int main(int argc, char *argv[]) if ((std::string(argv[i]) == "--command_layer" || std::string(argv[i]) == "-l") && i + 1 < argc) { if (std::string(argv[i + 1]) == "usb") { opt_command_layer = vpRobotKinova::CMD_LAYER_USB; - } else if (std::string(argv[i + 1]) == "ethernet") { + } + else if (std::string(argv[i + 1]) == "ethernet") { opt_command_layer = vpRobotKinova::CMD_LAYER_ETHERNET; - } else { + } + else { opt_command_layer = vpRobotKinova::CMD_LAYER_UNSET; } - } else if (std::string(argv[i]) == "--dof") { + } + else if (std::string(argv[i]) == "--dof") { opt_dof = static_cast(std::atoi(argv[i + 1])); - } else if (std::string(argv[i]) == "--verbose" || std::string(argv[i]) == "-v") { + } + else if (std::string(argv[i]) == "--verbose" || std::string(argv[i]) == "-v") { opt_verbose = true; - } else if (std::string(argv[i]) == "--help" || std::string(argv[i]) == "-h") { + } + else if (std::string(argv[i]) == "--help" || std::string(argv[i]) == "-h") { std::cout << "SYNOPSYS" << std::endl - << " " << argv[0] << " [--plugin ] [--command_layer ] [--dof <4,6,7>] " - << "[--verbose] [--help] [-v] [-h]\n" - << std::endl; + << " " << argv[0] << " [--plugin ] [--command_layer ] [--dof <4,6,7>] " + << "[--verbose] [--help] [-v] [-h]\n" + << std::endl; std::cout << "DESCRIPTION" << std::endl - << " --plugin " << std::endl - << " Path to Jaco SDK .so or .dll plugin location. Default: \"./\"." << std::endl - << std::endl - << " --command_layer , -l " << std::endl - << " Command layer name, either \"usb\" or \"ethernet\"." << std::endl - << std::endl - << " --dof" << std::endl - << " Degrees of freedom. Possible values are 4, 6 or 7. Default value: 6." << std::endl - << std::endl - << " --verbose, -v" << std::endl - << " Enable verbose mode to print addition information." << std::endl - << std::endl - << " --help, -h" << std::endl - << " Print this helper message." << std::endl - << std::endl; + << " --plugin " << std::endl + << " Path to Jaco SDK .so or .dll plugin location. Default: \"./\"." << std::endl + << std::endl + << " --command_layer , -l " << std::endl + << " Command layer name, either \"usb\" or \"ethernet\"." << std::endl + << std::endl + << " --dof" << std::endl + << " Degrees of freedom. Possible values are 4, 6 or 7. Default value: 6." << std::endl + << std::endl + << " --verbose, -v" << std::endl + << " Enable verbose mode to print addition information." << std::endl + << std::endl + << " --help, -h" << std::endl + << " Print this helper message." << std::endl + << std::endl; std::cout << "EXAMPLE" << std::endl #ifdef __linux__ - << " " << argv[0] << " --plugin /opt/JACO-SDK/API" + << " " << argv[0] << " --plugin /opt/JACO-SDK/API" #elif _WIN32 - << " " << argv[0] << " --plugin \"C:\\Program Files(x86)\\JACO - SDK\\API\\x64\"" + << " " << argv[0] << " --plugin \"C:\\Program Files(x86)\\JACO - SDK\\API\\x64\"" #endif - << " --command_layer usb" << std::endl - << std::endl; + << " --command_layer usb" << std::endl + << std::endl; return EXIT_SUCCESS; } @@ -156,7 +165,8 @@ int main(int argc, char *argv[]) // Move back to home position robot.setPosition(vpRobot::END_EFFECTOR_FRAME, p); - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "Catch exception: " << e.getStringMessage() << std::endl; } diff --git a/example/servo-kinova/servoKinovaJacoJoint.cpp b/example/servo-kinova/servoKinovaJacoJoint.cpp index 81c27d559e..77a2a6a467 100644 --- a/example/servo-kinova/servoKinovaJacoJoint.cpp +++ b/example/servo-kinova/servoKinovaJacoJoint.cpp @@ -48,6 +48,10 @@ int main(int argc, char *argv[]) { #ifdef VISP_HAVE_JACOSDK +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + std::string opt_plugin_path = "./"; vpRobotKinova::CommandLayer opt_command_layer = vpRobotKinova::CMD_LAYER_UNSET; bool opt_verbose = false; @@ -61,44 +65,49 @@ int main(int argc, char *argv[]) if ((std::string(argv[i]) == "--command_layer" || std::string(argv[i]) == "-l") && i + 1 < argc) { if (std::string(argv[i + 1]) == "usb") { opt_command_layer = vpRobotKinova::CMD_LAYER_USB; - } else if (std::string(argv[i + 1]) == "ethernet") { + } + else if (std::string(argv[i + 1]) == "ethernet") { opt_command_layer = vpRobotKinova::CMD_LAYER_ETHERNET; - } else { + } + else { opt_command_layer = vpRobotKinova::CMD_LAYER_UNSET; } - } else if (std::string(argv[i]) == "--dof") { + } + else if (std::string(argv[i]) == "--dof") { opt_dof = static_cast(std::atoi(argv[i + 1])); - } else if (std::string(argv[i]) == "--verbose" || std::string(argv[i]) == "-v") { + } + else if (std::string(argv[i]) == "--verbose" || std::string(argv[i]) == "-v") { opt_verbose = true; - } else if (std::string(argv[i]) == "--help" || std::string(argv[i]) == "-h") { + } + else if (std::string(argv[i]) == "--help" || std::string(argv[i]) == "-h") { std::cout << "SYNOPSYS" << std::endl - << " " << argv[0] << " [--plugin ] [--command_layer ] [--dof <4,6,7>] " - << "[--verbose] [--help] [-v] [-h]\n" - << std::endl; + << " " << argv[0] << " [--plugin ] [--command_layer ] [--dof <4,6,7>] " + << "[--verbose] [--help] [-v] [-h]\n" + << std::endl; std::cout << "DESCRIPTION" << std::endl - << " --plugin " << std::endl - << " Path to Jaco SDK .so or .dll plugin location. Default: \"./\"." << std::endl - << std::endl - << " --command_layer , -l " << std::endl - << " Command layer name, either \"usb\" or \"ethernet\"." << std::endl - << std::endl - << " --dof" << std::endl - << " Degrees of freedom. Possible values are 4, 6 or 7. Default value: 6." << std::endl - << std::endl - << " --verbose, -v" << std::endl - << " Enable verbose mode to print addition information." << std::endl - << std::endl - << " --help, -h" << std::endl - << " Print this helper message." << std::endl - << std::endl; + << " --plugin " << std::endl + << " Path to Jaco SDK .so or .dll plugin location. Default: \"./\"." << std::endl + << std::endl + << " --command_layer , -l " << std::endl + << " Command layer name, either \"usb\" or \"ethernet\"." << std::endl + << std::endl + << " --dof" << std::endl + << " Degrees of freedom. Possible values are 4, 6 or 7. Default value: 6." << std::endl + << std::endl + << " --verbose, -v" << std::endl + << " Enable verbose mode to print addition information." << std::endl + << std::endl + << " --help, -h" << std::endl + << " Print this helper message." << std::endl + << std::endl; std::cout << "EXAMPLE" << std::endl #ifdef __linux__ - << " " << argv[0] << " --plugin /opt/JACO-SDK/API" + << " " << argv[0] << " --plugin /opt/JACO-SDK/API" #elif _WIN32 - << " " << argv[0] << " --plugin \"C:\\Program Files(x86)\\JACO - SDK\\API\\x64\"" + << " " << argv[0] << " --plugin \"C:\\Program Files(x86)\\JACO - SDK\\API\\x64\"" #endif - << " --command_layer usb" << std::endl - << std::endl; + << " --command_layer usb" << std::endl + << std::endl; return EXIT_SUCCESS; } @@ -155,9 +164,10 @@ int main(int argc, char *argv[]) // Move back to home position robot.setPosition(vpRobot::JOINT_STATE, q); - } catch (const vpException &e) { - std::cout << "Catch exception: " << e.getStringMessage() << std::endl; } + catch (const vpException &e) { + std::cout << "Catch exception: " << e.getStringMessage() << std::endl; +} std::cout << "The end" << std::endl; return EXIT_SUCCESS; diff --git a/example/servo-pioneer/movePioneer.cpp b/example/servo-pioneer/movePioneer.cpp index 65c0707534..a7e97f9f78 100644 --- a/example/servo-pioneer/movePioneer.cpp +++ b/example/servo-pioneer/movePioneer.cpp @@ -43,8 +43,8 @@ int main() { std::cout << "\nThis example requires Aria 3rd party library. You should " - "install it.\n" - << std::endl; + "install it.\n" + << std::endl; return EXIT_SUCCESS; } @@ -64,13 +64,17 @@ int main() */ int main(int argc, char **argv) { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + try { std::cout << "\nWARNING: this program does no sensing or avoiding of " - "obstacles, \n" - "the robot WILL collide with any objects in the way! Make sure " - "the \n" - "robot has approximately 3 meters of free space on all sides.\n" - << std::endl; + "obstacles, \n" + "the robot WILL collide with any objects in the way! Make sure " + "the \n" + "robot has approximately 3 meters of free space on all sides.\n" + << std::endl; vpRobotPioneer robot; @@ -138,7 +142,8 @@ int main(int argc, char **argv) // exit ArLog::log(ArLog::Normal, "simpleMotionCommands: Exiting."); return EXIT_SUCCESS; - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "Catch an exception: " << e << std::endl; return EXIT_FAILURE; } diff --git a/example/servo-pioneer/servoPioneerPanSegment3D.cpp b/example/servo-pioneer/servoPioneerPanSegment3D.cpp index e85c553c72..c9e0bbccb9 100644 --- a/example/servo-pioneer/servoPioneerPanSegment3D.cpp +++ b/example/servo-pioneer/servoPioneerPanSegment3D.cpp @@ -80,6 +80,10 @@ #if defined(VISP_HAVE_PIONEER) && defined(VISP_HAVE_BICLOPS) int main(int argc, char **argv) { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + #if defined(VISP_HAVE_DC1394) || defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_CMU1394) #if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) try { @@ -266,7 +270,7 @@ int main(int argc, char **argv) // Use here a feature segment builder vpFeatureSegment s_segment(normalized), - s_segment_d(normalized); // From the segment feature we use only alpha + s_segment_d(normalized); // From the segment feature we use only alpha vpFeatureBuilder::create(s_segment, cam, dot[0], dot[1]); s_segment.setZ1(Z[0]); s_segment.setZ2(Z[1]); @@ -378,7 +382,7 @@ int main(int argc, char **argv) v_biclops[1] = 0; std::cout << "Send velocity to the pionner: " << v_pioneer[0] << " m/s " << vpMath::deg(v_pioneer[1]) - << " deg/s" << std::endl; + << " deg/s" << std::endl; std::cout << "Send velocity to the Biclops head: " << vpMath::deg(v_biclops[0]) << " deg/s" << std::endl; pioneer.setVelocity(vpRobot::REFERENCE_FRAME, v_pioneer); @@ -397,7 +401,8 @@ int main(int argc, char **argv) iter++; // break; } - } catch (...) { + } + catch (...) { } #ifdef USE_REAL_ROBOT @@ -411,7 +416,8 @@ int main(int argc, char **argv) // Kill the servo task task.print(); return EXIT_SUCCESS; - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "Catch an exception: " << e << std::endl; return EXIT_FAILURE; } diff --git a/example/servo-pioneer/servoPioneerPoint2DDepth.cpp b/example/servo-pioneer/servoPioneerPoint2DDepth.cpp index f263086b6f..d6427e9ed9 100644 --- a/example/servo-pioneer/servoPioneerPoint2DDepth.cpp +++ b/example/servo-pioneer/servoPioneerPoint2DDepth.cpp @@ -93,6 +93,10 @@ #ifdef TEST_COULD_BE_ACHIEVED int main(int argc, char **argv) { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + try { vpImage I; // Create a gray level image container double depth = 1.; diff --git a/example/servo-pioneer/servoPioneerPoint2DDepthWithoutVpServo.cpp b/example/servo-pioneer/servoPioneerPoint2DDepthWithoutVpServo.cpp index 212fd073fe..0cd8ac0d8f 100644 --- a/example/servo-pioneer/servoPioneerPoint2DDepthWithoutVpServo.cpp +++ b/example/servo-pioneer/servoPioneerPoint2DDepthWithoutVpServo.cpp @@ -91,6 +91,10 @@ #ifdef TEST_COULD_BE_ACHIEVED int main(int argc, char **argv) { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + try { vpImage I; // Create a gray level image container double depth = 1.; diff --git a/example/servo-pioneer/sonarPioneerReader.cpp b/example/servo-pioneer/sonarPioneerReader.cpp index 048b9f610a..8b093c7ed2 100644 --- a/example/servo-pioneer/sonarPioneerReader.cpp +++ b/example/servo-pioneer/sonarPioneerReader.cpp @@ -49,13 +49,17 @@ int main() { std::cout << "\nThis example requires Aria 3rd party library. You should " - "install it.\n" - << std::endl; + "install it.\n" + << std::endl; return EXIT_SUCCESS; } #else +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + ArSonarDevice sonar; vpRobotPioneer *robot; #if defined(VISP_HAVE_X11) @@ -290,7 +294,8 @@ int main(int argc, char **argv) try { // Create the dirname vpIoTools::makeDirectory(opath); - } catch (...) { + } + catch (...) { std::cerr << std::endl << "ERROR:" << std::endl; std::cerr << " Cannot create " << opath << std::endl; return EXIT_FAILURE; @@ -341,7 +346,8 @@ int main(int argc, char **argv) // exit ArLog::log(ArLog::Normal, "simpleMotionCommands: Exiting."); return EXIT_SUCCESS; - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "Catch an exception: " << e << std::endl; return EXIT_FAILURE; } diff --git a/example/servo-pixhawk/sendMocapToPixhawk.cpp b/example/servo-pixhawk/sendMocapToPixhawk.cpp index e646a8599b..6e9d666ad8 100644 --- a/example/servo-pixhawk/sendMocapToPixhawk.cpp +++ b/example/servo-pixhawk/sendMocapToPixhawk.cpp @@ -58,6 +58,10 @@ using std::chrono::seconds; using std::this_thread::sleep_for; +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + // ------------------------------------------------------------------------------ // Modifications Qualisys // ------------------------------------------------------------------------------ diff --git a/example/servo-pixhawk/servoPixhawkDroneIBVS.cpp b/example/servo-pixhawk/servoPixhawkDroneIBVS.cpp index 9e319c4b52..6c93bfd933 100644 --- a/example/servo-pixhawk/servoPixhawkDroneIBVS.cpp +++ b/example/servo-pixhawk/servoPixhawkDroneIBVS.cpp @@ -69,6 +69,10 @@ // Comment next line to disable sending commands to the robot #define CONTROL_UAV +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + bool compareImagePoint(std::pair p1, std::pair p2) { return (p1.second.get_v() < p2.second.get_v()); diff --git a/example/servo-pololu-ptu/servoPololuPtuPoint2DJointVelocity.cpp b/example/servo-pololu-ptu/servoPololuPtuPoint2DJointVelocity.cpp index 6e7f3f033e..af6f443a9d 100644 --- a/example/servo-pololu-ptu/servoPololuPtuPoint2DJointVelocity.cpp +++ b/example/servo-pololu-ptu/servoPololuPtuPoint2DJointVelocity.cpp @@ -98,6 +98,10 @@ void usage(const char **argv, int error, const std::string &device, int baudrate int main(int argc, const char **argv) { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + #ifdef _WIN32 std::string opt_device = "COM4"; #else diff --git a/example/servo-ptu46/movePtu46.cpp b/example/servo-ptu46/movePtu46.cpp index 1d201dc43e..7f8b5b2ac7 100644 --- a/example/servo-ptu46/movePtu46.cpp +++ b/example/servo-ptu46/movePtu46.cpp @@ -59,6 +59,10 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + try { vpRobotPtu46 robot; vpColVector q(2); @@ -83,21 +87,21 @@ int main() vpColVector qdot(2); robot.setRobotState(vpRobot::STATE_VELOCITY_CONTROL); #if 0 - qdot = 0 ; - qdot[0] = vpMath::rad(10) ; - qdot[1] = vpMath::rad(10) ; - vpCTRACE << "Set camera frame velocity " << qdot.t() ; + qdot = 0; + qdot[0] = vpMath::rad(10); + qdot[1] = vpMath::rad(10); + vpCTRACE << "Set camera frame velocity " << qdot.t(); - robot.setVelocity(vpRobot::CAMERA_FRAME, qdot) ; - sleep(2) ; + robot.setVelocity(vpRobot::CAMERA_FRAME, qdot); + sleep(2); - qdot = 0 ; - qdot[0] = vpMath::rad(-10) ; - qdot[1] = vpMath::rad(-10) ; + qdot = 0; + qdot[0] = vpMath::rad(-10); + qdot[1] = vpMath::rad(-10); - vpCTRACE << "Set camera frame velocity " << qdot.t() ; - robot.setVelocity(vpRobot::CAMERA_FRAME, qdot) ; - sleep(2) ; + vpCTRACE << "Set camera frame velocity " << qdot.t(); + robot.setVelocity(vpRobot::CAMERA_FRAME, qdot); + sleep(2); #endif qdot = 0; @@ -114,7 +118,8 @@ int main() vpCTRACE << "Set articular frame velocity " << qdot.t(); robot.setVelocity(vpRobot::ARTICULAR_FRAME, qdot); sleep(2); - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "Sorry PtU46 not available. Got exception: " << e << std::endl; return EXIT_FAILURE } diff --git a/example/servo-ptu46/servoPtu46Point2DArtVelocity.cpp b/example/servo-ptu46/servoPtu46Point2DArtVelocity.cpp index 577261c02b..a10d201ba4 100644 --- a/example/servo-ptu46/servoPtu46Point2DArtVelocity.cpp +++ b/example/servo-ptu46/servoPtu46Point2DArtVelocity.cpp @@ -95,6 +95,10 @@ void signalCtrC(int signumber) int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + std::cout << std::endl; std::cout << "-------------------------------------------------------" << std::endl; std::cout << " Test program for vpServo " << std::endl; diff --git a/example/servo-universal-robots/UniversalRobotsMoveToPosition.cpp b/example/servo-universal-robots/UniversalRobotsMoveToPosition.cpp index 4cb3808e1f..99ace5c775 100644 --- a/example/servo-universal-robots/UniversalRobotsMoveToPosition.cpp +++ b/example/servo-universal-robots/UniversalRobotsMoveToPosition.cpp @@ -49,6 +49,9 @@ int main(int argc, char **argv) { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif std::string opt_robot_ip = "192.168.0.100"; std::string opt_position_filename = ""; diff --git a/example/servo-universal-robots/UniversalRobotsSavePosition.cpp b/example/servo-universal-robots/UniversalRobotsSavePosition.cpp index 851e82f532..02c3f72eed 100644 --- a/example/servo-universal-robots/UniversalRobotsSavePosition.cpp +++ b/example/servo-universal-robots/UniversalRobotsSavePosition.cpp @@ -48,6 +48,10 @@ int main(int argc, char **argv) { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + std::string opt_robot_ip = "192.168.0.100"; std::string opt_position_filename = "position.pos"; diff --git a/example/servo-universal-robots/servoUniversalRobotsIBVS.cpp b/example/servo-universal-robots/servoUniversalRobotsIBVS.cpp index 69e0f23a00..bc347cf85b 100644 --- a/example/servo-universal-robots/servoUniversalRobotsIBVS.cpp +++ b/example/servo-universal-robots/servoUniversalRobotsIBVS.cpp @@ -59,6 +59,7 @@ #include #include +#include #include #include #include @@ -73,6 +74,10 @@ #if defined(VISP_HAVE_REALSENSE2) && (defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)) && defined(VISP_HAVE_UR_RTDE) +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void display_point_trajectory(const vpImage &I, const std::vector &vip, std::vector *traj_vip) { diff --git a/example/servo-universal-robots/servoUniversalRobotsPBVS.cpp b/example/servo-universal-robots/servoUniversalRobotsPBVS.cpp index efdd08f9fb..7205eee427 100644 --- a/example/servo-universal-robots/servoUniversalRobotsPBVS.cpp +++ b/example/servo-universal-robots/servoUniversalRobotsPBVS.cpp @@ -56,6 +56,7 @@ #include #include +#include #include #include #include @@ -70,6 +71,10 @@ #if defined(VISP_HAVE_REALSENSE2) && (defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)) && defined(VISP_HAVE_UR_RTDE) +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void display_point_trajectory(const vpImage &I, const std::vector &vip, std::vector *traj_vip) { diff --git a/example/servo-viper650/servoViper650FourPoints2DArtVelocityLs_cur.cpp b/example/servo-viper650/servoViper650FourPoints2DArtVelocityLs_cur.cpp index 414b834aff..e8d0dbaaa2 100644 --- a/example/servo-viper650/servoViper650FourPoints2DArtVelocityLs_cur.cpp +++ b/example/servo-viper650/servoViper650FourPoints2DArtVelocityLs_cur.cpp @@ -75,6 +75,10 @@ #define L 0.05 // to deal with a 10cm by 10cm square +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! Compute the pose \e cMo from the 3D coordinates of the points \e point and @@ -111,7 +115,8 @@ void compute_pose(std::vector &point, std::vector &dot, vpCamer if (init == true) { pose.computePose(vpPose::DEMENTHON_LAGRANGE_VIRTUAL_VS, cMo); - } else { + } + else { pose.computePose(vpPose::VIRTUAL_VS, cMo); } } @@ -137,7 +142,8 @@ int main() try { // Create the dirname vpIoTools::makeDirectory(logdirname); - } catch (...) { + } + catch (...) { std::cerr << std::endl << "ERROR:" << std::endl; std::cerr << " Cannot create " << logdirname << std::endl; return EXIT_FAILURE; @@ -274,7 +280,8 @@ int main() vpImagePoint cog = dot[i].getCog(); vpDisplay::displayCross(I, cog, 10, vpColor::green); } - } catch (...) { + } + catch (...) { std::cout << "Error detected while tracking visual features.." << std::endl; break; } @@ -355,7 +362,8 @@ int main() task.print(); flog.close(); // Close the log file return EXIT_SUCCESS; - } catch (const vpException &e) { + } + catch (const vpException &e) { flog.close(); // Close the log file std::cout << "Catched an exception: " << e.getMessage() << std::endl; return EXIT_FAILURE; diff --git a/example/servo-viper650/servoViper650FourPoints2DCamVelocityLs_cur-SR300.cpp b/example/servo-viper650/servoViper650FourPoints2DCamVelocityLs_cur-SR300.cpp index fc24418c70..02a11aba34 100644 --- a/example/servo-viper650/servoViper650FourPoints2DCamVelocityLs_cur-SR300.cpp +++ b/example/servo-viper650/servoViper650FourPoints2DCamVelocityLs_cur-SR300.cpp @@ -78,6 +78,10 @@ #define L 0.05 // to deal with a 10cm by 10cm square +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! Compute the pose \e cMo from the 3D coordinates of the points \e point and @@ -114,7 +118,8 @@ void compute_pose(std::vector &point, std::vector &dot, vpCamer if (init == true) { pose.computePose(vpPose::DEMENTHON_LAGRANGE_VIRTUAL_VS, cMo); - } else { + } + else { pose.computePose(vpPose::VIRTUAL_VS, cMo); } } @@ -140,7 +145,8 @@ int main() try { // Create the dirname vpIoTools::makeDirectory(logdirname); - } catch (...) { + } + catch (...) { std::cerr << std::endl << "ERROR:" << std::endl; std::cerr << " Cannot create " << logdirname << std::endl; return EXIT_FAILURE; @@ -178,7 +184,7 @@ int main() // Update camera parameters vpCameraParameters cam = - g.getCameraParameters(rs::stream::color, vpCameraParameters::perspectiveProjWithDistortion); + g.getCameraParameters(rs::stream::color, vpCameraParameters::perspectiveProjWithDistortion); std::cout << "Camera intrinsic parameters: \n" << cam << std::endl; g.acquire(I); @@ -269,7 +275,8 @@ int main() vpImagePoint cog = dot[i].getCog(); vpDisplay::displayCross(I, cog, 10, vpColor::green); } - } catch (...) { + } + catch (...) { std::cout << "Error detected while tracking visual features.." << std::endl; break; } @@ -343,7 +350,8 @@ int main() task.print(); flog.close(); // Close the log file return EXIT_SUCCESS; - } catch (const vpException &e) { + } + catch (const vpException &e) { flog.close(); // Close the log file std::cout << "Catch an exception: " << e.getMessage() << std::endl; return EXIT_FAILURE; diff --git a/example/servo-viper650/servoViper650FourPoints2DCamVelocityLs_cur.cpp b/example/servo-viper650/servoViper650FourPoints2DCamVelocityLs_cur.cpp index b0eee66934..92127252a0 100644 --- a/example/servo-viper650/servoViper650FourPoints2DCamVelocityLs_cur.cpp +++ b/example/servo-viper650/servoViper650FourPoints2DCamVelocityLs_cur.cpp @@ -76,6 +76,10 @@ #define L 0.05 // to deal with a 10cm by 10cm square +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! Compute the pose \e cMo from the 3D coordinates of the points \e point and @@ -112,7 +116,8 @@ void compute_pose(std::vector &point, std::vector &dot, vpCamer if (init == true) { pose.computePose(vpPose::DEMENTHON_LAGRANGE_VIRTUAL_VS, cMo); - } else { + } + else { pose.computePose(vpPose::VIRTUAL_VS, cMo); } } @@ -138,7 +143,8 @@ int main() try { // Create the dirname vpIoTools::makeDirectory(logdirname); - } catch (...) { + } + catch (...) { std::cerr << std::endl << "ERROR:" << std::endl; std::cerr << " Cannot create " << logdirname << std::endl; return EXIT_FAILURE; @@ -264,7 +270,8 @@ int main() vpImagePoint cog = dot[i].getCog(); vpDisplay::displayCross(I, cog, 10, vpColor::green); } - } catch (...) { + } + catch (...) { std::cout << "Error detected while tracking visual features.." << std::endl; break; } @@ -340,7 +347,8 @@ int main() task.print(); flog.close(); // Close the log file return EXIT_SUCCESS; - } catch (const vpException &e) { + } + catch (const vpException &e) { flog.close(); // Close the log file std::cout << "Catched an exception: " << e.getMessage() << std::endl; return EXIT_FAILURE; diff --git a/example/servo-viper650/servoViper650Point2DCamVelocity.cpp b/example/servo-viper650/servoViper650Point2DCamVelocity.cpp index 52f4af6c6e..4ff6c3993a 100644 --- a/example/servo-viper650/servoViper650Point2DCamVelocity.cpp +++ b/example/servo-viper650/servoViper650Point2DCamVelocity.cpp @@ -75,6 +75,10 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + // Log file creation in /tmp/$USERNAME/log.dat // This file contains by line: // - the 6 computed camera velocities (m/s, rad/s) to achieve the task diff --git a/example/servo-viper850/servoViper850FourPoints2DArtVelocityLs_cur.cpp b/example/servo-viper850/servoViper850FourPoints2DArtVelocityLs_cur.cpp index d58d2e1834..b02fd2b47f 100644 --- a/example/servo-viper850/servoViper850FourPoints2DArtVelocityLs_cur.cpp +++ b/example/servo-viper850/servoViper850FourPoints2DArtVelocityLs_cur.cpp @@ -75,6 +75,10 @@ #define L 0.05 // to deal with a 10cm by 10cm square +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! Compute the pose \e cMo from the 3D coordinates of the points \e point and diff --git a/example/servo-viper850/servoViper850FourPoints2DArtVelocityLs_des.cpp b/example/servo-viper850/servoViper850FourPoints2DArtVelocityLs_des.cpp index 2666b97362..e2f684e637 100644 --- a/example/servo-viper850/servoViper850FourPoints2DArtVelocityLs_des.cpp +++ b/example/servo-viper850/servoViper850FourPoints2DArtVelocityLs_des.cpp @@ -75,6 +75,10 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + // Log file creation in /tmp/$USERNAME/log.dat // This file contains by line: // - the 6 computed joint velocities (m/s, rad/s) to achieve the task diff --git a/example/servo-viper850/servoViper850FourPoints2DCamVelocityLs_cur.cpp b/example/servo-viper850/servoViper850FourPoints2DCamVelocityLs_cur.cpp index 047ad2e650..9021648803 100644 --- a/example/servo-viper850/servoViper850FourPoints2DCamVelocityLs_cur.cpp +++ b/example/servo-viper850/servoViper850FourPoints2DCamVelocityLs_cur.cpp @@ -76,6 +76,10 @@ #define L 0.05 // to deal with a 10cm by 10cm square +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! Compute the pose \e cMo from the 3D coordinates of the points \e point and diff --git a/example/servo-viper850/servoViper850FourPointsKinect.cpp b/example/servo-viper850/servoViper850FourPointsKinect.cpp index a5779dbaaf..3ff87e68b3 100644 --- a/example/servo-viper850/servoViper850FourPointsKinect.cpp +++ b/example/servo-viper850/servoViper850FourPointsKinect.cpp @@ -80,6 +80,10 @@ #include #define L 0.05 // to deal with a 10cm by 10cm square +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! Compute the pose \e cMo from the 3D coordinates of the points \e point and diff --git a/example/servo-viper850/servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp b/example/servo-viper850/servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp index d5a15601e5..701a63b87d 100644 --- a/example/servo-viper850/servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp +++ b/example/servo-viper850/servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp @@ -78,6 +78,10 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + try { vpRobotViper850 robot; diff --git a/example/servo-viper850/servoViper850Point2DArtVelocity-jointAvoidance-gpa.cpp b/example/servo-viper850/servoViper850Point2DArtVelocity-jointAvoidance-gpa.cpp index b1d9ec058b..abba0b997a 100644 --- a/example/servo-viper850/servoViper850Point2DArtVelocity-jointAvoidance-gpa.cpp +++ b/example/servo-viper850/servoViper850Point2DArtVelocity-jointAvoidance-gpa.cpp @@ -75,6 +75,10 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + try { vpRobotViper850 robot; diff --git a/example/servo-viper850/servoViper850Point2DArtVelocity-jointAvoidance-large.cpp b/example/servo-viper850/servoViper850Point2DArtVelocity-jointAvoidance-large.cpp index 360b7376b9..1a341d4285 100644 --- a/example/servo-viper850/servoViper850Point2DArtVelocity-jointAvoidance-large.cpp +++ b/example/servo-viper850/servoViper850Point2DArtVelocity-jointAvoidance-large.cpp @@ -75,6 +75,10 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + try { vpRobotViper850 robot; diff --git a/example/servo-viper850/servoViper850Point2DArtVelocity.cpp b/example/servo-viper850/servoViper850Point2DArtVelocity.cpp index ae290dd50d..9ad92b46f8 100644 --- a/example/servo-viper850/servoViper850Point2DArtVelocity.cpp +++ b/example/servo-viper850/servoViper850Point2DArtVelocity.cpp @@ -78,6 +78,10 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + // Log file creation in /tmp/$USERNAME/log.dat // This file contains by line: // - the 6 computed joint velocities (m/s, rad/s) to achieve the task diff --git a/example/servo-viper850/servoViper850Point2DCamVelocity.cpp b/example/servo-viper850/servoViper850Point2DCamVelocity.cpp index 3e7f8c9a6e..f71aec8334 100644 --- a/example/servo-viper850/servoViper850Point2DCamVelocity.cpp +++ b/example/servo-viper850/servoViper850Point2DCamVelocity.cpp @@ -77,6 +77,10 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + // Log file creation in /tmp/$USERNAME/log.dat // This file contains by line: // - the 6 computed joint velocities (m/s, rad/s) to achieve the task diff --git a/example/servo-viper850/servoViper850Point2DCamVelocityKalman.cpp b/example/servo-viper850/servoViper850Point2DCamVelocityKalman.cpp index 4ffd794967..f1b7ae735f 100644 --- a/example/servo-viper850/servoViper850Point2DCamVelocityKalman.cpp +++ b/example/servo-viper850/servoViper850Point2DCamVelocityKalman.cpp @@ -80,6 +80,10 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + // Log file creation in /tmp/$USERNAME/log.dat // This file contains by line: // - the 6 computed joint velocities (m/s, rad/s) to achieve the task diff --git a/example/tools/histogram.cpp b/example/tools/histogram.cpp index df3923794a..8d8e364b1a 100644 --- a/example/tools/histogram.cpp +++ b/example/tools/histogram.cpp @@ -40,6 +40,7 @@ \brief Histogram manipulation. */ +#include #include #include #include @@ -55,6 +56,10 @@ // List of allowed command line options #define GETOPTARGS "i:o:h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! \example histogram.cpp @@ -84,7 +89,7 @@ SYNOPSIS\n\ %s [-i ] [-o ]\n\ [-h]\n\ ", - name); +name); fprintf(stdout, "\n\ OPTIONS: Default\n\ @@ -207,7 +212,8 @@ int main(int argc, const char **argv) try { // Create the dirname vpIoTools::makeDirectory(dirname); - } catch (...) { + } + catch (...) { usage(argv[0], nullptr, ipath, opath, username); std::cerr << std::endl << "ERROR:" << std::endl; std::cerr << " Cannot create " << dirname << std::endl; @@ -222,8 +228,8 @@ int main(int argc, const char **argv) if (ipath != env_ipath) { std::cout << std::endl << "WARNING: " << std::endl; std::cout << " Since -i " - << " is different from VISP_IMAGE_PATH=" << env_ipath << std::endl - << " we skip the environment variable." << std::endl; + << " is different from VISP_IMAGE_PATH=" << env_ipath << std::endl + << " we skip the environment variable." << std::endl; } } @@ -232,9 +238,9 @@ int main(int argc, const char **argv) usage(argv[0], nullptr, ipath, opath, username); std::cerr << std::endl << "ERROR:" << std::endl; std::cerr << " Use -i option or set VISP_INPUT_IMAGE_PATH " << std::endl - << " environment variable to specify the location of the " << std::endl - << " image path where test images are located." << std::endl - << std::endl; + << " environment variable to specify the location of the " << std::endl + << " image path where test images are located." << std::endl + << std::endl; return EXIT_FAILURE; } @@ -300,7 +306,8 @@ int main(int argc, const char **argv) nbpeaks = h.getPeaks(distance, peak1, peak2); if (nbpeaks != 2) { std::cout << "Not a bimodal histogram..." << std::endl; - } else { + } + else { vpTRACE("Bimodal histogram: main peak1: %d-%d second peak2: %d-%d", peak1.getLevel(), peak1.getValue(), peak2.getLevel(), peak2.getValue()); } @@ -309,7 +316,8 @@ int main(int argc, const char **argv) vpHistogramValey valey; if (h.getValey(peak1, peak2, valey) == false) { vpTRACE("No valey found..."); - } else { + } + else { vpTRACE("Valey: %d-%d", valey.getLevel(), valey.getValue()); } @@ -320,13 +328,16 @@ int main(int argc, const char **argv) unsigned ret = h.getValey(distance, peak1, valeyl, valeyr); if (ret == 0x00) { vpTRACE("No left and right valey for peak %d-%d...", peak1.getLevel(), peak1.getValue()); - } else if (ret == 0x10) { + } + else if (ret == 0x10) { vpTRACE("No right valey for peak %d-%d...", peak1.getLevel(), peak1.getValue()); vpTRACE("Left valey: %d-%d", valeyl.getLevel(), valeyl.getValue()); - } else if (ret == 0x01) { + } + else if (ret == 0x01) { vpTRACE("No left valey for peak %d-%d...", peak1.getLevel(), peak1.getValue()); vpTRACE("Right valey: %d-%d", valeyr.getLevel(), valeyr.getValue()); - } else if (ret == 0x11) { + } + else if (ret == 0x11) { vpTRACE("Left valey: %d-%d", valeyl.getLevel(), valeyl.getValue()); vpTRACE("Right valey: %d-%d", valeyr.getLevel(), valeyr.getValue()); } @@ -336,13 +347,16 @@ int main(int argc, const char **argv) unsigned ret = h.getValey(distance, peak2, valeyl, valeyr); if (ret == 0x00) { vpTRACE("No left and right valey for peak %d-%d...", peak2.getLevel(), peak2.getValue()); - } else if (ret == 0x10) { + } + else if (ret == 0x10) { vpTRACE("No right valey for peak %d-%d...", peak2.getLevel(), peak2.getValue()); vpTRACE("Left valey: %d-%d", valeyl.getLevel(), valeyl.getValue()); - } else if (ret == 0x01) { + } + else if (ret == 0x01) { vpTRACE("No left valey for peak %d-%d...", peak2.getLevel(), peak2.getValue()); vpTRACE("Right valey: %d-%d", valeyr.getLevel(), valeyr.getValue()); - } else if (ret == 0x11) { + } + else if (ret == 0x11) { vpTRACE("Left valey: %d-%d", valeyl.getLevel(), valeyl.getValue()); vpTRACE("Right valey: %d-%d", valeyr.getLevel(), valeyr.getValue()); } @@ -354,12 +368,14 @@ int main(int argc, const char **argv) vpHistogramPeak peakl, peakr; if (h.getPeaks(distance, peakl, peakr, valey) == false) { std::cout << "Not a bimodal histogram..." << std::endl; - } else { + } + else { vpTRACE("Bimodal histogram: valey %d-%d for peakl: %d-%d peakr: %d-%d", valey.getLevel(), valey.getValue(), peakl.getLevel(), peakl.getValue(), peakr.getLevel(), peakr.getValue()); } return EXIT_SUCCESS; - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "Catch an exception: " << e << std::endl; return EXIT_FAILURE; } diff --git a/example/tools/keyboard.cpp b/example/tools/keyboard.cpp index f240607785..14be77d7cd 100644 --- a/example/tools/keyboard.cpp +++ b/example/tools/keyboard.cpp @@ -48,6 +48,10 @@ int main() { +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + std::cout << "Push some characters on the keyboard..." << std::endl; printf("Hit 'q' or 'Q' to stop the loop ...\n"); vpKeyboard keyboard; diff --git a/example/tools/parallelPort.cpp b/example/tools/parallelPort.cpp index d3b55d54e0..0a7f74a759 100644 --- a/example/tools/parallelPort.cpp +++ b/example/tools/parallelPort.cpp @@ -54,6 +54,10 @@ // List of allowed command line options #define GETOPTARGS "d:h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! Print the program options. diff --git a/example/tools/plot2d.cpp b/example/tools/plot2d.cpp index 5a8264d0d2..8665e74b9b 100644 --- a/example/tools/plot2d.cpp +++ b/example/tools/plot2d.cpp @@ -49,6 +49,10 @@ int main() { #if defined(VISP_HAVE_DISPLAY) +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + try { vpPlot plot(2, 700, 700, 100, 200, "Curves..."); @@ -106,15 +110,16 @@ int main() plot.saveData(0, "dataCos.txt", "# "); plot.saveData(1, "dataSin.txt", "# "); return EXIT_SUCCESS; - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "Catch an exception: " << e << std::endl; return EXIT_FAILURE; } #else std::cout << "Plot functionalities are not avalaible since no display is " - "available." - << std::endl; + "available." + << std::endl; return EXIT_SUCCESS; #endif -} + } diff --git a/example/tools/plot3d.cpp b/example/tools/plot3d.cpp index 099049111b..6cc8ba4244 100644 --- a/example/tools/plot3d.cpp +++ b/example/tools/plot3d.cpp @@ -47,6 +47,10 @@ int main() { #if defined(VISP_HAVE_DISPLAY) +#ifdef ENABLE_VISP_NAMESPACE + using namespace VISP_NAMESPACE_NAME; +#endif + try { // Create a window with one graphic vpPlot plot(1); @@ -99,9 +103,10 @@ int main() y += dy; if (fabs(y) >= 1.0) zsign = -zsign; - } else { - // Tip: to allows modifying the point of view with the mouse we - // plot always the last point + } + else { + // Tip: to allows modifying the point of view with the mouse we + // plot always the last point if (plot.plot(0, 0, x, y, z * zsign) == vpMouseButton::button3) end = true; if (plot.plot(0, 1, x, -y, -z * zsign) == vpMouseButton::button3) @@ -110,14 +115,15 @@ int main() iter++; } return EXIT_SUCCESS; - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "Catch an exception: " << e << std::endl; return EXIT_FAILURE; } #else std::cout << "Plot functionalities are not avalaible since no display is " - "available." - << std::endl; + "available." + << std::endl; return EXIT_SUCCESS; #endif -} + } diff --git a/example/tracking/mbtEdgeKltTracking.cpp b/example/tracking/mbtEdgeKltTracking.cpp index baf7c281e5..121b704ccf 100644 --- a/example/tracking/mbtEdgeKltTracking.cpp +++ b/example/tracking/mbtEdgeKltTracking.cpp @@ -62,6 +62,10 @@ #define GETOPTARGS "x:m:i:n:de:chtfColwvp" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam) { #if VISP_HAVE_DATASET_VERSION >= 0x030600 @@ -325,8 +329,8 @@ int main(int argc, const char **argv) std::cerr << "Coin is not detected in ViSP. Use the .cao model instead." << std::endl; modelFile = vpIoTools::createFilePath(opt_ipath, modelFileCao); #endif - } } + } else { if (cao3DModel) { modelFile = vpIoTools::createFilePath(env_ipath, modelFileCao); @@ -338,9 +342,9 @@ int main(int argc, const char **argv) std::cerr << "Coin is not detected in ViSP. Use the .cao model instead." << std::endl; modelFile = vpIoTools::createFilePath(env_ipath, modelFileCao); #endif - } } - } + } +} if (!opt_initFile.empty()) initFile = opt_initFile; diff --git a/example/tracking/mbtEdgeTracking.cpp b/example/tracking/mbtEdgeTracking.cpp index 6f4ba9cff2..424afe0261 100644 --- a/example/tracking/mbtEdgeTracking.cpp +++ b/example/tracking/mbtEdgeTracking.cpp @@ -62,6 +62,10 @@ #define GETOPTARGS "x:m:i:n:de:chtfColwvp" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam) { #if VISP_HAVE_DATASET_VERSION >= 0x030600 diff --git a/example/tracking/mbtGenericTracking.cpp b/example/tracking/mbtGenericTracking.cpp index 1e5cce70bf..d02b9f92fa 100644 --- a/example/tracking/mbtGenericTracking.cpp +++ b/example/tracking/mbtGenericTracking.cpp @@ -62,6 +62,10 @@ #define GETOPTARGS "x:m:i:n:de:chtfColwvpT:" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam) { #if VISP_HAVE_DATASET_VERSION >= 0x030600 diff --git a/example/tracking/mbtGenericTracking2.cpp b/example/tracking/mbtGenericTracking2.cpp index 2c70106c85..f2b7f6f203 100644 --- a/example/tracking/mbtGenericTracking2.cpp +++ b/example/tracking/mbtGenericTracking2.cpp @@ -62,6 +62,10 @@ #define GETOPTARGS "x:m:i:n:de:chtfColwvpT:" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam) { #if VISP_HAVE_DATASET_VERSION >= 0x030600 diff --git a/example/tracking/mbtGenericTrackingDepth.cpp b/example/tracking/mbtGenericTrackingDepth.cpp index 1a37d4ab4b..129acfeb71 100644 --- a/example/tracking/mbtGenericTrackingDepth.cpp +++ b/example/tracking/mbtGenericTrackingDepth.cpp @@ -64,6 +64,10 @@ #define USE_SMALL_DATASET 1 // small depth dataset in ViSP-images +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + namespace { void usage(const char *name, const char *badparam) @@ -812,7 +816,7 @@ int main(int argc, const char **argv) } frame_index++; - } + } std::cout << "\nFinal poses, c1Mo:\n" << c1Mo << "\nc2Mo:\n" << c2Mo << std::endl; std::cout << "\nComputation time, Mean: " << vpMath::getMean(time_vec) @@ -827,12 +831,12 @@ int main(int argc, const char **argv) tracker = nullptr; return EXIT_SUCCESS; - } + } catch (const vpException &e) { std::cout << "Catch an exception: " << e << std::endl; return EXIT_FAILURE; } -} + } #elif !(defined(VISP_HAVE_MODULE_MBT) && defined(VISP_HAVE_DISPLAY)) int main() diff --git a/example/tracking/mbtGenericTrackingDepthOnly.cpp b/example/tracking/mbtGenericTrackingDepthOnly.cpp index b2c07179a8..efe398fda8 100644 --- a/example/tracking/mbtGenericTrackingDepthOnly.cpp +++ b/example/tracking/mbtGenericTrackingDepthOnly.cpp @@ -64,6 +64,10 @@ #define USE_SMALL_DATASET 1 // small depth dataset in ViSP-images +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + namespace { void usage(const char *name, const char *badparam) @@ -758,7 +762,7 @@ int main(int argc, const char **argv) } frame_index++; - } + } std::cout << "\nFinal poses, cMo:\n" << cMo << std::endl; std::cout << "\nComputation time, Mean: " << vpMath::getMean(time_vec) @@ -773,12 +777,12 @@ int main(int argc, const char **argv) tracker = nullptr; return EXIT_SUCCESS; - } + } catch (const vpException &e) { std::cout << "Catch an exception: " << e << std::endl; return EXIT_FAILURE; } -} + } #elif !(defined(VISP_HAVE_MODULE_MBT) && defined(VISP_HAVE_DISPLAY)) int main() diff --git a/example/tracking/mbtKltTracking.cpp b/example/tracking/mbtKltTracking.cpp index 0efab6467d..4b699827d2 100644 --- a/example/tracking/mbtKltTracking.cpp +++ b/example/tracking/mbtKltTracking.cpp @@ -61,6 +61,10 @@ #define GETOPTARGS "x:m:i:n:de:chtfolwv" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam) { #if VISP_HAVE_DATASET_VERSION >= 0x030600 @@ -575,6 +579,6 @@ int main() "this example." << std::endl; return EXIT_SUCCESS; -} + } #endif diff --git a/example/tracking/templateTracker.cpp b/example/tracking/templateTracker.cpp index 2fec809a78..949481c5bd 100644 --- a/example/tracking/templateTracker.cpp +++ b/example/tracking/templateTracker.cpp @@ -85,8 +85,13 @@ #define GETOPTARGS "cdhi:l:Lprs:t:w:" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + #ifndef DOXYGEN_SHOULD_SKIP_THIS -typedef enum { +typedef enum +{ WARP_AFFINE, WARP_HOMOGRAPHY, WARP_HOMOGRAPHY_SL3, @@ -98,7 +103,8 @@ typedef enum { WARP_LAST } WarpType; -typedef enum { +typedef enum +{ TRACKER_SSD_ESM, TRACKER_SSD_FORWARD_ADDITIONAL, TRACKER_SSD_FORWARD_COMPOSITIONAL, @@ -305,7 +311,7 @@ bool getOptions(int argc, const char **argv, std::string &ipath, bool &click_all usage(argv[0], nullptr, warp_type, tracker_type, last_frame, threshold_residual); std::cerr << "ERROR: " << std::endl; std::cerr << " Bad argument -t with \"tracker type\"=" << (int)tracker_type << std::endl - << std::endl; + << std::endl; return false; } if ((c == 1) || (c == -1)) { @@ -377,9 +383,9 @@ int main(int argc, const char **argv) usage(argv[0], nullptr, opt_warp_type, opt_tracker_type, opt_last_frame, opt_threshold_residual); std::cerr << std::endl << "ERROR:" << std::endl; std::cerr << " Use -i option or set VISP_INPUT_IMAGE_PATH " << std::endl - << " environment variable to specify the location of the " << std::endl - << " image path where test images are located." << std::endl - << std::endl; + << " environment variable to specify the location of the " << std::endl + << " image path where test images are located." << std::endl + << std::endl; return EXIT_FAILURE; } @@ -402,7 +408,8 @@ int main(int argc, const char **argv) reader.setLastFrameIndex(opt_last_frame); try { reader.open(I); - } catch (...) { + } + catch (...) { std::cout << "Cannot open sequence: " << ipath << std::endl; return EXIT_FAILURE; } @@ -553,7 +560,8 @@ int main(int argc, const char **argv) vpDisplay::displayText(I, 10, 10, "Re-init simulation", vpColor::red); vpDisplay::flush(I); tracker->initClick(I, delaunay); - } else { + } + else { std::vector v_ip; vpImagePoint ip; ip.set_ij(146, 60); @@ -611,7 +619,8 @@ int main(int argc, const char **argv) delete tracker; return EXIT_SUCCESS; - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "Catch an exception: " << e << std::endl; return EXIT_FAILURE; } diff --git a/example/tracking/trackDot.cpp b/example/tracking/trackDot.cpp index ee24e66073..1305f12461 100644 --- a/example/tracking/trackDot.cpp +++ b/example/tracking/trackDot.cpp @@ -70,6 +70,10 @@ // List of allowed command line options #define GETOPTARGS "cdf:hi:l:p:s:" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! Print the program options. @@ -255,8 +259,8 @@ int main(int argc, const char **argv) if (ipath != env_ipath) { std::cout << std::endl << "WARNING: " << std::endl; std::cout << " Since -i " - << " is different from VISP_IMAGE_PATH=" << env_ipath << std::endl - << " we skip the environment variable." << std::endl; + << " is different from VISP_IMAGE_PATH=" << env_ipath << std::endl + << " we skip the environment variable." << std::endl; } } @@ -265,11 +269,11 @@ int main(int argc, const char **argv) usage(argv[0], nullptr, ipath, opt_ppath, opt_first, opt_last, opt_step); std::cerr << std::endl << "ERROR:" << std::endl; std::cerr << " Use -i option or set VISP_INPUT_IMAGE_PATH " << std::endl - << " environment variable to specify the location of the " << std::endl - << " image path where test images are located." << std::endl - << " Use -p option if you want to " << std::endl - << " use personal images." << std::endl - << std::endl; + << " environment variable to specify the location of the " << std::endl + << " image path where test images are located." << std::endl + << " Use -p option if you want to " << std::endl + << " use personal images." << std::endl + << std::endl; return EXIT_FAILURE; } @@ -315,13 +319,14 @@ int main(int argc, const char **argv) vpCTRACE << "Load: " << filename << std::endl; vpImageIo::read(I, filename); - } catch (...) { - // If an exception is thrown by vpImageIo::read() it will result in the end of the program. + } + catch (...) { + // If an exception is thrown by vpImageIo::read() it will result in the end of the program. std::cerr << std::endl << "ERROR:" << std::endl; std::cerr << " Cannot read " << filename << std::endl; if (opt_ppath.empty()) { std::cerr << " Check your -i " << ipath << " option " << std::endl - << " or VISP_INPUT_IMAGE_PATH environment variable." << std::endl; + << " or VISP_INPUT_IMAGE_PATH environment variable." << std::endl; } else { std::cerr << " Check your -p " << opt_ppath << " option " << std::endl; @@ -360,7 +365,8 @@ int main(int argc, const char **argv) // It uses the overlay image plane. // The default of this setting is that it is time consuming d.setGraphics(true); - } else { + } + else { d.setGraphics(false); } // we also request to compute the dot moment m00, m10, m01, m11, m20, m02 @@ -373,10 +379,11 @@ int main(int argc, const char **argv) // a right mouse click on the dot is expected std::cout << "Click on a white dot you want to track..." << std::endl; d.initTracking(I); - } else { - // dot location can also be specified explicitly in the - // initTracking method : d.initTracking(I,ip) where ip is the - // image point from which the dot is searched + } + else { + // dot location can also be specified explicitly in the + // initTracking method : d.initTracking(I,ip) where ip is the + // image point from which the dot is searched vpImagePoint ip; ip.set_u(160); ip.set_v(212); @@ -390,7 +397,8 @@ int main(int argc, const char **argv) s.str(""); s << "image." << std::setw(4) << std::setfill('0') << iter << "." << ext; filename = vpIoTools::createFilePath(dirname, s.str()); - } else { + } + else { snprintf(cfilename, FILENAME_MAX, opt_ppath.c_str(), iter); filename = cfilename; } @@ -443,7 +451,8 @@ int main(int argc, const char **argv) vpDisplay::getClick(I); } return EXIT_SUCCESS; - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "Catch an exception: " << e << std::endl; return EXIT_FAILURE; } @@ -454,9 +463,9 @@ int main(int argc, const char **argv) int main() { std::cout << "visp_blob module or X11, GTK, GDI or OpenCV display " - "functionalities are required..." - << std::endl; + "functionalities are required..." + << std::endl; return EXIT_SUCCESS; -} + } #endif diff --git a/example/tracking/trackDot2.cpp b/example/tracking/trackDot2.cpp index a3e0bd9f12..66bb5e507a 100644 --- a/example/tracking/trackDot2.cpp +++ b/example/tracking/trackDot2.cpp @@ -63,6 +63,10 @@ // List of allowed command line options #define GETOPTARGS "cdf:i:l:p:s:h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! \example trackDot2.cpp Example of dot tracking on an image sequence using vpDot2. @@ -254,8 +258,8 @@ int main(int argc, const char **argv) if (ipath != env_ipath) { std::cout << std::endl << "WARNING: " << std::endl; std::cout << " Since -i " - << " is different from VISP_IMAGE_PATH=" << env_ipath << std::endl - << " we skip the environment variable." << std::endl; + << " is different from VISP_IMAGE_PATH=" << env_ipath << std::endl + << " we skip the environment variable." << std::endl; } } @@ -264,11 +268,11 @@ int main(int argc, const char **argv) usage(argv[0], nullptr, ipath, opt_ppath, opt_first, opt_last, opt_step); std::cerr << std::endl << "ERROR:" << std::endl; std::cerr << " Use -i option or set VISP_INPUT_IMAGE_PATH " << std::endl - << " environment variable to specify the location of the " << std::endl - << " image path where test images are located." << std::endl - << " Use -p option if you want to " << std::endl - << " use personal images." << std::endl - << std::endl; + << " environment variable to specify the location of the " << std::endl + << " image path where test images are located." << std::endl + << " Use -p option if you want to " << std::endl + << " use personal images." << std::endl + << std::endl; return EXIT_FAILURE; } @@ -300,7 +304,8 @@ int main(int argc, const char **argv) s.setf(std::ios::right, std::ios::adjustfield); s << "image." << std::setw(4) << std::setfill('0') << iter << "." << ext; filename = vpIoTools::createFilePath(dirname, s.str()); - } else { + } + else { snprintf(cfilename, FILENAME_MAX, opt_ppath.c_str(), iter); filename = cfilename; } @@ -314,13 +319,14 @@ int main(int argc, const char **argv) vpCTRACE << "Load: " << filename << std::endl; vpImageIo::read(I, filename); - } catch (...) { - // If an exception is thrown by vpImageIo::read() it will result in the end of the program. + } + catch (...) { + // If an exception is thrown by vpImageIo::read() it will result in the end of the program. std::cerr << std::endl << "ERROR:" << std::endl; std::cerr << " Cannot read " << filename << std::endl; if (opt_ppath.empty()) { std::cerr << " Check your -i " << ipath << " option " << std::endl - << " or VISP_INPUT_IMAGE_PATH environment variable." << std::endl; + << " or VISP_INPUT_IMAGE_PATH environment variable." << std::endl; } else { std::cerr << " Check your -p " << opt_ppath << " option " << std::endl; @@ -367,7 +373,8 @@ int main(int argc, const char **argv) // The default of this setting is that it is time consuming d.setGraphics(true); - } else { + } + else { d.setGraphics(false); } @@ -386,7 +393,8 @@ int main(int argc, const char **argv) if (opt_display && opt_click_allowed) { std::cout << "Click on a dot to track it." << std::endl; d.initTracking(I); - } else { + } + else { vpImagePoint ip; ip.set_u(160); ip.set_v(212); @@ -416,7 +424,8 @@ int main(int argc, const char **argv) s.str(""); s << "image." << std::setw(4) << std::setfill('0') << iter << "." << ext; filename = vpIoTools::createFilePath(dirname, s.str()); - } else { + } + else { snprintf(cfilename, FILENAME_MAX, opt_ppath.c_str(), iter); filename = cfilename; } @@ -481,7 +490,8 @@ int main(int argc, const char **argv) vpDisplay::getClick(I); } return EXIT_SUCCESS; - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "Catch an exception: " << e << std::endl; return EXIT_FAILURE; } @@ -492,9 +502,9 @@ int main(int argc, const char **argv) int main() { std::cout << "visp_me module or X11, GTK, GDI or OpenCV display " - "functionalities are required..." - << std::endl; + "functionalities are required..." + << std::endl; return EXIT_SUCCESS; -} + } #endif diff --git a/example/tracking/trackDot2WithAutoDetection.cpp b/example/tracking/trackDot2WithAutoDetection.cpp index 4372509e7d..b5fe2cdb0a 100644 --- a/example/tracking/trackDot2WithAutoDetection.cpp +++ b/example/tracking/trackDot2WithAutoDetection.cpp @@ -69,6 +69,10 @@ // List of allowed command line options #define GETOPTARGS "cdi:p:f:l:s:S:G:E:h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! Print the program options. @@ -152,8 +156,8 @@ OPTIONS: Default\n\ whereas values close to 0 show a very bad precision.\n\ 0 means the shape of dots is not tested \n\ \n", - ipath.c_str(), ext.c_str(), ppath.c_str(), ext.c_str(), first, last, step, sizePrecision, grayLevelPrecision, - ellipsoidShapePrecision); +ipath.c_str(), ext.c_str(), ppath.c_str(), ext.c_str(), first, last, step, sizePrecision, grayLevelPrecision, +ellipsoidShapePrecision); fprintf(stdout, "\ -c\n\ @@ -302,8 +306,8 @@ int main(int argc, const char **argv) if (ipath != env_ipath) { std::cout << std::endl << "WARNING: " << std::endl; std::cout << " Since -i " - << " is different from VISP_IMAGE_PATH=" << env_ipath << std::endl - << " we skip the environment variable." << std::endl; + << " is different from VISP_IMAGE_PATH=" << env_ipath << std::endl + << " we skip the environment variable." << std::endl; } } @@ -313,11 +317,11 @@ int main(int argc, const char **argv) opt_grayLevelPrecision, opt_ellipsoidShapePrecision); std::cerr << std::endl << "ERROR:" << std::endl; std::cerr << " Use -i option or set VISP_INPUT_IMAGE_PATH " << std::endl - << " environment variable to specify the location of the " << std::endl - << " image path where test images are located." << std::endl - << std::endl - << " Use -p option if you want to " << std::endl - << " use personal images." << std::endl; + << " environment variable to specify the location of the " << std::endl + << " image path where test images are located." << std::endl + << std::endl + << " Use -p option if you want to " << std::endl + << " use personal images." << std::endl; return EXIT_FAILURE; } @@ -347,7 +351,8 @@ int main(int argc, const char **argv) s.setf(std::ios::right, std::ios::adjustfield); s << "image." << std::setw(4) << std::setfill('0') << iter << "." << ext; filename = vpIoTools::createFilePath(dirname, s.str()); - } else { + } + else { snprintf(cfilename, FILENAME_MAX, opt_ppath.c_str(), iter); filename = cfilename; } @@ -360,13 +365,14 @@ int main(int argc, const char **argv) vpCTRACE << "Load: " << filename << std::endl; vpImageIo::read(I, filename); - } catch (...) { - // If an exception is thrown by vpImageIo::read() it will result in the end of the program. + } + catch (...) { + // If an exception is thrown by vpImageIo::read() it will result in the end of the program. std::cerr << std::endl << "ERROR:" << std::endl; std::cerr << " Cannot read " << filename << std::endl; if (opt_ppath.empty()) { std::cerr << " Check your -i " << ipath << " option " << std::endl - << " or VISP_INPUT_IMAGE_PATH environment variable." << std::endl; + << " or VISP_INPUT_IMAGE_PATH environment variable." << std::endl; } else { std::cerr << " Check your -p " << opt_ppath << " option " << std::endl; @@ -424,8 +430,9 @@ int main(int argc, const char **argv) printf(" grayLevelPrecision: %lf\n", d.getGrayLevelPrecision()); printf(" sizePrecision: %lf\n", d.getSizePrecision()); printf(" ellipsoidShapePrecision: %lf\n", d.getEllipsoidShapePrecision()); - } else { - // Set dot characteristics for the auto detection + } + else { + // Set dot characteristics for the auto detection d.setGraphics(true); d.setWidth(15.0); d.setHeight(12.0); @@ -445,7 +452,8 @@ int main(int argc, const char **argv) s.str(""); s << "image." << std::setw(4) << std::setfill('0') << iter << "." << ext; filename = vpIoTools::createFilePath(dirname, s.str()); - } else { + } + else { snprintf(cfilename, FILENAME_MAX, opt_ppath.c_str(), iter); filename = cfilename; } @@ -499,7 +507,8 @@ int main(int argc, const char **argv) } return EXIT_SUCCESS; - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "Catch an exception: " << e << std::endl; return EXIT_FAILURE; } @@ -510,9 +519,9 @@ int main(int argc, const char **argv) int main() { std::cout << "visp_me module or X11, GTK, GDI or OpenCV display " - "functionalities are required..." - << std::endl; + "functionalities are required..." + << std::endl; return EXIT_SUCCESS; -} + } #endif diff --git a/example/tracking/trackKltOpencv.cpp b/example/tracking/trackKltOpencv.cpp index 73df296ded..041515471b 100644 --- a/example/tracking/trackKltOpencv.cpp +++ b/example/tracking/trackKltOpencv.cpp @@ -63,6 +63,10 @@ // List of allowed command line options #define GETOPTARGS "cdf:i:l:p:s:h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam, std::string ipath, std::string ppath, unsigned first, unsigned last, unsigned step); bool getOptions(int argc, const char **argv, std::string &ipath, std::string &ppath, unsigned &first, unsigned &last, @@ -262,8 +266,8 @@ int main(int argc, const char **argv) if (ipath != env_ipath) { std::cout << std::endl << "WARNING: " << std::endl; std::cout << " Since -i " - << " is different from VISP_IMAGE_PATH=" << env_ipath << std::endl - << " we skip the environment variable." << std::endl; + << " is different from VISP_IMAGE_PATH=" << env_ipath << std::endl + << " we skip the environment variable." << std::endl; } } @@ -272,11 +276,11 @@ int main(int argc, const char **argv) usage(argv[0], nullptr, ipath, opt_ppath, opt_first, opt_last, opt_step); std::cerr << std::endl << "ERROR:" << std::endl; std::cerr << " Use -i option or set VISP_INPUT_IMAGE_PATH " << std::endl - << " environment variable to specify the location of the " << std::endl - << " image path where test images are located." << std::endl - << " Use -p option if you want to " << std::endl - << " use personal images." << std::endl - << std::endl; + << " environment variable to specify the location of the " << std::endl + << " image path where test images are located." << std::endl + << " Use -p option if you want to " << std::endl + << " use personal images." << std::endl + << std::endl; return EXIT_FAILURE; } @@ -326,13 +330,14 @@ int main(int argc, const char **argv) // Load a ViSP image used for the display vpImageIo::read(vpI, filename); vpImageConvert::convert(vpI, cvI); - } catch (...) { - // If an exception is thrown by vpImageIo::read() it will result in the end of the program. + } + catch (...) { + // If an exception is thrown by vpImageIo::read() it will result in the end of the program. std::cerr << std::endl << "ERROR:" << std::endl; std::cerr << " Cannot read " << filename << std::endl; if (opt_ppath.empty()) { std::cerr << " Check your -i " << ipath << " option " << std::endl - << " or VISP_INPUT_IMAGE_PATH environment variable." << std::endl; + << " or VISP_INPUT_IMAGE_PATH environment variable." << std::endl; } else { std::cerr << " Check your -p " << opt_ppath << " option " << std::endl; @@ -398,7 +403,8 @@ int main(int argc, const char **argv) s.str(""); s << "image." << std::setw(4) << std::setfill('0') << iter << "." << ext; filename = vpIoTools::createFilePath(dirname, s.str()); - } else { + } + else { snprintf(cfilename, FILENAME_MAX, opt_ppath.c_str(), iter); filename = cfilename; } @@ -437,7 +443,8 @@ int main(int argc, const char **argv) vpDisplay::getClick(vpI); } return EXIT_SUCCESS; - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "Catch an exception: " << e << std::endl; return EXIT_FAILURE; } @@ -457,8 +464,8 @@ int main() int main() { std::cout << "visp_klt module or X11, GTK, GDI or OpenCV display " - "functionalities are required..." - << std::endl; -} + "functionalities are required..." + << std::endl; + } #endif diff --git a/example/tracking/trackMeCircle.cpp b/example/tracking/trackMeCircle.cpp index 7baf042c21..2597ed0538 100644 --- a/example/tracking/trackMeCircle.cpp +++ b/example/tracking/trackMeCircle.cpp @@ -70,6 +70,10 @@ // List of allowed command line options #define GETOPTARGS "cdi:h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam, std::string ipath); bool getOptions(int argc, const char **argv, std::string &ipath, bool &click_allowed, bool &display); diff --git a/example/tracking/trackMeEllipse.cpp b/example/tracking/trackMeEllipse.cpp index b9ddd05ae0..36f25fded1 100644 --- a/example/tracking/trackMeEllipse.cpp +++ b/example/tracking/trackMeEllipse.cpp @@ -71,6 +71,10 @@ // List of allowed command line options #define GETOPTARGS "Aabcdf:hi:l:p:r:s:S:t:vw:" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! Print the program options. @@ -326,8 +330,8 @@ int main(int argc, const char **argv) // Read the command line options if (getOptions(argc, argv, opt_ipath, opt_ppath, opt_first, opt_last, opt_step, opt_click_allowed, - opt_display, opt_display_scale_auto, opt_track_circle, opt_track_arc, opt_save, - opt_me_range, opt_me_sample_step, opt_me_threshold, opt_verbose) == false) { + opt_display, opt_display_scale_auto, opt_track_circle, opt_track_arc, opt_save, + opt_me_range, opt_me_sample_step, opt_me_threshold, opt_verbose) == false) { return EXIT_FAILURE; } diff --git a/example/tracking/trackMeLine.cpp b/example/tracking/trackMeLine.cpp index 2057390cf4..5bc03dda0d 100644 --- a/example/tracking/trackMeLine.cpp +++ b/example/tracking/trackMeLine.cpp @@ -76,6 +76,10 @@ // List of allowed command line options #define GETOPTARGS "cdf:hi:l:p:s:" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + /*! Print the program options. @@ -247,7 +251,7 @@ int main(int argc, const char **argv) // Read the command line options if (getOptions(argc, argv, opt_ipath, opt_ppath, opt_first, opt_last, opt_step, opt_click_allowed, - opt_display) == false) { + opt_display) == false) { return EXIT_FAILURE; } diff --git a/example/tracking/trackMeNurbs.cpp b/example/tracking/trackMeNurbs.cpp index 82a7d3c3e6..eabe0ef6aa 100644 --- a/example/tracking/trackMeNurbs.cpp +++ b/example/tracking/trackMeNurbs.cpp @@ -73,6 +73,10 @@ // List of allowed command line options #define GETOPTARGS "cdi:h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam, std::string ipath); bool getOptions(int argc, const char **argv, std::string &ipath, bool &click_allowed, bool &display); @@ -344,6 +348,6 @@ int main() std::cout << "visp_me module or X11, GTK, GDI or OpenCV display " "functionalities are required..." << std::endl; -} + } #endif diff --git a/example/video/imageSequenceReader.cpp b/example/video/imageSequenceReader.cpp index a8e841bbfa..aec623acb3 100644 --- a/example/video/imageSequenceReader.cpp +++ b/example/video/imageSequenceReader.cpp @@ -43,6 +43,7 @@ Reading an image sequence using vpVideoReader class. */ +#include #include #include #include @@ -59,6 +60,10 @@ // List of allowed command line options #define GETOPTARGS "cdi:p:f:h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam, std::string ipath, std::string ppath); bool getOptions(int argc, const char **argv, std::string &ipath, std::string &ppath, int &first, bool &click_allowed, bool &display); diff --git a/example/video/videoReader.cpp b/example/video/videoReader.cpp index 57992dd3bc..a6893ca10c 100644 --- a/example/video/videoReader.cpp +++ b/example/video/videoReader.cpp @@ -60,6 +60,10 @@ // List of allowed command line options #define GETOPTARGS "cdi:p:h" +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam, std::string ipath, std::string ppath); bool getOptions(int argc, const char **argv, std::string &ipath, std::string &ppath, bool &click_allowed, bool &display); @@ -83,7 +87,7 @@ SYNOPSIS\n\ %s [-i ] \n\ [-h]\n\ ", - name); +name); fprintf(stdout, "\n\ OPTIONS: Default\n\ @@ -212,8 +216,8 @@ int main(int argc, const char **argv) if (ipath != env_ipath) { std::cout << std::endl << "WARNING: " << std::endl; std::cout << " Since -i " - << " is different from VISP_IMAGE_PATH=" << env_ipath << std::endl - << " we skip the environment variable." << std::endl; + << " is different from VISP_IMAGE_PATH=" << env_ipath << std::endl + << " we skip the environment variable." << std::endl; } } @@ -222,9 +226,9 @@ int main(int argc, const char **argv) usage(argv[0], nullptr, ipath, opt_ppath); std::cerr << std::endl << "ERROR:" << std::endl; std::cerr << " Use -i option or set VISP_INPUT_IMAGE_PATH " << std::endl - << " environment variable to specify the location of the " << std::endl - << " video path where test images are located." << std::endl - << std::endl; + << " environment variable to specify the location of the " << std::endl + << " video path where test images are located." << std::endl + << std::endl; return EXIT_FAILURE; } @@ -239,7 +243,8 @@ int main(int argc, const char **argv) if (opt_ppath.empty()) { filename = vpIoTools::createFilePath(ipath, "video/cube.mpeg"); - } else { + } + else { filename.assign(opt_ppath); } @@ -305,7 +310,8 @@ int main(int argc, const char **argv) std::cout << "Click to exit this example" << std::endl; vpDisplay::getClick(I); } - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "Catch an exception: " << e << std::endl; } return EXIT_SUCCESS; diff --git a/example/wireframe-simulator/wireframeSimulator.cpp b/example/wireframe-simulator/wireframeSimulator.cpp index 8638b2061c..9eb333d71b 100644 --- a/example/wireframe-simulator/wireframeSimulator.cpp +++ b/example/wireframe-simulator/wireframeSimulator.cpp @@ -42,6 +42,7 @@ #include #include +#include #include #include #include @@ -59,6 +60,10 @@ #ifdef VISP_HAVE_DISPLAY +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv, bool &display, bool &click); @@ -265,17 +270,17 @@ Create a display for each different cameras. std::cout << std::endl; std::cout << "Here are presented the effect of the basic functions of " - "the simulator" - << std::endl; + "the simulator" + << std::endl; std::cout << std::endl; if (opt_display) { if (opt_click) { std::cout << "Click on the internal view window to continue. the " - "object will move. The external cameras are fixed. The " - "main camera moves too because the homogeneous matrix " - "cMo didn't change." - << std::endl; + "object will move. The external cameras are fixed. The " + "main camera moves too because the homogeneous matrix " + "cMo didn't change." + << std::endl; vpDisplay::getClick(Iint); } vpDisplay::display(Iint); @@ -313,9 +318,9 @@ Create a display for each different cameras. } std::cout << std::endl; std::cout << "Now you can move the main external camera. Click inside " - "the corresponding window with one of the three buttons of " - "your mouse and move the pointer." - << std::endl; + "the corresponding window with one of the three buttons of " + "your mouse and move the pointer." + << std::endl; std::cout << std::endl; std::cout << "Click on the internal view window when you are finished" << std::endl; @@ -334,12 +339,13 @@ Create a display for each different cameras. std::cout << std::endl; std::cout << "You have seen the main capabilities of the simulator. " - "Other specific functionalities are available. Please " - "refers to the html documentation to access the list of all " - "functions" - << std::endl; + "Other specific functionalities are available. Please " + "refers to the html documentation to access the list of all " + "functions" + << std::endl; return EXIT_SUCCESS; - } catch (const vpException &e) { + } + catch (const vpException &e) { std::cout << "Catch an exception: " << e << std::endl; return EXIT_SUCCESS; } @@ -348,12 +354,12 @@ Create a display for each different cameras. int main() { std::cout << "You do not have X11, or GDI (Graphical Device Interface), or GTK functionalities to display images..." - << std::endl; + << std::endl; std::cout << "Tip if you are on a unix-like system:" << std::endl; std::cout << "- Install X11, configure again ViSP using cmake and build again this example" << std::endl; std::cout << "Tip if you are on a windows-like system:" << std::endl; std::cout << "- Install GDI, configure again ViSP using cmake and build again this example" << std::endl; return EXIT_SUCCESS; -} + } #endif