From 6f09e697002e054a4dc7fb03ac0671cf61723961 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Wed, 25 Oct 2023 10:47:56 +0200 Subject: [PATCH] Fix override --- .../gui/include/visp3/gui/vpDisplayWin32.h | 15 +- .../mbt/include/visp3/mbt/vpMbHiddenFaces.h | 451 +++++++++--------- 2 files changed, 222 insertions(+), 244 deletions(-) diff --git a/modules/gui/include/visp3/gui/vpDisplayWin32.h b/modules/gui/include/visp3/gui/vpDisplayWin32.h index 3d3c31f0fc..47a8d8611a 100644 --- a/modules/gui/include/visp3/gui/vpDisplayWin32.h +++ b/modules/gui/include/visp3/gui/vpDisplayWin32.h @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2023 by Inria. All rights reserved. * @@ -30,11 +29,7 @@ * * Description: * Windows 32 display base class - * - * Authors: - * Bruno Renier - * -*****************************************************************************/ + */ #include @@ -165,10 +160,10 @@ class VISP_EXPORT vpDisplayWin32 : public vpDisplay void displayCircle(const vpImagePoint ¢er, unsigned int radius, const vpColor &color, bool fill = false, unsigned int thickness = 1) override; - void displayCross(const vpImagePoint &ip, unsigned int size, const vpColor &color, unsigned int thickness = 1); override + void displayCross(const vpImagePoint &ip, unsigned int size, const vpColor &color, unsigned int thickness = 1) override; - void displayDotLine(const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, - unsigned int thickness = 1) override; + void displayDotLine(const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, + unsigned int thickness = 1) override; void displayLine(const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness = 1) override; diff --git a/modules/tracker/mbt/include/visp3/mbt/vpMbHiddenFaces.h b/modules/tracker/mbt/include/visp3/mbt/vpMbHiddenFaces.h index b5a5cea431..8edb9db333 100644 --- a/modules/tracker/mbt/include/visp3/mbt/vpMbHiddenFaces.h +++ b/modules/tracker/mbt/include/visp3/mbt/vpMbHiddenFaces.h @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2023 by Inria. All rights reserved. * @@ -30,13 +29,8 @@ * * Description: * Generic model based tracker. This class declares the methods to implement - *in order to have a model based tracker. - * - * Authors: - * Romain Tallonneau - * Aurelien Yol - * -*****************************************************************************/ + * in order to have a model based tracker. + */ #pragma once #ifndef vpMbHiddenFaces_HH @@ -60,12 +54,12 @@ template class vpMbHiddenFaces; template void swap(vpMbHiddenFaces &first, vpMbHiddenFaces &second); /*! - \class vpMbHiddenFaces - - \brief Implementation of the polygons management for the model-based - trackers. - - \ingroup group_mbt_faces + * \class vpMbHiddenFaces + * + * \brief Implementation of the polygons management for the model-based + * trackers. + * + * \ingroup group_mbt_faces */ template class vpMbHiddenFaces { @@ -118,10 +112,10 @@ template class vpMbHiddenFaces #endif /*! - Get the list of polygons. - - \return Mbt Klt polygons list. - */ + * Get the list of polygons. + * + * \return Mbt Klt polygons list. + */ std::vector &getPolygon() { return Lpol; } #ifdef VISP_HAVE_OGRE @@ -129,40 +123,40 @@ template class vpMbHiddenFaces #endif /*! - get the number of visible polygons. - - \return number of visible polygons. - */ + * Get the number of visible polygons. + * + * \return number of visible polygons. + */ unsigned int getNbVisiblePolygon() const { return nbVisiblePolygon; } #ifdef VISP_HAVE_OGRE /*! - Get the number of rays that will be sent toward each polygon for - visibility test. Each ray will go from the optic center of the camera to a - random point inside the considered polygon. - - \sa getGoodNbRayCastingAttemptsRatio() - - \return Number of rays sent. - */ + * Get the number of rays that will be sent toward each polygon for + * visibility test. Each ray will go from the optic center of the camera to a + * random point inside the considered polygon. + * + * \sa getGoodNbRayCastingAttemptsRatio() + * + * \return Number of rays sent. + */ unsigned int getNbRayCastingAttemptsForVisibility() { return nbRayAttempts; } /*! - Get the Ogre3D Context. - - \return A pointer on a vpAROgre instance. - */ + * Get the Ogre3D Context. + * + * \return A pointer on a vpAROgre instance. + */ vpAROgre *getOgreContext() { return ogre; } /*! - Get the ratio of visibility attempts that has to be successful to consider - a polygon as visible. - - \sa getNbRayCastingAttemptsForVisibility() - - \return Ratio of successful attempts that has to be considered. Value will - be between 0.0 (0%) and 1.0 (100%). - */ + * Get the ratio of visibility attempts that has to be successful to consider + * a polygon as visible. + * + * \sa getNbRayCastingAttemptsForVisibility() + * + * \return Ratio of successful attempts that has to be considered. Value will + * be between 0.0 (0%) and 1.0 (100%). + */ double getGoodNbRayCastingAttemptsRatio() { return ratioVisibleRay; } #endif @@ -170,69 +164,69 @@ template class vpMbHiddenFaces #ifdef VISP_HAVE_OGRE /*! - Tell whether if Ogre Context is initialised or not. - - \return True if it does, false otherwise. - */ + * Tell whether if Ogre Context is initialised or not. + * + * \return True if it does, false otherwise. + */ bool isOgreInitialised() { return ogreInitialised; } #endif /*! - Check if the polygon at position i in the list is visible. - - \param i : TPosition in the list. - - \return Return true if the polygon is visible. -*/ + * Check if the polygon at position i in the list is visible. + * + * \param i : TPosition in the list. + * + * \return Return true if the polygon is visible. + */ bool isVisible(unsigned int i) { return Lpol[i]->isVisible(); } #ifdef VISP_HAVE_OGRE bool isVisibleOgre(const vpTranslationVector &cameraPos, const unsigned int &index); #endif - //! operator[] as modifier. + //! Operator[] as modifier. inline PolygonType *operator[](unsigned int i) { return Lpol[i]; } - //! operator[] as reader. + //! Operator[] as reader. inline const PolygonType *operator[](unsigned int i) const { return Lpol[i]; } void reset(); #ifdef VISP_HAVE_OGRE /*! - Set the background size (by default it is 640x480). - The background size has to match with the size of the image that you are - using for the traking. - - \warning This function has to be called before initOgre(). - - \param h : Height of the background - \param w : Width of the background - */ + * Set the background size (by default it is 640x480). + * The background size has to match with the size of the image that you are + * using for the tracking. + * + * \warning This function has to be called before initOgre(). + * + * \param h : Height of the background + * \param w : Width of the background + */ void setBackgroundSizeOgre(const unsigned int &h, const unsigned int &w) { ogreBackground = vpImage(h, w, 0); } /*! - Set the number of rays that will be sent toward each polygon for - visibility test. Each ray will go from the optic center of the camera to a - random point inside the considered polygon. - - \sa setGoodNbRayCastingAttemptsRatio(const double &) - - \param attempts Number of rays to be sent. - */ + * Set the number of rays that will be sent toward each polygon for + * visibility test. Each ray will go from the optic center of the camera to a + * random point inside the considered polygon. + * + * \sa setGoodNbRayCastingAttemptsRatio(const double &) + * + * \param attempts Number of rays to be sent. + */ void setNbRayCastingAttemptsForVisibility(const unsigned int &attempts) { nbRayAttempts = attempts; } /*! - Set the ratio of visibility attempts that has to be successful to consider - a polygon as visible. - - \sa setNbRayCastingAttemptsForVisibility(const unsigned int &) - - \param ratio : Ratio of successful attempts that has to be considered. - Value has to be between 0.0 (0%) and 1.0 (100%). - */ + * Set the ratio of visibility attempts that has to be successful to consider + * a polygon as visible. + * + * \sa setNbRayCastingAttemptsForVisibility(const unsigned int &) + * + * \param ratio : Ratio of successful attempts that has to be considered. + * Value has to be between 0.0 (0%) and 1.0 (100%). + */ void setGoodNbRayCastingAttemptsRatio(const double &ratio) { ratioVisibleRay = ratio; @@ -242,16 +236,16 @@ template class vpMbHiddenFaces ratioVisibleRay = 0.0; } /*! - Enable/Disable the appearance of Ogre config dialog on startup. - - \warning This method has only effect when Ogre is used and Ogre visibility - test is enabled using setOgreVisibilityTest() with true parameter. - - \param showConfigDialog : if true, shows Ogre dialog window (used to set - Ogre rendering options) when Ogre visibility is enabled. By default, this - functionality is turned off. - */ - inline void setOgreShowConfigDialog(bool showConfigDialog) override { ogreShowConfigDialog = showConfigDialog; } + * Enable/Disable the appearance of Ogre config dialog on startup. + * + * \warning This method has only effect when Ogre is used and Ogre visibility + * test is enabled using setOgreVisibilityTest() with true parameter. + * + * \param showConfigDialog : if true, shows Ogre dialog window (used to set + * Ogre rendering options) when Ogre visibility is enabled. By default, this + * functionality is turned off. + */ + inline void setOgreShowConfigDialog(bool showConfigDialog) { ogreShowConfigDialog = showConfigDialog; } #endif unsigned int setVisible(unsigned int width, unsigned int height, const vpCameraParameters &cam, @@ -270,16 +264,16 @@ template class vpMbHiddenFaces bool &changed); #endif /*! - Get the number of polygons. - - \return Size of the list. - */ + * Get the number of polygons. + * + * \return Size of the list. + */ inline unsigned int size() const { return (unsigned int)Lpol.size(); } }; /*! - Basic constructor. -*/ + * Basic constructor. + */ template vpMbHiddenFaces::vpMbHiddenFaces() : Lpol(), nbVisiblePolygon(0), scanlineRender() { @@ -294,8 +288,8 @@ vpMbHiddenFaces::vpMbHiddenFaces() : Lpol(), nbVisiblePolygon(0), s } /*! - Basic destructor. -*/ + * Basic destructor. + */ template vpMbHiddenFaces::~vpMbHiddenFaces() { for (unsigned int i = 0; i < Lpol.size(); i++) { @@ -325,8 +319,8 @@ template vpMbHiddenFaces::~vpMbHiddenFaces() } /*! - \relates vpMbHiddenFaces -*/ + * \relates vpMbHiddenFaces + */ template vpMbHiddenFaces::vpMbHiddenFaces(const vpMbHiddenFaces ©) : Lpol(), nbVisiblePolygon(copy.nbVisiblePolygon), scanlineRender(copy.scanlineRender) @@ -360,8 +354,8 @@ template void swap(vpMbHiddenFaces &first, vpMb } /*! - Copy assignment operator. -*/ + * Copy assignment operator. + */ template vpMbHiddenFaces &vpMbHiddenFaces::operator=(vpMbHiddenFaces other) { @@ -371,10 +365,10 @@ vpMbHiddenFaces &vpMbHiddenFaces::operator=(vpMbHidden } /*! - Add a polygon to the list of polygons. - - \param p : The polygon to add. -*/ + * Add a polygon to the list of polygons. + * + * \param p : The polygon to add. + */ template void vpMbHiddenFaces::addPolygon(PolygonType *p) { PolygonType *p_new = new PolygonType; @@ -393,8 +387,8 @@ template void vpMbHiddenFaces::addPolygon(Polyg } /*! - Reset the Hidden faces (remove the list of PolygonType) -*/ + * Reset the hidden faces (remove the list of PolygonType). + */ template void vpMbHiddenFaces::reset() { nbVisiblePolygon = 0; @@ -431,12 +425,12 @@ template void vpMbHiddenFaces::reset() } /*! - Compute the clipped points of the polygons that have been added via - addPolygon(). - - \param cMo : Pose that will be used to clip the polygons. - \param cam : Camera parameters that will be used to clip the polygons. -*/ + * Compute the clipped points of the polygons that have been added via + * addPolygon(). + * + * \param cMo : Pose that will be used to clip the polygons. + * \param cam : Camera parameters that will be used to clip the polygons. + */ template void vpMbHiddenFaces::computeClippedPolygons(const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam) { @@ -453,13 +447,13 @@ void vpMbHiddenFaces::computeClippedPolygons(const vpHomogeneousMat } /*! - Render the scene in order to perform, later via computeScanLineQuery(), - visibility tests. - - \param cam : Camera parameters that will be used to render the scene. - \param w : Width of the render window. - \param h : Height of the render window. -*/ + * Render the scene in order to perform, later via computeScanLineQuery(), + * visibility tests. + * + * \param cam : Camera parameters that will be used to render the scene. + * \param w : Width of the render window. + * \param h : Height of the render window. + */ template void vpMbHiddenFaces::computeScanLineRender(const vpCameraParameters &cam, const unsigned int &w, const unsigned int &h) @@ -487,16 +481,15 @@ void vpMbHiddenFaces::computeScanLineRender(const vpCameraParameter } /*! - Compute Scanline visibility results for a line. - - \warning computeScanLineRender() function has to be called before - - \param a : First point of the line. - \param b : Second point of the line. - \param lines : Result of the scanline visibility. List of the visible parts - of the line. \param displayResults : True if the results have to be - displayed. False otherwise -*/ + * Compute scanline visibility results for a line. + * + * \warning computeScanLineRender() function has to be called before + * + * \param a : First point of the line. + * \param b : Second point of the line. + * \param lines : Result of the scanline visibility. List of the visible parts of the line. + * \param displayResults : True if the results have to be displayed. False otherwise. + */ template void vpMbHiddenFaces::computeScanLineQuery(const vpPoint &a, const vpPoint &b, std::vector > &lines, @@ -506,19 +499,19 @@ void vpMbHiddenFaces::computeScanLineQuery(const vpPoint &a, const } /*! - Compute the number of visible polygons. - - \param cMo : The pose of the camera - \param angleAppears : Angle used to test the appearance of a face - \param angleDisappears : Angle used to test the disappearance of a face - \param changed : True if a face appeared, disappeared or too many points - have been lost. False otherwise \param useOgre : True if a Ogre is used to - test the visibility, False otherwise \param not_used : Unused parameter. - \param I : Image used to test if a face is entirely projected in the image. - \param cam : Camera parameters. - - \return Return the number of visible polygons -*/ + * Compute the number of visible polygons. + * + * \param cMo : The pose of the camera + * \param angleAppears : Angle used to test the appearance of a face + * \param angleDisappears : Angle used to test the disappearance of a face + * \param changed : True if a face appeared, disappeared or too many points have been lost. False otherwise + * \param useOgre : True if a Ogre is used to test the visibility, False otherwise + * \param not_used : Unused parameter. + * \param I : Image used to test if a face is entirely projected in the image. + * \param cam : Camera parameters. + * + * \return Return the number of visible polygons + */ template unsigned int vpMbHiddenFaces::setVisiblePrivate(const vpHomogeneousMatrix &cMo, const double &angleAppears, const double &angleDisappears, bool &changed, bool useOgre, @@ -549,23 +542,21 @@ unsigned int vpMbHiddenFaces::setVisiblePrivate(const vpHomogeneous } /*! - Compute the visibility of a given face index. - - \param cMo : The pose of the camera - \param angleAppears : Angle used to test the appearance of a face - \param angleDisappears : Angle used to test the disappearance of a face - \param changed : True if a face appeared, disappeared or too many points - have been lost. False otherwise - \param useOgre : True if a Ogre is used to test the visibility, False otherwise. - \param not_used : Unused parameter. - \param width, height Image size. - \param cam : Camera parameters. - \param cameraPos : Position of the camera. Used only when Ogre is used as - 3rd party. - \param index : Index of the face to consider. - - \return Return true if the face is visible. -*/ + * Compute the visibility of a given face index. + * + * \param cMo : The pose of the camera + * \param angleAppears : Angle used to test the appearance of a face + * \param angleDisappears : Angle used to test the disappearance of a face + * \param changed : True if a face appeared, disappeared or too many points have been lost. False otherwise. + * \param useOgre : True if a Ogre is used to test the visibility, False otherwise. + * \param not_used : Unused parameter. + * \param width, height Image size. + * \param cam : Camera parameters. + * \param cameraPos : Position of the camera. Used only when Ogre is used as 3rd party. + * \param index : Index of the face to consider. + * + * \return Return true if the face is visible. + */ template bool vpMbHiddenFaces::computeVisibility(const vpHomogeneousMatrix &cMo, const double &angleAppears, const double &angleDisappears, bool &changed, bool useOgre, @@ -653,18 +644,16 @@ bool vpMbHiddenFaces::computeVisibility(const vpHomogeneousMatrix & } /*! - Compute the number of visible polygons. - - \param width, height : Image size used to check if the region of interest is inside the - image. - \param cam : Camera parameters. - \param cMo : The pose of the camera. - \param angle : Angle used to test the appearance and disappearance of a face. - \param changed : True if a face appeared, disappeared or too many - points have been lost. False otherwise. - - \return Return the number of visible polygons -*/ + * Compute the number of visible polygons. + * + * \param width, height : Image size used to check if the region of interest is inside the image. + * \param cam : Camera parameters. + * \param cMo : The pose of the camera. + * \param angle : Angle used to test the appearance and disappearance of a face. + * \param changed : True if a face appeared, disappeared or too many points have been lost. False otherwise. + * + * \return Return the number of visible polygons + */ template unsigned int vpMbHiddenFaces::setVisible(unsigned int width, unsigned int height, const vpCameraParameters &cam, const vpHomogeneousMatrix &cMo, @@ -674,19 +663,17 @@ unsigned int vpMbHiddenFaces::setVisible(unsigned int width, unsign } /*! - Compute the number of visible polygons. - - \param width, height : Image size used to check if the region of interest is inside the - image. - \param cam : Camera parameters. - \param cMo : The pose of the camera. - \param changed : True if a face appeared, disappeared or too many points - have been lost. False otherwise. - \param angleAppears : Angle used to test the appearance of a face. - \param angleDisappears : Angle used to test the disappearance of a face. - - \return Return the number of visible polygons -*/ + * Compute the number of visible polygons. + * + * \param width, height : Image size used to check if the region of interest is inside the image. + * \param cam : Camera parameters. + * \param cMo : The pose of the camera. + * \param changed : True if a face appeared, disappeared or too many points have been lost. False otherwise. + * \param angleAppears : Angle used to test the appearance of a face. + * \param angleDisappears : Angle used to test the disappearance of a face. + * + * \return Return the number of visible polygons + */ template unsigned int vpMbHiddenFaces::setVisible(unsigned int width, unsigned int height, const vpCameraParameters &cam, const vpHomogeneousMatrix &cMo, @@ -697,16 +684,15 @@ unsigned int vpMbHiddenFaces::setVisible(unsigned int width, unsign } /*! - Compute the number of visible polygons. - - \param cMo : The pose of the camera - \param angleAppears : Angle used to test the appearance of a face - \param angleDisappears : Angle used to test the disappearance of a face - \param changed : True if a face appeared, disappeared or too many points - have been lost. False otherwise - - \return Return the number of visible polygons -*/ + * Compute the number of visible polygons. + * + * \param cMo : The pose of the camera + * \param angleAppears : Angle used to test the appearance of a face + * \param angleDisappears : Angle used to test the disappearance of a face + * \param changed : True if a face appeared, disappeared or too many points have been lost. False otherwise + * + * \return Return the number of visible polygons + */ template unsigned int vpMbHiddenFaces::setVisible(const vpHomogeneousMatrix &cMo, const double &angleAppears, const double &angleDisappears, bool &changed) @@ -716,10 +702,10 @@ unsigned int vpMbHiddenFaces::setVisible(const vpHomogeneousMatrix #ifdef VISP_HAVE_OGRE /*! - Initialise the ogre context for face visibility tests. - - \param cam : Camera parameters. -*/ + * Initialise the ogre context for face visibility tests. + * + * \param cam : Camera parameters. + */ template void vpMbHiddenFaces::initOgre(const vpCameraParameters &cam) { ogreInitialised = true; @@ -748,10 +734,10 @@ template void vpMbHiddenFaces::initOgre(const v } /*! - Update the display in Ogre Window. - - \param cMo : Pose used to display. -*/ + * Update the display in Ogre Window. + * + * \param cMo : Pose used to display. + */ template void vpMbHiddenFaces::displayOgre(const vpHomogeneousMatrix &cMo) { if (ogreInitialised && !ogre->isWindowHidden()) { @@ -767,19 +753,17 @@ template void vpMbHiddenFaces::displayOgre(cons } /*! - Compute the number of visible polygons through Ogre3D. - - \param width, height : Image size used to check if the region of interest is inside the - image. - \param cam : Camera parameters. - \param cMo : The pose of the camera. - \param changed : True if a face appeared, disappeared or too many points - have been lost. False otherwise. - \param angleAppears : Angle used to test the appearance of a face. - \param angleDisappears : Angle used to test the disappearance of a face. - - \return Return the number of visible polygons -*/ + * Compute the number of visible polygons through Ogre3D. + * + * \param width, height : Image size used to check if the region of interest is inside the image. + * \param cam : Camera parameters. + * \param cMo : The pose of the camera. + * \param changed : True if a face appeared, disappeared or too many points have been lost. False otherwise. + * \param angleAppears : Angle used to test the appearance of a face. + * \param angleDisappears : Angle used to test the disappearance of a face. + * + * \return Return the number of visible polygons + */ template unsigned int vpMbHiddenFaces::setVisibleOgre(unsigned int width, unsigned int height, const vpCameraParameters &cam, const vpHomogeneousMatrix &cMo, @@ -790,16 +774,15 @@ unsigned int vpMbHiddenFaces::setVisibleOgre(unsigned int width, un } /*! - Compute the number of visible polygons through Ogre3D. - - \param cMo : The pose of the camera - \param angleAppears : Angle used to test the appearance of a face - \param angleDisappears : Angle used to test the disappearance of a face - \param changed : True if a face appeared, disappeared or too many points - have been lost. False otherwise - - \return Return the number of visible polygons -*/ + * Compute the number of visible polygons through Ogre3D. + * + * \param cMo : The pose of the camera + * \param angleAppears : Angle used to test the appearance of a face + * \param angleDisappears : Angle used to test the disappearance of a face + * \param changed : True if a face appeared, disappeared or too many points have been lost. False otherwise + * + * \return Return the number of visible polygons + */ template unsigned int vpMbHiddenFaces::setVisibleOgre(const vpHomogeneousMatrix &cMo, const double &angleAppears, const double &angleDisappears, bool &changed) @@ -808,13 +791,13 @@ unsigned int vpMbHiddenFaces::setVisibleOgre(const vpHomogeneousMat } /*! - Test the visibility of a polygon through Ogre3D via RayCasting. - - \param cameraPos : Position of the camera in the 3D world. - \param index : Index of the polygon. - - \return Return true if the polygon is visible, False otherwise. -*/ + * Test the visibility of a polygon through Ogre3D via RayCasting. + * + * \param cameraPos : Position of the camera in the 3D world. + * \param index : Index of the polygon. + * + * \return Return true if the polygon is visible, False otherwise. + */ template bool vpMbHiddenFaces::isVisibleOgre(const vpTranslationVector &cameraPos, const unsigned int &index) {