GLOverlayGeode.h 1.2 KB
Newer Older
1 2 3 4 5
#ifndef GLOVERLAYGEODE_H
#define GLOVERLAYGEODE_H

#include <mavlink_protobuf_manager.hpp>
#include <osg/Geode>
6
#include <QtGlobal>
7 8 9 10 11 12 13 14 15 16

class GLOverlayGeode : public osg::Geode
{
public:
    GLOverlayGeode();

    void setOverlay(px::GLOverlay& overlay);

    px::GLOverlay::CoordinateFrameType coordinateFrameType(void) const;

17 18 19
    void setMessageTimestamp(qreal timestamp);
    qreal messageTimestamp(void) const;

20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
private:
    class GLOverlayDrawable : public osg::Drawable
    {
    public:
        GLOverlayDrawable();

        GLOverlayDrawable(const GLOverlayDrawable& drawable,
                          const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);

        void setOverlay(px::GLOverlay& overlay);

        META_Object(GLOverlayDrawableApp, GLOverlayDrawable)

        virtual void drawImplementation(osg::RenderInfo&) const;

35
        virtual osg::BoundingBox computeBound() const;
36 37 38 39 40 41 42 43

    private:
        float getFloatValue(const std::string& data, size_t& mark) const;

        px::GLOverlay mOverlay;
        osg::BoundingBox mBBox;
    };

44
    osg::ref_ptr<GLOverlayDrawable> mDrawable;
45
    px::GLOverlay::CoordinateFrameType mCoordinateFrameType;
46
    qreal mMessageTimestamp;
47 48 49
};

#endif // GLOVERLAYGEODE_H