class mrpt::poses::CPoint3D
Overview
A class used to store a 3D point.
For a complete description of Points/Poses, see mrpt::poses::CPoseOrPoint, or refer to the 2D/3D Geometry tutorial in the wiki.
See also:
#include <mrpt/poses/CPoint3D.h> class CPoint3D: public mrpt::poses::CPoint, public mrpt::serialization::CSerializable { public: // typedefs typedef std::shared_ptr<mrpt::poses ::CPoint3D> Ptr; typedef std::shared_ptr<const mrpt::poses ::CPoint3D> ConstPtr; typedef std::unique_ptr<mrpt::poses ::CPoint3D> UniquePtr; typedef std::unique_ptr<const mrpt::poses ::CPoint3D> ConstUniquePtr; typedef double value_type; typedef double& reference; typedef double const_reference; typedef std::size_t size_type; typedef std::ptrdiff_t difference_type; // enums enum { is_3D_val = 1, }; enum { is_PDF_val = 0, }; // fields static constexpr const char* className = "mrpt::poses" "::" "CPoint3D"; static constexpr std::size_t static_size = 3; mrpt::math::CVectorFixedDouble<3> m_coords; // construction CPoint3D(); CPoint3D(const double x, const double y, const double z); CPoint3D(const mrpt::math::CVectorFixedDouble<3>& xyz); CPoint3D(const CPoint2D& p); CPoint3D(const CPose3D& p); CPoint3D(const CPose2D& p); CPoint3D(const mrpt::math::TPoint3D& p); // methods static constexpr auto getClassName(); static const mrpt::rtti::TRuntimeClassId& GetRuntimeClassIdStatic(); static std::shared_ptr<CObject> CreateObject(); template <typename... Args> static Ptr Create(Args&&... args); template <typename Alloc, typename... Args> static Ptr CreateAlloc( const Alloc& alloc, Args&&... args ); template <typename... Args> static UniquePtr CreateUnique(Args&&... args); virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const; virtual mrpt::rtti::CObject* clone() const; static constexpr size_type size(); static constexpr bool empty(); static constexpr size_type max_size(); static void resize(const size_t n); double operator [] (unsigned int i) const; double& operator [] (unsigned int i); static constexpr bool is_3D(); static constexpr bool is_PDF(); mrpt::math::TPoint3D asTPoint() const; CPoint3D operator - (const CPose3D& b) const; CPoint3D operator - (const CPoint3D& b) const; CPoint3D operator + (const CPoint3D& b) const; CPose3D operator + (const CPose3D& b) const; void asVector(vector_t& v) const; };
Inherited Members
public: // typedefs typedef mrpt::math::CVectorFixedDouble<static_cast<mrpt::math::matrix_dim_t>(DIM)> vector_t; typedef std::shared_ptr<CObject> Ptr; typedef std::shared_ptr<const CObject> ConstPtr; typedef std::shared_ptr<CSerializable> Ptr; typedef std::shared_ptr<const CSerializable> ConstPtr; // methods double& x(); double& y(); void x(const double v); void y(const double v); void x_incr(const double v); void y_incr(const double v); CPoseOrPoint& operator = (const CPoseOrPoint&); CPoseOrPoint& operator = (CPoseOrPoint&&); const DERIVEDCLASS& derived() const; DERIVEDCLASS& derived(); template <class OTHERCLASS> void AddComponents(const OTHERCLASS& b); void operator *= (const double s); template <class MATRIX44> void getHomogeneousMatrix(MATRIX44& out_HM) const; virtual std::string asString() const; void fromString(const std::string& s); double x() const; double y() const; template <class OTHERCLASS, std::size_t DIM2> double sqrDistanceTo(const CPoseOrPoint<OTHERCLASS, DIM2>& b) const; template <class OTHERCLASS, std::size_t DIM2> double distanceTo(const CPoseOrPoint<OTHERCLASS, DIM2>& b) const; double distanceTo(const mrpt::math::TPoint3D& b) const; double distance2DToSquare(double ax, double ay) const; double distance3DToSquare(double ax, double ay, double az) const; double distance2DTo(double ax, double ay) const; double distance3DTo(double ax, double ay, double az) const; double norm() const; vector_t asVectorVal() const; template <class MATRIX44> MATRIX44 getHomogeneousMatrixVal() const; template <class MATRIX44> void getInverseHomogeneousMatrix(MATRIX44& out_HM) const; template <class MATRIX44> MATRIX44 getInverseHomogeneousMatrixVal() const; static bool is3DPoseOrPoint(); static const mrpt::rtti::TRuntimeClassId& GetRuntimeClassIdStatic(); virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const; virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const; static const mrpt::rtti::TRuntimeClassId& GetRuntimeClassIdStatic();
Typedefs
typedef std::shared_ptr<mrpt::poses ::CPoint3D> Ptr
A type for the associated smart pointer.
typedef double value_type
The type of the elements.
Fields
mrpt::math::CVectorFixedDouble<3> m_coords
[x,y,z]
Construction
CPoint3D(const double x, const double y, const double z)
Constructor for initializing point coordinates.
CPoint3D(const mrpt::math::CVectorFixedDouble<3>& xyz)
Constructor from a XYZ 3-vector.
CPoint3D(const CPoint2D& p)
Constructor from an CPoint2D object.
CPoint3D(const CPose3D& p)
Constructor from an CPose3D object.
CPoint3D(const CPose2D& p)
Constructor from an CPose2D object.
CPoint3D(const mrpt::math::TPoint3D& p)
Constructor from lightweight object.
Methods
virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const
Returns information about the class of an object in runtime.
virtual mrpt::rtti::CObject* clone() const
Returns a deep copy (clone) of the object, indepently of its class.
CPoint3D operator - (const CPose3D& b) const
Returns this point as seen from “b”, i.e.
result = this - b
CPoint3D operator - (const CPoint3D& b) const
Returns this point minus point “b”, i.e.
result = this - b
CPoint3D operator + (const CPoint3D& b) const
Returns this point plus point “b”, i.e.
result = this + b
CPose3D operator + (const CPose3D& b) const
Returns this point plus pose “b”, i.e.
result = this + b
void asVector(vector_t& v) const
Return the pose or point as a 3x1 vector [x y z]’.