Visual Servoing Platform  version 3.1.0
vpMbtPolygon.h
1 /****************************************************************************
2  *
3  * This file is part of the ViSP software.
4  * Copyright (C) 2005 - 2017 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  * See the file LICENSE.txt at the root directory of this source
11  * distribution for additional information about the GNU GPL.
12  *
13  * For using ViSP with software that can not be combined with the GNU
14  * GPL, please contact Inria about acquiring a ViSP Professional
15  * Edition License.
16  *
17  * See http://visp.inria.fr for more information.
18  *
19  * This software was developed at:
20  * Inria Rennes - Bretagne Atlantique
21  * Campus Universitaire de Beaulieu
22  * 35042 Rennes Cedex
23  * France
24  *
25  * If you have questions regarding the use of this file, please contact
26  * Inria at visp@inria.fr
27  *
28  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
29  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
30  *
31  * Description:
32  * Implements a polygon of the model used by the model-based tracker.
33  *
34  * Authors:
35  * Nicolas Melchior
36  * Romain Tallonneau
37  * Eric Marchand
38  * Aurelien Yol
39  *
40  *****************************************************************************/
41 
47 #ifndef vpMbtPolygon_HH
48 #define vpMbtPolygon_HH
49 
50 #include <visp3/core/vpMeterPixelConversion.h>
51 #include <visp3/core/vpPixelMeterConversion.h>
52 #include <visp3/core/vpPoint.h>
53 #include <visp3/core/vpPolygon3D.h>
54 
55 #include <vector>
56 
66 class VISP_EXPORT vpMbtPolygon : public vpPolygon3D
67 {
68 public:
71  int index;
73  bool isvisible;
78  bool useLod;
86  std::string name;
90 
91 public:
92  vpMbtPolygon();
93  vpMbtPolygon(const vpMbtPolygon &mbtp);
94  virtual ~vpMbtPolygon();
95 
101  inline int getIndex() const { return index; }
102 
108  inline std::string getName() const { return name; }
109 
110  inline bool isAppearing() const { return isappearing; }
111  inline bool isPolygonOriented() { return hasOrientation; }
112  virtual bool isVisible(const vpHomogeneousMatrix &cMo, const double alpha, const bool &modulo = false,
113  const vpCameraParameters &cam = vpCameraParameters(),
115  bool isVisible() const { return isvisible; }
116 
117  vpMbtPolygon &operator=(const vpMbtPolygon &mbtp);
118 
124  virtual inline void setIndex(const int i) { index = i; }
125 
126  // Due to a doxygen warning include the sample code in the doc, we remove
127  // the inline and put the doc in the *.cpp file
128  void setLod(const bool use_lod);
141  inline void setMinLineLengthThresh(const double min_line_length) { this->minLineLengthThresh = min_line_length; }
152  inline void setMinPolygonAreaThresh(const double min_polygon_area) { this->minPolygonAreaThresh = min_polygon_area; }
153 
159  inline void setName(const std::string &face_name) { this->name = face_name; }
160 
166  inline void setIsPolygonOriented(const bool &oriented) { this->hasOrientation = oriented; }
167 };
168 
169 #endif
Implements a 3D polygon with render functionnalities like clipping.
Definition: vpPolygon3D.h:59
int getIndex() const
Definition: vpMbtPolygon.h:101
std::string name
Name of the polygon.
Definition: vpMbtPolygon.h:86
Implementation of an homogeneous matrix and operations on such kind of matrices.
std::string getName() const
Definition: vpMbtPolygon.h:108
bool hasOrientation
Definition: vpMbtPolygon.h:89
void setMinPolygonAreaThresh(const double min_polygon_area)
Definition: vpMbtPolygon.h:152
bool isAppearing() const
Definition: vpMbtPolygon.h:110
void setName(const std::string &face_name)
Definition: vpMbtPolygon.h:159
bool isVisible() const
Definition: vpMbtPolygon.h:115
double minLineLengthThresh
Definition: vpMbtPolygon.h:81
Implementation of a polygon of the model used by the model-based tracker.
Definition: vpMbtPolygon.h:66
Generic class defining intrinsic camera parameters.
double minPolygonAreaThresh
Definition: vpMbtPolygon.h:84
bool isPolygonOriented()
Definition: vpMbtPolygon.h:111
void setIsPolygonOriented(const bool &oriented)
Definition: vpMbtPolygon.h:166
vpPolygon3D & operator=(const vpPolygon3D &mbtp)
Definition: vpPolygon3D.cpp:70
bool isappearing
flag to specify whether the face is appearing or not
Definition: vpMbtPolygon.h:75
bool isvisible
flag to specify whether the face is visible or not
Definition: vpMbtPolygon.h:73
void setMinLineLengthThresh(const double min_line_length)
Definition: vpMbtPolygon.h:141
virtual void setIndex(const int i)
Definition: vpMbtPolygon.h:124