class mrpt::gui::internal::NanoGUICanvasHeadless

Specialization of CGlCanvasBaseHeadless for nanogui events.

Used to keep track of mouse events and update camera parameters.

See also:

CDisplayWindowGUI

#include <mrpt/gui/internal/NanoGUICanvasHeadless.h>

class NanoGUICanvasHeadless: public mrpt::gui::CGlCanvasBaseHeadless
{
public:
    //
fields

    static float SENSIBILITY_DEG_PER_PIXEL = 0.1f;

    //
methods

    void mouseMotionEvent(
        const nanogui::Vector2i& p,
        const nanogui::Vector2i& rel,
        int button,
        int modifiers
        );

    void mouseButtonEvent(
        const nanogui::Vector2i& p,
        int button,
        bool down,
        int modifiers
        );

    void scrollEvent(
        const nanogui::Vector2i& p,
        const nanogui::Vector2f& rel
        );

    virtual void setCameraProjective(bool is);
    bool isCameraProjective() const;
    virtual void setCameraFOV(float FOV);
    float cameraFOV() const;

    void getLastMousePosition(
        int& x,
        int& y
        ) const;

    void setOpenGLSceneRef(mrpt::opengl::COpenGLScene::Ptr scene);
};

Inherited Members

public:
    // structs

    struct CamaraParams;

    //
methods

    void setMinimumZoom(float zoom);
    void setMaximumZoom(float zoom);
    void setMousePos(int x, int y);
    void setMouseClicked(bool is);
    void updateLastPos(int x, int y);
    void resizeViewport(int w, int h);
    void updateZoom(CamaraParams& params, int x, int y) const;
    void updateZoom(CamaraParams& params, float delta) const;
    void updateRotate(CamaraParams& params, int x, int y) const;
    void updateOrbitCamera(CamaraParams& params, int x, int y) const;
    void updatePan(CamaraParams& params, int x, int y) const;
    CamaraParams cameraParams() const;
    const CamaraParams& getRefCameraParams() const;
    virtual void setCameraParams(const CamaraParams& params);
    mrpt::opengl::CCamera& updateCameraParams(mrpt::opengl::CCamera& cam) const;
    void setUseCameraFromScene(bool is);
    bool getUseCameraFromScene() const;
    virtual void setCameraPointing(float pointX, float pointY, float pointZ);
    float getCameraPointingX() const;
    float getCameraPointingY() const;
    float getCameraPointingZ() const;
    virtual void setZoomDistance(float zoom);
    float getZoomDistance() const;
    virtual void setAzimuthDegrees(float ang);
    float getAzimuthDegrees() const;
    virtual void setElevationDegrees(float ang);
    float getElevationDegrees() const;

    virtual void OnUserManuallyMovesCamera(
        float new_cameraPointingX,
        float new_cameraPointingY,
        float new_cameraPointingZ,
        float new_cameraZoomDistance,
        float new_cameraElevationDeg,
        float new_cameraAzimuthDeg
        );

    mrpt::opengl::COpenGLScene::Ptr& getOpenGLSceneRef();