class mrpt::viz::CGridPlaneXY

Overview

A grid of lines over the XY plane.

mrpt::viz::CGridPlaneXY

See also:

opengl::Scene

#include <mrpt/viz/CGridPlaneXY.h>

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

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

    // fields

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

    // construction

    CGridPlaneXY(
        float xMin = -10,
        float xMax = 10,
        float yMin = -10,
        float yMax = 10,
        float z = 0,
        float frequency = 1,
        float lineWidth = 1.3f,
        bool antiAliasing = 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 setPlaneLimits(
        float xmin,
        float xmax,
        float ymin,
        float ymax
        );

    void getPlaneLimits(
        float& xmin,
        float& xmax,
        float& ymin,
        float& ymax
        ) const;

    void setPlaneZcoord(float z);
    float getPlaneZcoord() const;
    void setGridFrequency(float freq);
    float getGridFrequency() const;
    virtual void updateBuffers() const;
    virtual mrpt::math::TBoundingBoxf internalBoundingBoxLocal() 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 ::CGridPlaneXY> Ptr

A type for the associated smart pointer.

Construction

CGridPlaneXY(
    float xMin = -10,
    float xMax = 10,
    float yMin = -10,
    float yMax = 10,
    float z = 0,
    float frequency = 1,
    float lineWidth = 1.3f,
    bool antiAliasing = 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.

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