Visual Servoing Platform  version 3.6.1 under development (2024-07-27)
vpMbtPolygon.h
1 /*
2  * ViSP, open source Visual Servoing Platform software.
3  * Copyright (C) 2005 - 2023 by Inria. All rights reserved.
4  *
5  * This software is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  * See the file LICENSE.txt at the root directory of this source
10  * distribution for additional information about the GNU GPL.
11  *
12  * For using ViSP with software that can not be combined with the GNU
13  * GPL, please contact Inria about acquiring a ViSP Professional
14  * Edition License.
15  *
16  * See https://visp.inria.fr for more information.
17  *
18  * This software was developed at:
19  * Inria Rennes - Bretagne Atlantique
20  * Campus Universitaire de Beaulieu
21  * 35042 Rennes Cedex
22  * France
23  *
24  * If you have questions regarding the use of this file, please contact
25  * Inria at visp@inria.fr
26  *
27  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29  *
30  * Description:
31  * Implements a polygon of the model used by the model-based tracker.
32  */
33 
39 #ifndef vpMbtPolygon_HH
40 #define vpMbtPolygon_HH
41 
42 #include <visp3/core/vpConfig.h>
43 #include <visp3/core/vpMeterPixelConversion.h>
44 #include <visp3/core/vpPixelMeterConversion.h>
45 #include <visp3/core/vpPoint.h>
46 #include <visp3/core/vpPolygon3D.h>
47 
48 #include <vector>
49 
59 class VISP_EXPORT vpMbtPolygon : public vpPolygon3D
60 {
61 public:
64  int index;
66  bool isvisible;
71  bool useLod;
79  std::string name;
83 
84 public:
85  vpMbtPolygon();
86  vpMbtPolygon(const vpMbtPolygon &mbtp);
87 
93  inline int getIndex() const { return index; }
94 
100  inline std::string getName() const { return name; }
101 
102  inline bool isAppearing() const { return isappearing; }
103  inline bool isPolygonOriented() { return hasOrientation; }
104  virtual bool isVisible(const vpHomogeneousMatrix &cMo, double alpha, const bool &modulo = false,
105  const vpCameraParameters &cam = vpCameraParameters(), unsigned int width = 0,
106  unsigned int height = 0);
107  bool isVisible() const { return isvisible; }
108 
109  vpMbtPolygon &operator=(const vpMbtPolygon &mbtp);
110 
116  virtual inline void setIndex(int i) { index = i; }
117 
118  // Due to a doxygen warning include the sample code in the doc, we remove
119  // the inline and put the doc in the *.cpp file
120  void setLod(bool use_lod);
133  inline void setMinLineLengthThresh(double min_line_length) { this->minLineLengthThresh = min_line_length; }
144  inline void setMinPolygonAreaThresh(double min_polygon_area) { this->minPolygonAreaThresh = min_polygon_area; }
145 
151  inline void setName(const std::string &face_name) { this->name = face_name; }
152 
158  inline void setIsPolygonOriented(const bool &oriented) { this->hasOrientation = oriented; }
159 };
160 END_VISP_NAMESPACE
161 #endif
Generic class defining intrinsic camera parameters.
Implementation of an homogeneous matrix and operations on such kind of matrices.
Implementation of a polygon of the model used by the model-based tracker.
Definition: vpMbtPolygon.h:60
void setMinPolygonAreaThresh(double min_polygon_area)
Definition: vpMbtPolygon.h:144
bool isvisible
flag to specify whether the face is visible or not
Definition: vpMbtPolygon.h:66
std::string getName() const
Definition: vpMbtPolygon.h:100
bool isAppearing() const
Definition: vpMbtPolygon.h:102
void setName(const std::string &face_name)
Definition: vpMbtPolygon.h:151
bool hasOrientation
Definition: vpMbtPolygon.h:82
double minLineLengthThresh
Definition: vpMbtPolygon.h:74
virtual void setIndex(int i)
Definition: vpMbtPolygon.h:116
double minPolygonAreaThresh
Definition: vpMbtPolygon.h:77
void setMinLineLengthThresh(double min_line_length)
Definition: vpMbtPolygon.h:133
bool isappearing
flag to specify whether the face is appearing or not
Definition: vpMbtPolygon.h:68
std::string name
Name of the polygon.
Definition: vpMbtPolygon.h:79
bool isPolygonOriented()
Definition: vpMbtPolygon.h:103
void setIsPolygonOriented(const bool &oriented)
Definition: vpMbtPolygon.h:158
bool isVisible() const
Definition: vpMbtPolygon.h:107
int getIndex() const
Definition: vpMbtPolygon.h:93
Implements a 3D polygon with render functionalities like clipping.
Definition: vpPolygon3D.h:57
vpPolygon3D & operator=(const vpPolygon3D &mbtp)
Definition: vpPolygon3D.cpp:71