From 10232cf81a899695dba4a08e705d516472912002 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 16 May 2005 11:18:11 +0000 Subject: [PATCH] Fixed method signatures. --- include/osg/ShapeDrawable | 6 +-- include/osgDB/Archive | 2 +- src/osgTerrain/DataSet.cpp | 100 +++++++++++++++++-------------------- 3 files changed, 49 insertions(+), 59 deletions(-) diff --git a/include/osg/ShapeDrawable b/include/osg/ShapeDrawable index c77f096f2..de2e7edaa 100644 --- a/include/osg/ShapeDrawable +++ b/include/osg/ShapeDrawable @@ -163,16 +163,16 @@ class OSG_EXPORT ShapeDrawable : public Drawable virtual void drawImplementation(State& state) const; /** Return false, osg::ShapeDrawable does not support accept(AttributeFunctor&).*/ - virtual bool supports(AttributeFunctor&) const { return false; } + virtual bool supports(const AttributeFunctor&) const { return false; } /** Return true, osg::ShapeDrawable does support accept(ConstAttributeFunctor&).*/ - virtual bool supports(ConstAttributeFunctor&) const { return true; } + virtual bool supports(const ConstAttributeFunctor&) const { return true; } /** Accept a ConstAttributeFunctor and call its methods to tell it about the interal attributes that this Drawable has.*/ virtual void accept(ConstAttributeFunctor& af) const; /** Return true, osg::ShapeDrawable does support accept(PrimitiveFunctor&) .*/ - virtual bool supports(PrimitiveFunctor&) const { return true; } + virtual bool supports(const PrimitiveFunctor&) const { return true; } /** Accept a PrimitiveFunctor and call its methods to tell it about the internal primitives that this Drawable has.*/ virtual void accept(PrimitiveFunctor& pf) const; diff --git a/include/osgDB/Archive b/include/osgDB/Archive index 200632e9f..c258aef91 100644 --- a/include/osgDB/Archive +++ b/include/osgDB/Archive @@ -34,7 +34,7 @@ class OSGDB_EXPORT Archive : public ReaderWriter virtual const char* className() const { return "Archive"; } - virtual bool acceptsExtension(const std::string& /*extension*/) { return true; } + virtual bool acceptsExtension(const std::string& /*extension*/) const { return true; } /** close the archive.*/ virtual void close() = 0; diff --git a/src/osgTerrain/DataSet.cpp b/src/osgTerrain/DataSet.cpp index 747c6e3a7..b908176fc 100644 --- a/src/osgTerrain/DataSet.cpp +++ b/src/osgTerrain/DataSet.cpp @@ -209,7 +209,7 @@ bool areCoordinateSystemEquivalent(const osg::CoordinateSystemNode* lhs,const os <<"RHS = "<getCoordinateSystem()<GetUnitType()=" << bandSelected->GetUnitType()<GetUnitType()= null" <getVerticalScale(); my_notify(osg::INFO)<<"We have no Scale from file so use DataSet vertical scale of "<getConvertFromGeographicToGeocentric()*/) ? 1.0f/111319.0f : 1.0f; } @@ -912,17 +902,17 @@ void DataSet::SourceData::readHeightField(DestinationData& destination) float* heightPtr = heightData; - for(int r=destY+destHeight-1;r>=destY;--r) - { - for(int c=destX;c=destY;--r) + { + for(int c=destX;csetHeight(c,r,offset + h*scale); else if (!ignoreNoDataValue) hf->setHeight(c,r,noDataValueFill); h = hf->getHeight(c,r); - } - } + } + } delete [] heightData; @@ -2055,12 +2045,12 @@ void DataSet::DestinationTile::optimizeResolution() float maxHeight = minHeight; for(unsigned int r=0;rgetNumRows();++r) { - for(unsigned int c=0;cgetNumColumns();++c) - { + for(unsigned int c=0;cgetNumColumns();++c) + { float h = hf->getHeight(c,r); if (hmaxHeight) maxHeight = h; - } + } } if (minHeight==maxHeight) @@ -2516,8 +2506,8 @@ osg::Node* DataSet::DestinationTile::createPolygonal() for(r=0;rgetHeight(c,r); @@ -2535,7 +2525,7 @@ osg::Node* DataSet::DestinationTile::createPolygonal() } else { - v[vi].set(X,Y,Z); + v[vi].set(X,Y,Z); } @@ -2568,12 +2558,12 @@ osg::Node* DataSet::DestinationTile::createPolygonal() // note normal will need rotating. if (n.valid()) (*(n.get()))[vi] = grid->getNormal(c,r); - t[vi].x() = (c==numColumns-1)? 1.0f : (float)(c)/(float)(numColumns-1); - t[vi].y() = (r==numRows-1)? 1.0f : (float)(r)/(float)(numRows-1); + t[vi].x() = (c==numColumns-1)? 1.0f : (float)(c)/(float)(numColumns-1); + t[vi].y() = (r==numRows-1)? 1.0f : (float)(r)/(float)(numRows-1); ++vi; - } + } } @@ -2619,8 +2609,8 @@ osg::Node* DataSet::DestinationTile::createPolygonal() int ei=0; for(r=0;r0;--c) { // assign indices to primitive set - skirtDrawElements[ei++] = (r)*numColumns+c; - skirtDrawElements[ei++] = vi; + skirtDrawElements[ei++] = (r)*numColumns+c; + skirtDrawElements[ei++] = vi; // mark these points as protected to prevent them from being removed during simplification pointsToProtectDuringSimplification.push_back((r)*numColumns+c); @@ -2751,8 +2741,8 @@ osg::Node* DataSet::DestinationTile::createPolygonal() for(r=numRows-1;r>0;--r) { // assign indices to primitive set - skirtDrawElements[ei++] = (r)*numColumns+c; - skirtDrawElements[ei++] = vi; + skirtDrawElements[ei++] = (r)*numColumns+c; + skirtDrawElements[ei++] = vi; // mark these points as protected to prevent them from being removed during simplification pointsToProtectDuringSimplification.push_back((r)*numColumns+c);