GLOverlayGeode.h 1.04 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
#ifndef GLOVERLAYGEODE_H
#define GLOVERLAYGEODE_H

#include <mavlink_protobuf_manager.hpp>
#include <osg/Geode>

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

    void setOverlay(px::GLOverlay& overlay);

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

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;

        osg::BoundingBox computeBound() const;

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

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

    GLOverlayDrawable mDrawable;
    px::GLOverlay::CoordinateFrameType mCoordinateFrameType;
};

#endif // GLOVERLAYGEODE_H