9 #ifndef LIGHTWEIGHT_GEOM_DATA_H 10 #define LIGHTWEIGHT_GEOM_DATA_H 13 #include <mrpt/config.h> 54 template <
class DERIVEDCLASS>
65 inline TPoint2D(
double xx,
double yy):x(xx),y(yy) {}
71 inline double &
operator[](
size_t i) {
switch (i) {
case 0:
return x;
case 1:
return y;
default:
throw std::out_of_range(
"index out of range"); } }
73 inline const double &
operator[](
size_t i)
const {
switch (i) {
case 0:
return x;
case 1:
return y;
default:
throw std::out_of_range(
"index out of range"); } }
137 void fromString(
const std::string &s);
138 static size_t size() {
return 2; }
174 inline TPose2D(
double xx,
double yy,
double pphi):x(xx),y(yy),phi(pphi) {}
180 inline double &
operator[](
size_t i) {
switch (i) {
case 0:
return x;
case 1:
return y;
case 2:
return phi;
default:
throw std::out_of_range(
"index out of range"); } }
182 inline const double &
operator[](
size_t i)
const {
switch (i) {
case 0:
return x;
case 1:
return y;
case 2:
return phi;
default:
throw std::out_of_range(
"index out of range"); } }
188 v[0]=x; v[1]=y; v[2]=phi;
193 void asString(std::string &s)
const;
200 void fromString(
const std::string &s);
201 static size_t size() {
return 3; }
215 inline TPoint3Df(
const float xx,
const float yy,
const float zz) : x(xx), y(yy),z(zz) { }
219 inline float &
operator[](
size_t i) {
switch (i) {
case 0:
return x;
case 1:
return y;
case 2:
return z;
default:
throw std::out_of_range(
"index out of range"); } }
222 inline const float &
operator[](
size_t i)
const {
switch (i) {
case 0:
return x;
case 1:
return y;
case 2:
return z;
default:
throw std::out_of_range(
"index out of range"); } }
234 inline TPoint3D(
double xx,
double yy,
double zz):x(xx),y(yy),z(zz) {}
265 inline double &
operator[](
size_t i) {
switch (i) {
case 0:
return x;
case 1:
return y;
case 2:
return z;
default:
throw std::out_of_range(
"index out of range"); } }
267 inline const double &
operator[](
size_t i)
const {
switch (i) {
case 0:
return x;
case 1:
return y;
case 2:
return z;
default:
throw std::out_of_range(
"index out of range"); } }
296 template <
class VECTORLIKE>
299 v[0]=x; v[1]=y; v[2]=z;
352 void fromString(
const std::string &s);
353 static size_t size() {
return 3; }
388 TPose3D(
double _x,
double _y,
double _z,
double _yaw,
double _pitch,
double _roll):x(_x),y(_y),z(_z),yaw(_yaw),pitch(_pitch),roll(_roll) {}
394 inline double &
operator[](
size_t i) {
switch (i) {
case 0:
return x;
case 1:
return y;
case 2:
return z;
case 3:
return yaw;
case 4:
return pitch;
case 5:
return roll;
default:
throw std::out_of_range(
"index out of range"); } }
396 inline const double &
operator[](
size_t i)
const {
switch (i) {
case 0:
return x;
case 1:
return y;
case 2:
return z;
case 3:
return yaw;
case 4:
return pitch;
case 5:
return roll;
default:
throw std::out_of_range(
"index out of range"); } }
408 v[0]=x; v[1]=y; v[2]=z; v[3]=yaw; v[4]=pitch; v[5]=roll;
413 void asString(std::string &s)
const;
420 void fromString(
const std::string &s);
421 static size_t size() {
return 6; }
433 inline TPose3DQuat(
double _x,
double _y,
double _z,
double _qr,
double _qx,
double _qy,
double _qz):x(_x),y(_y),z(_z),qr(_qr),qx(_qx),qy(_qy),qz(_qz) { }
440 inline double &
operator[](
size_t i) {
switch (i) {
case 0:
return x;
case 1:
return y;
case 2:
return z;
case 3:
return qr;
case 4:
return qx;
case 5:
return qy;
case 6:
return qz;
default:
throw std::out_of_range(
"index out of range"); } }
442 inline const double &
operator[](
size_t i)
const {
switch (i) {
case 0:
return x;
case 1:
return y;
case 2:
return z;
case 3:
return qr;
case 4:
return qx;
case 5:
return qy;
case 6:
return qz;
default:
throw std::out_of_range(
"index out of range"); } }
450 for (
size_t i=0;i<7;i++) v[i]=(*
this)[i];
462 void fromString(
const std::string &s);
463 static size_t size() {
return 7; }
484 return (p1.
x==p2.
x)&&(p1.
y==p2.
y);
490 return (p1.
x!=p2.
x)||(p1.
y!=p2.
y);
496 return (p1.
x==p2.
x)&&(p1.
y==p2.
y)&&(p1.
z==p2.
z);
502 return (p1.
x!=p2.
x)||(p1.
y!=p2.
y)||(p1.
z!=p2.
z);
552 double length()
const;
560 double signedDistance(
const TPoint2D &point)
const;
564 bool contains(
const TPoint2D &point)
const;
566 inline TPoint2D &
operator[](
size_t i) {
switch (i) {
case 0:
return point1;
case 1:
return point2;
default:
throw std::out_of_range(
"index out of range"); } }
568 inline const TPoint2D &
operator[](
size_t i)
const {
switch (i) {
case 0:
return point1;
case 1:
return point2;
default:
throw std::out_of_range(
"index out of range"); } }
577 p.
x=(point1.
x+point2.
x)/2;
578 p.
y=(point1.
y+point2.
y)/2;
612 double length()
const;
624 bool contains(
const TPoint3D &point)
const;
626 inline TPoint3D &
operator[](
size_t i) {
switch (i) {
case 0:
return point1;
case 1:
return point2;
default:
throw std::out_of_range(
"index out of range"); } }
628 inline const TPoint3D &
operator[](
size_t i)
const {
switch (i) {
case 0:
return point1;
case 1:
return point2;
default:
throw std::out_of_range(
"index out of range"); } }
639 p.
x=(point1.
x+point2.
x)/2;
640 p.
y=(point1.
y+point2.
y)/2;
641 p.
z=(point1.
z+point2.
z)/2;
688 double evaluatePoint(
const TPoint2D &point)
const;
692 bool contains(
const TPoint2D &point)
const;
700 double signedDistance(
const TPoint2D &point)
const;
704 void getNormalVector(
double (&vector)[2])
const;
714 getNormalVector(vector);
719 void getDirectorVector(
double (&vector)[2])
const;
725 getDirectorVector(vector);
730 void generate3DObject(
TLine3D &l)
const;
787 bool contains(
const TPoint3D &point)
const;
800 for (
size_t i=0;i<3;i++) vector[i]=director[i];
807 getDirectorVector(vector);
848 double evaluatePoint(
const TPoint3D &point)
const;
852 bool contains(
const TPoint3D &point)
const;
857 return contains(segment.
point1)&&contains(segment.
point2);
862 bool contains(
const TLine3D &line)
const;
874 void getNormalVector(
double (&vec)[3])
const;
884 getNormalVector(vec);
932 inline TPlane(
double A,
double B,
double C,
double D) {
942 for (
size_t i=0;i<4;i++) coefs[i]=vec[i];
961 bool contains(
const TPoint2D &point)
const;
965 void getAsSegmentList(std::vector<TSegment2D> &v)
const;
977 bool isConvex()
const;
982 void removeRepeatedVertices();
987 void removeRedundantVertices();
992 void getPlotData(std::vector<double> &x,std::vector<double> &y)
const;
1013 static void createRegularPolygon(
size_t numEdges,
double radius,
TPolygon2D &poly);
1034 bool contains(
const TPoint3D &point)
const;
1038 void getAsSegmentList(std::vector<TSegment3D> &v)
const;
1042 bool getPlane(
TPlane &p)
const;
1047 void getBestFittingPlane(
TPlane &p)
const;
1063 bool isSkew()
const;
1067 void removeRepeatedVertices();
1071 void removeRedundantVertices();
1092 static void createRegularPolygon(
size_t numEdges,
double radius,
TPolygon3D &poly);
1156 if (type==GEOMETRIC_TYPE_POLYGON)
delete data.polygon;
1231 }
else return false;
1240 }
else return false;
1249 }
else return false;
1258 }
else return false;
1264 if (
this==&obj)
return *
this;
1266 switch (type=obj.
type) {
1267 case GEOMETRIC_TYPE_POINT:
1270 case GEOMETRIC_TYPE_SEGMENT:
1273 case GEOMETRIC_TYPE_LINE:
1276 case GEOMETRIC_TYPE_POLYGON:
1317 void generate3DObject(
TObject3D &obj)
const;
1327 static void getPoints(
const std::vector<TObject2D> &objs,std::vector<TPoint2D> &pnts);
1331 static void getSegments(
const std::vector<TObject2D> &objs,std::vector<TSegment2D> &sgms);
1335 static void getLines(
const std::vector<TObject2D> &objs,std::vector<TLine2D> &lins);
1339 static void getPolygons(
const std::vector<TObject2D> &objs,std::vector<TPolygon2D> &polys);
1343 static void getPoints(
const std::vector<TObject2D> &objs,std::vector<TPoint2D> &pnts,std::vector<TObject2D> &remainder);
1347 static void getSegments(
const std::vector<TObject2D> &objs,std::vector<TSegment2D> &sgms,std::vector<TObject2D> &remainder);
1351 static void getLines(
const std::vector<TObject2D> &objs,std::vector<TLine2D> &lins,std::vector<TObject2D> &remainder);
1355 static void getPolygons(
const std::vector<TObject2D> &objs,std::vector<TPolygon2D> &polys,std::vector<TObject2D> &remainder);
1383 if (type==GEOMETRIC_TYPE_POLYGON)
delete data.polygon;
1470 }
else return false;
1479 }
else return false;
1488 }
else return false;
1497 }
else return false;
1506 }
else return false;
1512 if (
this==&obj)
return *
this;
1514 switch (type=obj.
type) {
1515 case GEOMETRIC_TYPE_POINT:
1518 case GEOMETRIC_TYPE_SEGMENT:
1521 case GEOMETRIC_TYPE_LINE:
1524 case GEOMETRIC_TYPE_POLYGON:
1527 case GEOMETRIC_TYPE_PLANE:
1530 case GEOMETRIC_TYPE_UNDEFINED:
1583 case GEOMETRIC_TYPE_POINT:
1586 case GEOMETRIC_TYPE_SEGMENT:
1589 case GEOMETRIC_TYPE_LINE:
1592 case GEOMETRIC_TYPE_POLYGON:
1595 case GEOMETRIC_TYPE_PLANE:
1596 throw std::logic_error(
"Too many dimensions");
1611 static void getPoints(
const std::vector<TObject3D> &objs,std::vector<TPoint3D> &pnts);
1615 static void getSegments(
const std::vector<TObject3D> &objs,std::vector<TSegment3D> &sgms);
1619 static void getLines(
const std::vector<TObject3D> &objs,std::vector<TLine3D> &lins);
1623 static void getPlanes(
const std::vector<TObject3D> &objs,std::vector<TPlane> &plns);
1627 static void getPolygons(
const std::vector<TObject3D> &objs,std::vector<TPolygon3D> &polys);
1631 static void getPoints(
const std::vector<TObject3D> &objs,std::vector<TPoint3D> &pnts,std::vector<TObject3D> &remainder);
1635 static void getSegments(
const std::vector<TObject3D> &objs,std::vector<TSegment3D> &sgms,std::vector<TObject3D> &remainder);
1639 static void getLines(
const std::vector<TObject3D> &objs,std::vector<TLine3D> &lins,std::vector<TObject3D> &remainder);
1643 static void getPlanes(
const std::vector<TObject3D> &objs,std::vector<TPlane> &plns,std::vector<TObject3D> &remainder);
1647 static void getPolygons(
const std::vector<TObject3D> &objs,std::vector<TPolygon3D> &polys,std::vector<TObject3D> &remainder);
bool operator!=(const CArray< T, N > &x, const CArray< T, N > &y)
void getCenter(TPoint2D &p) const
Segment's central point.
TSegment2D(const TPoint2D &p1, const TPoint2D &p2)
Constructor from both points.
TPoint2D & operator+=(const TPoint2D &p)
double & operator[](size_t i)
Coordinate access using operator[].
const unsigned char GEOMETRIC_TYPE_PLANE
Object type identifier for TPlane.
bool getPoint(TPoint2D &p) const
Gets the content as a point, returning false if the type is inadequate.
A pair (x,y) of pixel coordinates (subpixel resolution).
void getUnitaryNormalVector(double(&vector)[2])
Get line's normal vector after unitarizing line.
TPolygon3D(const std::vector< TPoint3D > &v)
Implicit constructor from a 3D points vector.
TPoint2D operator/(double d) const
#define MRPT_DECLARE_TTYPENAME_NAMESPACE(_TYPE, __NS)
bool getPolygon(TPolygon2D &p) const
Gets the content as a polygon, returning false if the type is inadequate.
TPoint2D & operator*=(double d)
const unsigned char GEOMETRIC_TYPE_LINE
Object type identifier for TLine2D or TLine3D.
void asString(std::string &s) const
Returns a human-readable textual representation of the object (eg: "[0.02 1.04]" ) ...
unsigned char getType() const
Gets content type.
bool isPolygon() const
Checks whether content is a polygon.
void destroy()
Destroys the object and releases the pointer, if any.
const unsigned char GEOMETRIC_TYPE_POINT
Object type identifier for TPoint2D or TPoint3D.
T square(const T x)
Inline function for the square of a number.
TObject2D(const TPoint2D &p)
Implicit constructor from point.
TPoint3Df(const float xx, const float yy, const float zz)
TLine2D()
Fast default constructor.
bool getSegment(TSegment3D &s) const
Gets the content as a segment, returning false if the type is not adequate.
bool contains(const TSegment3D &segment) const
Check whether a segment is fully contained into the plane.
double roll
Roll coordinate (rotation angle over X coordinate).
TPoint3D(double xx, double yy, double zz)
Constructor from coordinates.
std::ostream BASE_IMPEXP & operator<<(std::ostream &o, const TPoint2D &p)
TPolygon3D()
Default constructor.
#define THROW_EXCEPTION(msg)
void operator=(const TPoint2D &p)
Assign a point to this object.
double norm() const
Point norm.
const float & operator[](size_t i) const
Coordinate access using operator[].
void operator=(const TSegment2D &s)
Assign a segment to this object.
std::string asString() const
Union containing pointer to actual data.
TPoint3D()
Default fast constructor.
TPoint3D operator+(const TPoint3D &p) const
Points addition.
Standard type for storing any lightweight 2D type.
TLine3D()
Fast default constructor.
bool getLine(TLine2D &r) const
Gets the content as a line, returning false if the type is inadequate.
TObject2D()
Implicit constructor from polygon.
void getAsPose3D(mrpt::poses::CPose3D &outPose)
Gets a pose whose XY plane corresponds to this plane.
bool getPlane(TPlane &p) const
Gets the content as a plane, returning false if the type is not adequate.
TPoint3D pBase
Base point.
Standard object for storing any 3D lightweight object.
bool getSegment(TSegment2D &s) const
Gets the content as a segment, returning false if the type is inadequate.
TSegment3D()
Fast default constructor.
TObject3D()
Empty constructor.
double z
X,Y,Z coordinates.
TPoint3D & operator+=(const TPoint3D &p)
Translation.
double yaw
Yaw coordinate (rotation angle over Z axis).
void operator=(const TSegment3D &s)
Assigns a segment to this object.
void operator=(const TPoint3D &p)
Assigns a point to this object.
TPose2D(double xx, double yy, double pphi)
Constructor from coordinates.
TSegment3D(const TSegment2D &s)
Constructor from 2D object.
double norm() const
Pose's spatial coordinates norm.
void getUnitaryDirectorVector(double(&vector)[2])
Unitarize line and then get director vector.
double & operator[](size_t i)
Coordinate access using operator[].
TPoint2D(const mrpt::poses::CPoseOrPoint< DERIVEDCLASS > &p)
Constructor from CPoseOrPoint, perhaps losing 3D information.
TObject3D(const TPlane &p)
Constructor from plane.
TPoint3D point1
Origin point.
void getUnitaryDirectorVector(double(&vector)[3])
Unitarize and then get director vector.
void generate2DObject(TLine2D &l) const
Project into 2D space, discarding the Z coordinate.
TPose3D()
Default fast constructor.
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
bool getPolygon(TPolygon3D &p) const
Gets the content as a polygon, returning false if the type is not adequate.
This base provides a set of functions for maths stuff.
2D segment, consisting of two points.
bool isPoint() const
Checks whether content is a point.
TPlane(const double(&vec)[4])
Constructor from an array of coefficients.
3D segment, consisting of two points.
struct mrpt::math::TObject2D::tobject2d_data_t data
TObject2D(const TLine2D &r)
Implicit constructor from line.
Lightweight 3D point (float version).
TObject3D(const TPoint3D &p)
Constructor from point.
TPoint2D(double xx, double yy)
Constructor from coordinates.
const double & operator[](size_t i) const
Coordinate access using operator[].
TPoint3D point2
Destiny point.
float & operator[](size_t i)
Coordinate access using operator[].
std::string asString() const
double distanceTo(const TPoint3D &p) const
Point-to-point distance.
struct mrpt::math::TObject3D::tobject3d_data_t data
TObject3D & operator=(const TObject3D &obj)
Assigns another object, creating a new pointer if needed.
std::vector< T1 > & operator+=(std::vector< T1 > &a, const std::vector< T2 > &b)
a+=b (element-wise sum)
TLine2D(double A, double B, double C)
Constructor from line's coefficients.
double z
Translation in x,y,z.
const double & operator[](size_t i) const
Coordinate access using operator[].
const unsigned char GEOMETRIC_TYPE_SEGMENT
Object type identifier for TSegment2D or TSegment3D.
const TPoint3D & operator[](size_t i) const
Access to points using operator[0-1].
bool operator==(const CArray< T, N > &x, const CArray< T, N > &y)
TPoint3D operator/(double d) const
T wrapTo2Pi(T a)
Modifies the given angle to translate it into the [0,2pi[ range.
void generate2DObject(TPolygon2D &p) const
Projects into a 2D space, discarding the z.
3D Plane, represented by its equation
void getDirectorVector(double(&vector)[3]) const
Get director vector.
class BASE_IMPEXP TPolygon3D
TPoint2D operator*(double d) const
TPolygon2D()
Default constructor.
void operator=(const TPolygon3D &p)
Assigns a polygon to this object.
void getCenter(TPoint3D &p) const
Segment's central point.
TPoint3D operator*(double d) const
unsigned char type
Object type identifier.
TPose3DQuat()
Default fast constructor.
TPoint2D point2
Destiny point.
A class used to store a 3D pose as a translation (x,y,z) and a quaternion (qr,qx,qy,qz).
bool isSegment() const
Checks whether content is a segment.
TObject2D(const TObject2D &obj)
Constructor from another TObject2D.
The base template class for 2D & 3D points and poses.
std::string BASE_IMPEXP format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
TPoint2D & operator[](size_t i)
Access to points using operator[0-1].
void getAsVector(std::vector< double > &v) const
Gets the pose as a vector of doubles.
TObject2D & operator=(const TObject2D &obj)
Assign another TObject2D.
double qz
Unit quaternion part, qr,qx,qy,qz.
bool isPlane() const
Checks whether content is a plane.
A class used to store a 2D point.
A class used to store a 3D point.
void operator=(const TPlane &p)
Assigns a plane to this object.
TObject2D(const TSegment2D &s)
Implicit constructor from segment.
TPolygon2D(size_t N)
Constructor for a given number of vertices, intializing them as garbage.
bool getPoint(TPoint3D &p) const
Gets the content as a point, returning false if the type is not adequate.
double pitch
Pitch coordinate (rotation angle over Y axis).
Lightweight 3D pose (three spatial coordinates, plus a quaternion ).
void getAsPose3DForcingOrigin(const TPoint3D &newOrigin, mrpt::poses::CPose3D &pose) const
Gets a pose whose XY plane corresponds to this, forcing an exact point as its spatial coordinates...
TPoint2D point1
Origin point.
double norm() const
Point norm.
TPoint2D()
Default fast constructor.
bool operator<(const CArray< T, N > &x, const CArray< T, N > &y)
TPoint3D & operator*=(const double f)
Point scale.
BASE_IMPEXP ::mrpt::utils::CStream & operator>>(mrpt::utils::CStream &in, CMatrixPtr &pObj)
T square(const T x)
Inline function for the square of a number.
TPoint2D operator+(const TPoint2D &p) const
TObject3D(const TLine3D &r)
Constructor from line.
bool isLine() const
Checks whether content is a line.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
const double & operator[](size_t i) const
Coordinate access using operator[].
TPlane()
Fast default constructor.
void asString(std::string &s) const
Returns a human-readable textual representation of the object (eg: "[0.02 1.04 -0.8]" )
std::string asString() const
TPose3DQuat(double _x, double _y, double _z, double _qr, double _qx, double _qy, double _qz)
Constructor from coordinates.
void operator=(const TPolygon2D &p)
Assign a polygon to this object.
TPoint3D operator-(const TPoint3D &p) const
Points substraction.
A class used to store a 2D pose.
TPoint2D operator-(const TPoint2D &p) const
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
struct BASE_IMPEXP TLine3D
double sqrDistanceTo(const TPoint3D &p) const
Point-to-point distance, squared.
void getUnitaryNormalVector(double(&vec)[3])
Unitarize, then get normal vector.
double norm() const
Pose's spatial coordinates norm.
TSegment2D()
Fast default constructor.
unsigned char type
Object type identifier.
~TObject2D()
Object destruction.
const TPoint2D & operator[](size_t i) const
Access to points using operator[0-1].
TPoint3D & operator[](size_t i)
Access to points using operator[0-1].
Lightweight 3D pose (three spatial coordinates, plus three angular coordinates).
bool getLine(TLine3D &r) const
Gets the content as a line, returning false if the type is not adequate.
void getAsVector(std::vector< double > &v) const
Transformation into vector.
std::string asString() const
void generate2DObject(TSegment2D &s) const
Projection into 2D space, discarding the z.
void generate2DObject(TObject2D &obj) const
Projects into 2D space.
const double & operator[](size_t i) const
Coordinate access using operator[].
bool isLine() const
Checks whether content is a line.
bool isSegment() const
Checks whether content is a segment.
TObject2D(const TPolygon2D &p)
Implicit constructor from polygon.
TSegment3D(const TPoint3D &p1, const TPoint3D &p2)
Constructor from both points.
void getAsPose3D(mrpt::poses::CPose3D &outPose) const
Gets a pose whose XY plane corresponds to this plane.
TObject3D(const TObject3D &obj)
Constructs from another object.
TPose2D()
Default fast constructor.
unsigned char getType() const
Gets object type.
const unsigned char GEOMETRIC_TYPE_UNDEFINED
Object type identifier for empty TObject2D or TObject3D.
TPoint2D & operator-=(const TPoint2D &p)
void operator=(const TLine3D &l)
Assigns a line to this object.
double & operator[](size_t i)
Coordinate access using operator[].
TPolygon3D(size_t N)
Constructor for a given size.
void asString(std::string &s) const
Returns a human-readable textual representation of the object as "[x y z qr qx qy qz]"...
void operator=(const TLine2D &l)
Assign a line to this object.
bool isPolygon() const
Checks whether content is a polygon.
void destroy()
Destroys the object, releasing the pointer to the content (if any).
TObject3D(const TSegment3D &s)
Constructor from segment.
std::string asString() const
const unsigned char GEOMETRIC_TYPE_POLYGON
Object type identifier for TPolygon2D or TPolygon3D.
void getAsPose3DForcingOrigin(const TPoint3D &newOrigin, mrpt::poses::CPose3D &pose)
Gets a pose whose XY plane corresponds to this, forcing an exact point as its spatial coordinates...
TPose3D(double _x, double _y, double _z, double _yaw, double _pitch, double _roll)
Constructor from coordinates.
TPoint3D operator-(const TPoint3D &p1)
Unary minus operator for 3D points.
void getAsVector(std::vector< double > &v) const
Gets the pose as a vector of doubles.
TPlane(double A, double B, double C, double D)
Constructor from plane coefficients.
TObject3D(const TPolygon3D &p)
Constructor from polygon.
double phi
Orientation (rads)
double & operator[](size_t i)
Coordinate access using operator[].
void getAsVector(VECTORLIKE &v) const
Transformation into vector.
2D polygon, inheriting from std::vector<TPoint2D>.
TPoint3D & operator-=(const TPoint3D &p)
Difference between points.
3D polygon, inheriting from std::vector<TPoint3D>
Union type storing pointers to every allowed type.
void getAsVector(std::vector< double > &v) const
Transformation into vector.
double & operator[](size_t i)
Coordinate access using operator[].
std::vector< T1 > operator*(const std::vector< T1 > &a, const std::vector< T2 > &b)
a*b (element-wise multiplication)
TPoint3D(const TPoint3Df &p)
Explicit constructor from coordinates.
TPoint2D(const mrpt::utils::TPixelCoordf &p)
Implicit transformation constructor from TPixelCoordf.
bool isPoint() const
Checks whether content is a point.
double BASE_IMPEXP distance(const TPoint2D &p1, const TPoint2D &p2)
Gets the distance between two points in a 2D space.
const double & operator[](size_t i) const
Coordinate access using operator[].
TPoint2D & operator/=(double d)
3D line, represented by a base point and a director vector.
TPolygon2D(const std::vector< TPoint2D > &v)
Implicit constructor from a vector of 2D points.
2D line without bounds, represented by its equation .