44 #ifndef vpPolygon3D_HH
45 #define vpPolygon3D_HH
49 #include <visp3/core/vpMeterPixelConversion.h>
50 #include <visp3/core/vpPixelMeterConversion.h>
51 #include <visp3/core/vpPoint.h>
72 } vpPolygon3DClippingType;
93 unsigned int &p1ClippedInfo,
unsigned int &p2ClippedInfo,
const vpColVector &normal,
94 const unsigned int &flag);
97 unsigned int &p1ClippedInfo,
unsigned int &p2ClippedInfo,
const unsigned int &flag,
98 const double &distance);
105 void addPoint(
unsigned int n,
const vpPoint &P);
150 vpPoint &getPoint(
const unsigned int _index);
160 void getRoiClipped(
const vpCameraParameters &cam, std::vector<std::pair<vpImagePoint, unsigned int> > &roi);
162 void getRoiClipped(
const vpCameraParameters &cam, std::vector<std::pair<vpImagePoint, unsigned int> > &roi,
165 #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
170 vp_deprecated
void getRoiClipped(std::vector<vpPoint> &points);
174 void getPolygonClipped(std::vector<std::pair<vpPoint, unsigned int> > &poly);
176 void getPolygonClipped(std::vector<vpPoint> &poly);
187 inline void setClipping(
const unsigned int &flags) { clippingFlag = flags; }
200 virtual void setNbPoint(
unsigned int nb);
214 static void getClippedPolygon(
const std::vector<vpPoint> &ptIn, std::vector<vpPoint> &ptOut,
217 const double &zfar = 100);
218 static void getMinMaxRoi(
const std::vector<vpImagePoint> &roi,
int &i_min,
int &i_max,
int &j_min,
int &j_max);
223 #ifdef VISP_HAVE_NLOHMANN_JSON
224 #include <nlohmann/json.hpp>
225 #include <visp3/core/vpJsonParsing.h>
238 inline nlohmann::json clippingFlagsToJSON(
const int flags) {
239 constexpr std::array<vpPolygon3D::vpPolygon3DClippingType, 3> specificFlags = {
244 for(
const auto f: specificFlags) {
246 return nlohmann::json::array({ f });
249 return flagsToJSON<vpPolygon3D::vpPolygon3DClippingType>(flags, {
Generic class defining intrinsic camera parameters.
Implementation of column vector and the associated operations.
Implementation of an homogeneous matrix and operations on such kind of matrices.
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...
Implements a 3D polygon with render functionnalities like clipping.
void setFarClippingDistance(const double &dist)
unsigned int nbpt
Number of points used to define the polygon.
unsigned int getNbPoint() const
void setNearClippingDistance(const double &dist)
double distNearClip
Distance for near clipping.
vpPoint * p
corners in the object frame
double getNearClippingDistance() const
unsigned int getClipping() const
unsigned int getNbCornerInsidePrevImage() const
double getFarClippingDistance() const
unsigned int clippingFlag
Clipping flag.
void setClipping(const unsigned int &flags)
std::vector< std::pair< vpPoint, unsigned int > > polyClipped
Region of interest clipped.
double distFarClip
Distance for near clipping.
unsigned int nbCornersInsidePrev