class mrpt::viz::CAxis

Overview

Draw a 3D world axis, with coordinate marks at some regular interval.

mrpt::viz::CAxis

See also:

opengl::Scene

#include <mrpt/viz/CAxis.h>

class CAxis:
    public mrpt::viz::CVisualObject,
    public mrpt::viz::VisualObjectParams_Lines
{
public:
    // typedefs

    typedef std::shared_ptr<mrpt::viz ::CAxis> Ptr;
    typedef std::shared_ptr<const mrpt::viz ::CAxis> ConstPtr;
    typedef std::unique_ptr<mrpt::viz ::CAxis> UniquePtr;
    typedef std::unique_ptr<const mrpt::viz ::CAxis> ConstUniquePtr;

    // fields

    static constexpr const char* className = "mrpt::viz" "::" "CAxis";

    // construction

    CAxis(
        float xmin = -1.0f,
        float ymin = -1.0f,
        float zmin = -1.0f,
        float xmax = 1.0f,
        float ymax = 1.0f,
        float zmax = 1.0f,
        float frecuency = 1.f,
        float lineWidth = 3.0f,
        bool marks = true
        );

    // 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 setAxisLimits(
        float xmin,
        float ymin,
        float zmin,
        float xmax,
        float ymax,
        float zmax
        );

    void setFrequency(float f);
    float getFrequency() const;
    void setTextScale(float f);
    float getTextScale() const;
    void setTextLabelOrientation(int axis, float yaw_deg, float pitch_deg, float roll_deg);
    void getTextLabelOrientation(int axis, float& yaw_deg, float& pitch_deg, float& roll_deg) const;
    void enableTickMarks(bool v = true);

    void enableTickMarks(
        bool show_x,
        bool show_y,
        bool show_z
        );

    void setTickMarksLength(float len);
    float getTickMarksLength() const;
    virtual mrpt::math::TBoundingBoxf internalBoundingBoxLocal() const;
    virtual void updateBuffers() const;
    virtual bool isCompositeObject() const;
    virtual const ListVisualObjects& getInternalChildren() 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;

    // 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;

Typedefs

typedef std::shared_ptr<mrpt::viz ::CAxis> Ptr

A type for the associated smart pointer.

Construction

CAxis(
    float xmin = -1.0f,
    float ymin = -1.0f,
    float zmin = -1.0f,
    float xmax = 1.0f,
    float ymax = 1.0f,
    float zmax = 1.0f,
    float frecuency = 1.f,
    float lineWidth = 3.0f,
    bool marks = true
    )

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.

void setFrequency(float f)

Changes the frequency of the “ticks”.

void setTextScale(float f)

Changes the size of text labels (default:0.25)

void setTextLabelOrientation(
    int axis,
    float yaw_deg,
    float pitch_deg,
    float roll_deg
    )

axis: {0,1,2}=>{X,Y,Z}

void getTextLabelOrientation(
    int axis,
    float& yaw_deg,
    float& pitch_deg,
    float& roll_deg
    ) const

axis: {0,1,2}=>{X,Y,Z}

void setTickMarksLength(float len)

As a ratio of “marks frequency” (default: 0.05)

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()

virtual void updateBuffers() const

Called by the rendering system to update internal geometry buffers.

Derived classes should override this to populate their data buffers (triangles, points, lines) when the object geometry changes.

This is called automatically when hasToUpdateBuffers() returns true, which happens after notifyChange() was called.

The base implementation does nothing; derived classes should override.

Thread safety: implementations should lock the appropriate mutexes when writing to shared buffers.

virtual bool isCompositeObject() const

Should return true if enqueueForRenderRecursive() is defined since the object has inner children.

Examples: CSetOfObjects, CAssimpModel.

virtual const ListVisualObjects& getInternalChildren() const

Access to internal text labels (for rendering pipeline)