Visual Servoing Platform  version 3.6.1 under development (2024-04-19)
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/vpMeterPixelConversion.h>
43 #include <visp3/core/vpPixelMeterConversion.h>
44 #include <visp3/core/vpPoint.h>
45 #include <visp3/core/vpPolygon3D.h>
46 
47 #include <vector>
48 
57 class VISP_EXPORT vpMbtPolygon : public vpPolygon3D
58 {
59 public:
62  int index;
64  bool isvisible;
69  bool useLod;
77  std::string name;
81 
82 public:
83  vpMbtPolygon();
84  vpMbtPolygon(const vpMbtPolygon &mbtp);
85 
91  inline int getIndex() const { return index; }
92 
98  inline std::string getName() const { return name; }
99 
100  inline bool isAppearing() const { return isappearing; }
101  inline bool isPolygonOriented() { return hasOrientation; }
102  virtual bool isVisible(const vpHomogeneousMatrix &cMo, double alpha, const bool &modulo = false,
103  const vpCameraParameters &cam = vpCameraParameters(), unsigned int width = 0,
104  unsigned int height = 0);
105  bool isVisible() const { return isvisible; }
106 
107  vpMbtPolygon &operator=(const vpMbtPolygon &mbtp);
108 
114  virtual inline void setIndex(int i) { index = i; }
115 
116  // Due to a doxygen warning include the sample code in the doc, we remove
117  // the inline and put the doc in the *.cpp file
118  void setLod(bool use_lod);
131  inline void setMinLineLengthThresh(double min_line_length) { this->minLineLengthThresh = min_line_length; }
142  inline void setMinPolygonAreaThresh(double min_polygon_area) { this->minPolygonAreaThresh = min_polygon_area; }
143 
149  inline void setName(const std::string &face_name) { this->name = face_name; }
150 
156  inline void setIsPolygonOriented(const bool &oriented) { this->hasOrientation = oriented; }
157 };
158 
159 #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:58
void setMinPolygonAreaThresh(double min_polygon_area)
Definition: vpMbtPolygon.h:142
bool isvisible
flag to specify whether the face is visible or not
Definition: vpMbtPolygon.h:64
std::string getName() const
Definition: vpMbtPolygon.h:98
bool isAppearing() const
Definition: vpMbtPolygon.h:100
void setName(const std::string &face_name)
Definition: vpMbtPolygon.h:149
bool hasOrientation
Definition: vpMbtPolygon.h:80
double minLineLengthThresh
Definition: vpMbtPolygon.h:72
virtual void setIndex(int i)
Definition: vpMbtPolygon.h:114
double minPolygonAreaThresh
Definition: vpMbtPolygon.h:75
void setMinLineLengthThresh(double min_line_length)
Definition: vpMbtPolygon.h:131
bool isappearing
flag to specify whether the face is appearing or not
Definition: vpMbtPolygon.h:66
std::string name
Name of the polygon.
Definition: vpMbtPolygon.h:77
bool isPolygonOriented()
Definition: vpMbtPolygon.h:101
void setIsPolygonOriented(const bool &oriented)
Definition: vpMbtPolygon.h:156
bool isVisible() const
Definition: vpMbtPolygon.h:105
int getIndex() const
Definition: vpMbtPolygon.h:91
Implements a 3D polygon with render functionalities like clipping.
Definition: vpPolygon3D.h:55
vpPolygon3D & operator=(const vpPolygon3D &mbtp)
Definition: vpPolygon3D.cpp:70