Visual Servoing Platform  version 3.0.0
vpMbtPolygon.h
1 /****************************************************************************
2  *
3  * This file is part of the ViSP software.
4  * Copyright (C) 2005 - 2015 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * ("GPL") version 2 as published by the Free Software Foundation.
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 http://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  * Authors:
34  * Nicolas Melchior
35  * Romain Tallonneau
36  * Eric Marchand
37  * Aurelien Yol
38  *
39  *****************************************************************************/
40 
46 #ifndef vpMbtPolygon_HH
47 #define vpMbtPolygon_HH
48 
49 #include <visp3/core/vpPoint.h>
50 #include <visp3/core/vpMeterPixelConversion.h>
51 #include <visp3/core/vpPixelMeterConversion.h>
52 #include <visp3/core/vpPolygon3D.h>
53 
54 #include <vector>
55 
64 class VISP_EXPORT vpMbtPolygon : public vpPolygon3D
65 {
66 public:
68  int index;
70  bool isvisible;
74  bool useLod;
80  std::string name;
83 
84 public:
85  vpMbtPolygon() ;
86  vpMbtPolygon(const vpMbtPolygon& mbtp) ;
87  virtual ~vpMbtPolygon() ;
88 
94  inline int getIndex() const {return index ;}
95 
101  inline std::string getName() const {return name;}
102 
103  inline bool isAppearing() const {return isappearing;}
104  inline bool isPolygonOriented() { return hasOrientation; }
105  virtual bool isVisible(const vpHomogeneousMatrix &cMo, const double alpha, const bool &modulo = false,
107  bool isVisible() const {return isvisible;}
108 
109  vpMbtPolygon& operator=(const vpMbtPolygon& mbtp) ;
110 
116  virtual inline void setIndex(const int i ) { index = i ; }
117 
118  // Due to a doxygen warning include the sample code in the doc, we remove the inline and put the doc in the *.cpp file
119  void setLod(const bool use_lod);
130  inline void setMinLineLengthThresh(const double min_line_length) {
131  this->minLineLengthThresh = min_line_length;
132  }
143  inline void setMinPolygonAreaThresh(const double min_polygon_area) {
144  this->minPolygonAreaThresh = min_polygon_area;
145  }
146 
152  inline void setName(const std::string &face_name) {
153  this->name = face_name;
154  }
155 
161  inline void setIsPolygonOriented(const bool &oriented) {
162  this->hasOrientation = oriented;
163  }
164 };
165 
166 #endif
167 
Implements a 3D polygon with render functionnalities like clipping.
Definition: vpPolygon3D.h:59
bool isVisible() const
Definition: vpMbtPolygon.h:107
std::string name
Name of the polygon.
Definition: vpMbtPolygon.h:80
Implementation of an homogeneous matrix and operations on such kind of matrices.
bool hasOrientation
Boolean that specify if the polygon has an orientation or not (mainly used for cylinders) ...
Definition: vpMbtPolygon.h:82
int index
Index of the polygon. Cannot be unsigned int because default value is -1.
Definition: vpMbtPolygon.h:68
void setMinPolygonAreaThresh(const double min_polygon_area)
Definition: vpMbtPolygon.h:143
void setName(const std::string &face_name)
Definition: vpMbtPolygon.h:152
double minLineLengthThresh
Threshold for minimum line length in pixel to consider if the line is visible or not in LOD case...
Definition: vpMbtPolygon.h:76
bool isAppearing() const
Definition: vpMbtPolygon.h:103
Implementation of a polygon of the model used by the model-based tracker.
Definition: vpMbtPolygon.h:64
std::string getName() const
Definition: vpMbtPolygon.h:101
int getIndex() const
Definition: vpMbtPolygon.h:94
Generic class defining intrinsic camera parameters.
double minPolygonAreaThresh
Threshold for minimum polygon area in pixel to consider if the polygon is visible or not in LOD case...
Definition: vpMbtPolygon.h:78
bool isPolygonOriented()
Definition: vpMbtPolygon.h:104
void setIsPolygonOriented(const bool &oriented)
Definition: vpMbtPolygon.h:161
vpPolygon3D & operator=(const vpPolygon3D &mbtp)
Definition: vpPolygon3D.cpp:70
bool isappearing
flag to specify whether the face is appearing or not
Definition: vpMbtPolygon.h:72
bool useLod
Flag to specify if the visibility of the polygon depends also of the current level of detail (LOD) ...
Definition: vpMbtPolygon.h:74
bool isvisible
flag to specify whether the face is visible or not
Definition: vpMbtPolygon.h:70
void setMinLineLengthThresh(const double min_line_length)
Definition: vpMbtPolygon.h:130
virtual void setIndex(const int i)
Definition: vpMbtPolygon.h:116