From 3027f1aeeb397fc50f8cb9ff020c81961f39eb91 Mon Sep 17 00:00:00 2001 From: hengli Date: Thu, 23 Feb 2012 18:00:27 +0100 Subject: [PATCH] Fixed coordinate frame issue in overlay. Outstanding issue of slow rendering of large overlays. --- src/ui/map3D/GLOverlayGeode.cc | 10 +++++++--- src/ui/map3D/GLOverlayGeode.h | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/ui/map3D/GLOverlayGeode.cc b/src/ui/map3D/GLOverlayGeode.cc index 88aea6eed..b92556c0d 100644 --- a/src/ui/map3D/GLOverlayGeode.cc +++ b/src/ui/map3D/GLOverlayGeode.cc @@ -1,15 +1,16 @@ #include "GLOverlayGeode.h" GLOverlayGeode::GLOverlayGeode() - : mDrawable() + : mDrawable(new GLOverlayDrawable) { - + addDrawable(mDrawable); } void GLOverlayGeode::setOverlay(px::GLOverlay &overlay) { - mDrawable.setOverlay(overlay); + mDrawable->setOverlay(overlay); + mCoordinateFrameType = overlay.coordinateframetype(); dirtyBound(); } @@ -136,6 +137,9 @@ GLOverlayGeode::GLOverlayDrawable::drawImplementation(osg::RenderInfo&) const glPushMatrix(); + glScalef(-1.0f, 1.0f, 1.0f); + glRotatef(90.0f, 0.0f, 0.0f, 1.0f); + const std::string& data = mOverlay.data(); for (size_t i = 0; i < data.size(); ++i) diff --git a/src/ui/map3D/GLOverlayGeode.h b/src/ui/map3D/GLOverlayGeode.h index cbd843097..d84647ab0 100644 --- a/src/ui/map3D/GLOverlayGeode.h +++ b/src/ui/map3D/GLOverlayGeode.h @@ -28,7 +28,7 @@ private: virtual void drawImplementation(osg::RenderInfo&) const; - osg::BoundingBox computeBound() const; + virtual osg::BoundingBox computeBound() const; private: float getFloatValue(const std::string& data, size_t& mark) const; @@ -37,7 +37,7 @@ private: osg::BoundingBox mBBox; }; - GLOverlayDrawable mDrawable; + osg::ref_ptr mDrawable; px::GLOverlay::CoordinateFrameType mCoordinateFrameType; }; -- 2.22.0