class mrpt::viz::CSphere
Overview
A solid or wire-frame sphere.
See also:
opengl::Scene
#include <mrpt/viz/CSphere.h> class CSphere: public mrpt::viz::CGeneralizedEllipsoidTemplate { public: // typedefs typedef std::shared_ptr<mrpt::viz ::CSphere> Ptr; typedef std::shared_ptr<const mrpt::viz ::CSphere> ConstPtr; typedef std::unique_ptr<mrpt::viz ::CSphere> UniquePtr; typedef std::unique_ptr<const mrpt::viz ::CSphere> ConstUniquePtr; typedef mrpt::math::CMatrixFixed<float, DIM, 1> array_parameter_t; typedef mrpt::math::CMatrixFixed<float, DIM, 1> array_point_t; // fields static constexpr const char* className = "mrpt::viz" "::" "CSphere"; // construction CSphere(float radius = 1.0f, int nDivs = 20); // 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; void setRadius(float r); float getRadius() const; void setNumberDivs(int N); virtual bool traceRay(const mrpt::poses::CPose3D& o, double& dist) const; virtual mrpt::math::TBoundingBoxf internalBoundingBoxLocal() const; uint32_t getNumberOfSegments() const; };
Inherited Members
public: // typedefs 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; typedef std::shared_ptr<CVisualObject> Ptr; typedef std::shared_ptr<const CVisualObject> ConstPtr; typedef std::unique_ptr<CObject> UniquePtr; typedef std::unique_ptr<const CObject> ConstUniquePtr; // structs struct PoseAndScale; struct State; // methods 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(); virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const; const auto& shaderLinesVertexPointBuffer() const; const auto& shaderLinesVertexColorBuffer() const; auto& shaderLinesBufferMutex() const; void setLineWidth(float w); float getLineWidth() const; void enableAntiAliasing(bool enable = true); bool isAntiAliasingEnabled() const; const auto& shaderTrianglesBuffer() const; auto& shaderTrianglesBufferMutex() const; static const mrpt::rtti::TRuntimeClassId& GetRuntimeClassIdStatic(); PoseAndScale getPoseAndScale() const; virtual CVisualObject& setColor_u8(const mrpt::img::TColor& c); bool isLightEnabled() const; void enableLight(bool enable = true); TCullFace cullFaces() const; void notifyBBoxChange() const; auto getBoundingBoxLocalf() const; virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const;
Typedefs
typedef std::shared_ptr<mrpt::viz ::CSphere> Ptr
A type for the associated smart pointer.
Construction
CSphere(float radius = 1.0f, int nDivs = 20)
Constructor.
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.
virtual bool traceRay(const mrpt::poses::CPose3D& o, double& dist) const
Simulation of ray-trace, given a pose.
Returns true if the ray effectively collisions with the object (returning the distance to the origin of the ray in “dist”), or false in other case. “dist” variable yields undefined behaviour when false is returned
virtual mrpt::math::TBoundingBoxf internalBoundingBoxLocal() const
Must be implemented by derived classes to provide the updated bounding box in the object local frame of coordinates.
This will be called only once after each time the derived class reports to notifyChange() that the object geometry changed.
See also:
getBoundingBox(), getBoundingBoxLocal(), getBoundingBoxLocalf()