Commit 3027f1ae authored by hengli's avatar hengli

Fixed coordinate frame issue in overlay. Outstanding issue of slow rendering of large overlays.

parent 2ab870ba
#include "GLOverlayGeode.h" #include "GLOverlayGeode.h"
GLOverlayGeode::GLOverlayGeode() GLOverlayGeode::GLOverlayGeode()
: mDrawable() : mDrawable(new GLOverlayDrawable)
{ {
addDrawable(mDrawable);
} }
void void
GLOverlayGeode::setOverlay(px::GLOverlay &overlay) GLOverlayGeode::setOverlay(px::GLOverlay &overlay)
{ {
mDrawable.setOverlay(overlay); mDrawable->setOverlay(overlay);
mCoordinateFrameType = overlay.coordinateframetype();
dirtyBound(); dirtyBound();
} }
...@@ -136,6 +137,9 @@ GLOverlayGeode::GLOverlayDrawable::drawImplementation(osg::RenderInfo&) const ...@@ -136,6 +137,9 @@ GLOverlayGeode::GLOverlayDrawable::drawImplementation(osg::RenderInfo&) const
glPushMatrix(); glPushMatrix();
glScalef(-1.0f, 1.0f, 1.0f);
glRotatef(90.0f, 0.0f, 0.0f, 1.0f);
const std::string& data = mOverlay.data(); const std::string& data = mOverlay.data();
for (size_t i = 0; i < data.size(); ++i) for (size_t i = 0; i < data.size(); ++i)
......
...@@ -28,7 +28,7 @@ private: ...@@ -28,7 +28,7 @@ private:
virtual void drawImplementation(osg::RenderInfo&) const; virtual void drawImplementation(osg::RenderInfo&) const;
osg::BoundingBox computeBound() const; virtual osg::BoundingBox computeBound() const;
private: private:
float getFloatValue(const std::string& data, size_t& mark) const; float getFloatValue(const std::string& data, size_t& mark) const;
...@@ -37,7 +37,7 @@ private: ...@@ -37,7 +37,7 @@ private:
osg::BoundingBox mBBox; osg::BoundingBox mBBox;
}; };
GLOverlayDrawable mDrawable; osg::ref_ptr<GLOverlayDrawable> mDrawable;
px::GLOverlay::CoordinateFrameType mCoordinateFrameType; px::GLOverlay::CoordinateFrameType mCoordinateFrameType;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment