Struct TObject3D
Defined in File TObject3D.h
Struct Documentation
-
struct TObject3D
A variant type for any lightweight 3D type: point, segment, line, plane, polygon. Use provided helper method, or directly access the variant
data.See also
Public Types
-
using variant_t = std::variant<std::monostate, TPoint3D, TSegment3D, TLine3D, TPolygon3D, TPlane>
Public Functions
-
inline bool isPoint() const
Checks whether content is a point.
-
inline bool isSegment() const
Checks whether content is a segment.
-
inline bool isLine() const
Checks whether content is a line.
-
inline bool isPolygon() const
Checks whether content is a polygon.
-
inline bool isPlane() const
Checks whether content is a plane.
-
inline bool empty() const
-
template<typename T>
inline const T &getAs() const Gets the content as a given expected type (an exception will be thrown if type is wrong, check type first).
-
template<typename T>
inline T &getAs() This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
-
inline bool getPoint(TPoint3D &out) const
returns true if the objects is a point, and retrieves its value in
out. Prefer getAs(). This method was left in mrpt 2.3.0 for backwards compatibility.
-
inline bool getSegment(TSegment3D &out) const
returns true if the objects is a segment, and retrieves its value in
out. Prefer getAs(). This method was left in mrpt 2.3.0 for backwards compatibility.
-
inline bool getLine(TLine3D &out) const
returns true if the objects is a line, and retrieves its value in
out. Prefer getAs(). This method was left in mrpt 2.3.0 for backwards compatibility.
-
inline bool getPolygon(TPolygon3D &out) const
returns true if the objects is a TPolygon3D, and retrieves its value in
out. Prefer getAs(). This method was left in mrpt 2.3.0 for backwards compatibility.
-
inline bool getPlane(TPlane &out) const
returns true if the objects is a TPlane, and retrieves its value in
out. Prefer getAs(). This method was left in mrpt 2.3.0 for backwards compatibility.
-
std::string asString() const
Gets a string with the type and the parameters of the object.
emptyif not defined.Note
New in MRPT 2.3.0
-
using variant_t = std::variant<std::monostate, TPoint3D, TSegment3D, TLine3D, TPolygon3D, TPlane>