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."
This commit is contained in:
Robert Osfield
2006-07-11 10:34:41 +00:00
parent 1fc9855d88
commit ad18b88848
2 changed files with 7 additions and 4 deletions

View File

@@ -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,

View File

@@ -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. */
/* -------------------------------------------------------------------- */