Hi Robert,

attached are patches to osgTerrain that fix some typos and add a bit of 
documentation.

Cheers,
/ulrich
Index: include/osgTerrain/Terrain
===================================================================
--- include/osgTerrain/Terrain  (revision 11987)
+++ include/osgTerrain/Terrain  (working copy)
@@ -52,7 +52,7 @@
         /** If set to true the boundaries between adjacent tiles should be 
equalized.
           * Note, it is only possible to equalizae boundaries when the 
TerrainTile's contain properly assigned TileID's,
           * databases built with VirtualPlanetBuilder-0.9.11 and older do not 
set the TileID, so databases must be
-          * built with later versions of VirtualPlanetBuilder to take 
advatange of boundary equalization. */
+          * built with later versions of VirtualPlanetBuilder to take 
advantage of boundary equalization. */
         void setEqualizeBoundaries(bool equalizeBoundaries);
 
         /** If true the boundaries between adjacent tiles will be equalized. */
Index: include/osgTerrain/Layer
===================================================================
--- include/osgTerrain/Layer    (revision 11987)
+++ include/osgTerrain/Layer    (working copy)
@@ -31,7 +31,7 @@
 extern OSGTERRAIN_EXPORT void extractSetNameAndFileName(const std::string& 
compoundstring, std::string& setname, std::string& filename);
 
 /** Create a compound string in the form set:setname:filename, or just 
filename if setname is "".*/
-extern OSGTERRAIN_EXPORT std::string createCompondSetNameAndFileName(const 
std::string& setname, const std::string& filename);
+extern OSGTERRAIN_EXPORT std::string createCompoundSetNameAndFileName(const 
std::string& setname, const std::string& filename);
 
 class OSGTERRAIN_EXPORT Layer : public osg::Object
 {
@@ -44,7 +44,10 @@
         
         META_Object(osgTerrain, Layer);
         
+        /** Set the name of this layer. */
         void setSetName(const std::string& setname) { setName(setname); }
+
+        /** Get the name of this layer. */
         const std::string& getSetName() const { return getName(); }
 
         /** Set the file name of the data associated with this layer. */
@@ -54,41 +57,49 @@
         virtual const std::string& getFileName() const { return _filename; }
 
         /** Return the compound name of the layer in the form 
set::name::filename string.*/
-        std::string getCompoundName() const { return 
createCompondSetNameAndFileName(getName(), getFileName()); }
+        std::string getCompoundName() const { return 
createCompoundSetNameAndFileName(getName(), getFileName()); }
 
         void setLocator(Locator* locator) { _locator = locator; }
         Locator* getLocator() { return _locator.get(); }
         const Locator* getLocator() const { return _locator.get(); }
-        
+ 
         void setMinLevel(unsigned int minLevel) { _minLevel = minLevel; }
         unsigned int getMinLevel() const { return _minLevel; }
 
         void setMaxLevel(unsigned int maxLevel) { _maxLevel = maxLevel; }
         unsigned int getMaxLevel() const { return _maxLevel; }
 
+        /** Set the data validation operator. */
         void setValidDataOperator(ValidDataOperator* validDataOp) { 
_validDataOperator = validDataOp; }
+
+        /** Get the data validation operator. */
         ValidDataOperator* getValidDataOperator() { return 
_validDataOperator.get(); }
+
+        /** Get the const data validation operator. */
         const ValidDataOperator* getValidDataOperator() const { return 
_validDataOperator.get(); }
 
 
+        /** Get the number of columns. */
         virtual unsigned int getNumColumns() const { return 0; }
+
+        /** Get the number of rows. */
         virtual unsigned int getNumRows() const { return 0; }
 
         void setDefaultValue(const osg::Vec4& value) { _defaultValue = value; }
         const osg::Vec4& getDefaultValue() const { return _defaultValue; }
         
 
-        /** Set the minification texture filter to use when do texture 
associated with this layer.*/
+        /** Set the minification texture filter to use when a texture is 
associated with this layer.*/
         void setMinFilter(osg::Texture::FilterMode filter) { _minFilter = 
filter; }
 
-        /** Get the minification texture filter to use when do texture 
associated with this layer.*/
+        /** Get the minification texture filter to use when a texture is 
associated with this layer.*/
         osg::Texture::FilterMode getMinFilter() const { return _minFilter; }
 
 
-        /** Set the magniification texture filter to use when do texture 
associated with this layer.*/
+        /** Set the magnification texture filter to use when a texture is 
associated with this layer.*/
         void setMagFilter(osg::Texture::FilterMode filter) { _magFilter = 
filter; }
 
-        /** Get the magnification texture filter to use when do texture 
associated with this layer.*/
+        /** Get the magnification texture filter to use when a texture is 
associated with this layer.*/
         osg::Texture::FilterMode getMagFilter() const { return _magFilter; }
 
 
@@ -102,7 +113,13 @@
 
         virtual bool transform(float /*offset*/, float /*scale*/) { return 
false; }
 
-
+        /**
+         * Get the layer value at position i,j.
+         * @param[in] i X-axis (or column) index.
+         * @param[in] j Y-axis (or row) index.
+         * @param[out] value Returned layer value.
+         * @return true if value is valid, else false
+         */
         virtual bool getValue(unsigned int /*i*/, unsigned int /*j*/, float& 
/*value*/) const { return false; }
         virtual bool getValue(unsigned int /*i*/, unsigned int /*j*/, 
osg::Vec2& /*value*/) const { return false; }
         virtual bool getValue(unsigned int /*i*/, unsigned int /*j*/, 
osg::Vec3& /*value*/) const { return false; }
@@ -133,6 +150,15 @@
         }
 
 
