50 #ifndef vpMbtPolygon_HH
51 #define vpMbtPolygon_HH
53 #include <visp/vpPoint.h>
54 #include <visp/vpMeterPixelConversion.h>
55 #include <visp/vpPixelMeterConversion.h>
81 } vpMbtPolygonClippingType;
114 bool getClippedPointsFovGeneric(
const vpPoint &p1,
const vpPoint &p2,
116 unsigned int &p1ClippedInfo,
unsigned int &p2ClippedInfo,
118 const unsigned int &flag);
120 bool getClippedPointsDistance(
const vpPoint &p1,
const vpPoint &p2,
122 unsigned int &p1ClippedInfo,
unsigned int &p2ClippedInfo,
123 const unsigned int &flag,
const double &distance);
130 void addPoint(
const unsigned int n,
const vpPoint &P) ;
164 inline std::string
getName()
const {
return name;}
189 vpPoint & getPoint(
const unsigned int _index);
195 void getRoiClipped(std::vector<vpPoint> &points);
201 void getRoiClipped(
const vpCameraParameters &cam, std::vector<std::pair<vpImagePoint,unsigned int> > &roi);
206 virtual bool isVisible(
const vpHomogeneousMatrix &cMo,
const double alpha,
const bool &modulo =
false,
219 inline void setClipping(
const unsigned int &flags) { clippingFlag = flags; }
233 virtual inline void setIndex(
const int i ) { index = i ; }
236 void setLod(
const bool use_lod);
248 this->minLineLengthThresh = min_line_length;
261 this->minPolygonAreaThresh = min_polygon_area;
269 inline void setName(
const std::string &face_name) {
270 this->name = face_name;
273 virtual void setNbPoint(
const unsigned int nb) ;
283 static void getClippedPolygon(
const std::vector<vpPoint> &ptIn, std::vector<vpPoint> &ptOut,
const vpHomogeneousMatrix &cMo,
285 const double &znear = 0.001,
const double &zfar = 100 );
286 static void getMinMaxRoi(
const std::vector<vpImagePoint> &roi,
int & i_min,
int &i_max,
int &j_min,
int &j_max);
289 #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
void setFarClippingDistance(const double &dist)
void setClipping(const unsigned int &flags)
std::string name
Name of the polygon.
unsigned int getClipping() const
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
unsigned int clippingFlag
Clipping flag.
double getNearClippingDistance() const
int index
Index of the polygon. Cannot be unsigned int because default value is -1.
void setMinPolygonAreaThresh(const double min_polygon_area)
void setName(const std::string &face_name)
unsigned int nbpt
Number of points used to define the polygon.
void setNearClippingDistance(const double &dist)
unsigned int nbCornersInsidePrev
Number of corners inside the image during the last call to getNbCornerInsideImage.
Class that defines what is a point.
std::vector< std::pair< vpPoint, unsigned int > > roiPointsClip
Region of interest clipped.
double distFarClip
Distance for near clipping.
double minLineLengthThresh
Threshold for minimum line length in pixel to consider if the line is visible or not in LOD case...
Implementation of a polygon of the model used by the model-based tracker.
std::string getName() const
unsigned int getNbCornerInsidePrevImage() const
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...
bool isappearing
flag to specify whether the face is appearing or not
bool useLod
Flag to specify if the visibility of the polygon depends also of the current level of detail (LOD) ...
Class that provides a data structure for the column vectors as well as a set of operations on these v...
double getFarClippingDistance() const
unsigned int getNbPoint() const
bool isvisible
flag to specify whether the face is visible or not
double distNearClip
Distance for near clipping.
void setMinLineLengthThresh(const double min_line_length)
virtual void setIndex(const int i)
vpPoint * p
corners in the object frame