39 #ifndef vpPolygon3D_HH
40 #define vpPolygon3D_HH
44 #include <visp3/core/vpConfig.h>
45 #include <visp3/core/vpMeterPixelConversion.h>
46 #include <visp3/core/vpPixelMeterConversion.h>
47 #include <visp3/core/vpPoint.h>
70 } vpPolygon3DClippingType;
91 unsigned int &p1ClippedInfo,
unsigned int &p2ClippedInfo,
const vpColVector &normal,
92 const unsigned int &flag);
95 unsigned int &p1ClippedInfo,
unsigned int &p2ClippedInfo,
const unsigned int &flag,
96 const double &distance);
103 void addPoint(
unsigned int n,
const vpPoint &P);
148 vpPoint &getPoint(
const unsigned int _index);
158 void getRoiClipped(
const vpCameraParameters &cam, std::vector<std::pair<vpImagePoint, unsigned int> > &roi);
160 void getRoiClipped(
const vpCameraParameters &cam, std::vector<std::pair<vpImagePoint, unsigned int> > &roi,
163 #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
168 VP_DEPRECATED
void getRoiClipped(std::vector<vpPoint> &points);
172 void getPolygonClipped(std::vector<std::pair<vpPoint, unsigned int> > &poly);
174 void getPolygonClipped(std::vector<vpPoint> &poly);
185 inline void setClipping(
const unsigned int &flags) { clippingFlag = flags; }
198 virtual void setNbPoint(
unsigned int nb);
212 static void getClippedPolygon(
const std::vector<vpPoint> &ptIn, std::vector<vpPoint> &ptOut,
215 const double &zfar = 100);
216 static void getMinMaxRoi(
const std::vector<vpImagePoint> &roi,
int &i_min,
int &i_max,
int &j_min,
int &j_max);
221 #ifdef VISP_HAVE_NLOHMANN_JSON
222 #include VISP_NLOHMANN_JSON(json.hpp)
223 #include <visp3/core/vpJsonParsing.h>
236 inline nlohmann::json clippingFlagsToJSON(
const int flags)
238 #ifdef ENABLE_VISP_NAMESPACE
241 constexpr std::array<vpPolygon3D::vpPolygon3DClippingType, 3> specificFlags = {
246 for (
const auto f: specificFlags) {
248 return nlohmann::json::array({ f });
251 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 functionalities 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