+        /**
+         * Compute column,row indices from normalized coordinates.
+         * @param[in] ndc_x Normalized X-axis coordinate.
+         * @param[in] ndc_y Normalized Y-axis coordinate.
+         * @param[out] i Returned X-axis (or column) index.
+         * @param[out] j Returned Y-axis (or row) index.
+         * @param[out] ir Returned X-axis fraction.
+         * @param[out] jr Returned Y-axis fraction.
+         */
         inline void computeIndices(double ndc_x, double ndc_y, unsigned int& 
i, unsigned int& j, double& ir, double& jr)
         {
             ndc_x *= double(getNumColumns()-1);
@@ -143,7 +169,13 @@
             jr = ndc_y - double(j);
         } 
 
-
+        /**
+         * Calculate the interpolated layer value at the given normalized 
coordinates.
+         * @param[in] ndc_x Normalized X-axis coordinate.
+         * @param[in] ndc_y Normalized Y-axis coordinate.
+         * @param[out] value Returned layer value.
+         * @return true if value is valid, else false
+         */
         inline bool getInterpolatedValue(double ndc_x, double ndc_y, float& 
value)
         {
             unsigned int i,j;
@@ -186,7 +218,7 @@
                 value /= div;
                 return true;
             }
-            
+
             value = 0.0;
             return false;
         }
@@ -239,10 +271,10 @@
         }
 
         /** increment the modified count."*/
-        virtual void dirty() {};
+        virtual void dirty() {}
 
         /** Set the modified count value.  */
-        virtual void setModifiedCount(unsigned int /*value*/) {};
+        virtual void setModifiedCount(unsigned int /*value*/) {}
 
         /** Get modified count value. */
         virtual unsigned int getModifiedCount() const { return 0; }
@@ -467,13 +499,16 @@
 
         void clear();
 
-        void setSetName(const std::string& setname) { setName(setname); }
-        const std::string& getSetName() const { return getName(); }
+        /** Set the set name of layer 'i'. */
+        void setSetName(unsigned int i, const std::string& setname) { 
_layers[i].setname = setname; if (_layers[i].layer.valid()) 
_layers[i].layer->setName(setname); }
 
-        void setSetName(unsigned int i, const std::string& setname) { 
_layers[i].setname = setname; if (_layers[i].layer.valid()) 
_layers[i].layer->setName(setname); }
+        /** Get the set name of layer 'i'. */
         const std::string& getSetName(unsigned int i) const { return 
_layers[i].layer.valid() ? _layers[i].layer->getName() : _layers[i].setname; }
 
+        /** Set the file name of the data associated with layer 'i'. */
         void setFileName(unsigned int i, const std::string& filename) { 
_layers[i].filename = filename; if (_layers[i].layer.valid()) 
_layers[i].layer->setFileName(filename); }
+
+        /** Get the file name of the data associated with layer 'i'. */
         const std::string& getFileName(unsigned int i) const { return 
_layers[i].layer.valid() ? _layers[i].layer->getFileName() : 
_layers[i].filename; }
 
         void setCompoundName(unsigned int i, const std::string& compoundname);
Index: src/osgWrappers/deprecated-dotosg/osgTerrain/HeightFieldLayer.cpp
===================================================================
--- src/osgWrappers/deprecated-dotosg/osgTerrain/HeightFieldLayer.cpp   
(revision 11987)
+++ src/osgWrappers/deprecated-dotosg/osgTerrain/HeightFieldLayer.cpp   
(working copy)
@@ -68,7 +68,7 @@
     
     if (!layer.getFileName().empty())
     {
-        std::string str = 
osgTerrain::createCompondSetNameAndFileName(layer.getName(), 
layer.getFileName());
+        std::string str = 
osgTerrain::createCompoundSetNameAndFileName(layer.getName(), 
layer.getFileName());
         fw.indent()<<"file "<< str << std::endl;
     }
     else
Index: src/osgTerrain/Layer.cpp
===================================================================
--- src/osgTerrain/Layer.cpp    (revision 11987)
+++ src/osgTerrain/Layer.cpp    (working copy)
@@ -45,7 +45,7 @@
     filename = compoundstring.substr(secondcolonpos+1, std::string::npos);
 }
 
-std::string osgTerrain::createCompondSetNameAndFileName(const std::string& 
setname, const std::string& filename)
+std::string osgTerrain::createCompoundSetNameAndFileName(const std::string& 
setname, const std::string& filename)
 {
     if (setname.empty()) return filename;
     return std::string("set:")+setname+std::string(":")+filename;
@@ -620,7 +620,7 @@
 
 std::string CompositeLayer::getCompoundName(unsigned int i) const
 {
-    return createCompondSetNameAndFileName(_layers[i].setname, 
_layers[i].filename);
+    return createCompoundSetNameAndFileName(_layers[i].setname, 
_layers[i].filename);
 }
 
 void CompositeLayer::addLayer(const std::string& compoundname)

Attachment: osgTerrain_typo_doc.tar.gz
Description: GNU Zip compressed data

_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to