From ad18b88848e2ebc7d60509ba0c0f5277a173366d Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 11 Jul 2006 10:34:41 +0000 Subject: [PATCH] From Antoine Hue, "There was a typo in "int setNotifyOffset()", appear to be a getter => "int getNotifyOffset()". Then I have added a switch to create GDALTermProgress only when the current notify level + local offset permit message display. In fact, if the offset is set to 0 and the notify level is at the default, DataSet is quiet but for the GDALTermProgress. That is quite disturbing since you think the progress is related to the complete processing but it is actually only related to the GDAL Warp." --- include/osgTerrain/DataSet | 2 +- src/osgTerrain/DataSet.cpp | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/include/osgTerrain/DataSet b/include/osgTerrain/DataSet index 9aafe5a58..8b36d2c6f 100644 --- a/include/osgTerrain/DataSet +++ b/include/osgTerrain/DataSet @@ -1161,7 +1161,7 @@ class OSGTERRAIN_EXPORT DataSet : public osg::Referenced static void setNotifyOffset(int level); - static int setNotifyOffset(); + static int getNotifyOffset(); CompositeDestination* createDestinationGraph(CompositeDestination* parent, diff --git a/src/osgTerrain/DataSet.cpp b/src/osgTerrain/DataSet.cpp index f15d0a749..1564880b2 100644 --- a/src/osgTerrain/DataSet.cpp +++ b/src/osgTerrain/DataSet.cpp @@ -53,7 +53,7 @@ using namespace osgTerrain; static int s_notifyOffset = 0; void DataSet::setNotifyOffset(int level) { s_notifyOffset = level; } -int DataSet::setNotifyOffset() { return s_notifyOffset; } +int DataSet::getNotifyOffset() { return s_notifyOffset; } inline std::ostream& my_notify(osg::NotifySeverity level) { return osg::notify(osg::NotifySeverity(s_notifyOffset+level)); } @@ -1269,8 +1269,11 @@ DataSet::Source* DataSet::Source::doReproject(const std::string& filename, osg:: psWO->pfnTransformer = pfnTransformer; psWO->pTransformerArg = hTransformArg; - psWO->pfnProgress = GDALTermProgress; - + if(osg::isNotifyEnabled(osg::NotifySeverity(osg::INFO + getNotifyOffset()))) + psWO->pfnProgress = GDALTermProgress; + else + psWO->pfnProgress = GDALDummyProgress; + /* -------------------------------------------------------------------- */ /* Setup band mapping. */ /* -------------------------------------------------------------------- */