From 773ae51a454c012be4e62a45e815be935c75d321 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 24 Jul 2009 14:45:44 +0000 Subject: [PATCH] From Chris Hanson, typo and comment clean ups --- include/osg/ApplicationUsage | 3 +++ include/osg/Camera | 6 +++--- include/osg/Shape | 4 ++-- include/osgAnimation/MorphGeometry | 1 + include/osgTerrain/Locator | 4 ++-- include/osgTerrain/Terrain | 2 +- include/osgTerrain/TerrainTile | 2 +- src/osg/Shape.cpp | 2 +- src/osg/ShapeDrawable.cpp | 6 ++++-- src/osgPlugins/3dc/ReaderWriter3DC.cpp | 18 +++++++++--------- src/osgPlugins/scale/ReaderWriterSCALE.cpp | 14 +++++++------- src/osgSim/LightPointNode.cpp | 16 ++++++++-------- src/osgUtil/CullVisitor.cpp | 2 +- src/osgUtil/RenderBin.cpp | 4 ++-- 14 files changed, 45 insertions(+), 39 deletions(-) diff --git a/include/osg/ApplicationUsage b/include/osg/ApplicationUsage index 1f71f0a06..a035c919e 100644 --- a/include/osg/ApplicationUsage +++ b/include/osg/ApplicationUsage @@ -35,9 +35,12 @@ class OSG_EXPORT ApplicationUsage : public osg::Referenced typedef std::map UsageMap; + /** The ApplicationName is often displayed when logging errors, and frequently incorporated into the Description (below). */ void setApplicationName(const std::string& name) { _applicationName = name; } const std::string& getApplicationName() const { return _applicationName; } + /** If non-empty, the Description is typically shown by the Help Handler + * as text on the Help display (which also lists keyboard abbreviations. */ void setDescription(const std::string& desc) { _description = desc; } const std::string& getDescription() const { return _description; } diff --git a/include/osg/Camera b/include/osg/Camera index 0d74b4520..e1e1ad233 100644 --- a/include/osg/Camera +++ b/include/osg/Camera @@ -72,13 +72,13 @@ class OSG_EXPORT Camera : public Transform, public CullSettings bool getAllowEventFocus() const { return _allowEventFocus; } - /** Set the DsplaySettings object associated with this view.*/ + /** Set the DisplaySettings object associated with this view.*/ void setDisplaySettings(osg::DisplaySettings* ds) { _displaySettings = ds; } - /** Set the DsplaySettings object associated with this view.*/ + /** Get the DisplaySettings object associated with this view.*/ osg::DisplaySettings* getDisplaySettings() { return _displaySettings.get(); } - /** Set the DsplaySettings object associated with this view.*/ + /** Get the const DisplaySettings object associated with this view.*/ const osg::DisplaySettings* getDisplaySettings() const { return _displaySettings.get(); } diff --git a/include/osg/Shape b/include/osg/Shape index 507abd7b6..7879a28df 100644 --- a/include/osg/Shape +++ b/include/osg/Shape @@ -505,7 +505,7 @@ class OSG_EXPORT HeightField : public Shape /** Get the FloatArray height data.*/ osg::FloatArray* getFloatArray() { return _heights.get(); } - /** Get the const sFloatArray height data.*/ + /** Get the const FloatArray height data.*/ const osg::FloatArray* getFloatArray() const { return _heights.get(); } HeightList& getHeightList() { return _heights->asVector(); } @@ -568,7 +568,7 @@ class OSG_EXPORT HeightField : public Shape unsigned int _columns,_rows; - osg::Vec3 _origin; + osg::Vec3 _origin; // _origin is the min value of the X and Y coordinates. float _dx; float _dy; diff --git a/include/osgAnimation/MorphGeometry b/include/osgAnimation/MorphGeometry index c650bef08..bdffe432d 100644 --- a/include/osgAnimation/MorphGeometry +++ b/include/osgAnimation/MorphGeometry @@ -88,6 +88,7 @@ namespace osgAnimation * dirty the bounding sphere to force it to be recomputed on the next * call to \c getBound(). * @param morphTarget The \c MorphTarget to be added to the \c MorphGeometry. + * @param weight The weight to be added to the \c MorphGeometry. * @return \c true for success; \c false otherwise. */ virtual void addMorphTarget( osg::Geometry *morphTarget, float weight = 1.0 ) { _morphTargets.push_back(MorphTarget(morphTarget, weight)); _dirty = true; } diff --git a/include/osgTerrain/Locator b/include/osgTerrain/Locator index 7716ec454..263dfa9cb 100644 --- a/include/osgTerrain/Locator +++ b/include/osgTerrain/Locator @@ -88,9 +88,9 @@ class OSGTERRAIN_EXPORT Locator : public osg::Object virtual bool orientationOpenGL() const; - virtual bool convertLocalToModel(const osg::Vec3d& /*local*/, osg::Vec3d& /*world*/) const; + virtual bool convertLocalToModel(const osg::Vec3d& local, osg::Vec3d& world) const; - virtual bool convertModelToLocal(const osg::Vec3d& /*world*/, osg::Vec3d& /*local*/) const; + virtual bool convertModelToLocal(const osg::Vec3d& world, osg::Vec3d& local) const; static bool convertLocalCoordBetween(const Locator& source, const osg::Vec3d& sourceNDC, const Locator& destination, osg::Vec3d& destinationNDC) diff --git a/include/osgTerrain/Terrain b/include/osgTerrain/Terrain index 2bdc312d8..9c1b49f98 100644 --- a/include/osgTerrain/Terrain +++ b/include/osgTerrain/Terrain @@ -22,7 +22,7 @@ namespace osgTerrain { /** Terrain provides a framework for loosely coupling height field data with height rendering algorithms. - * This allows TerrainTechnique's to be plugged in at runtime.*/ + * This allows TerrainTechniques to be plugged in at runtime.*/ class OSGTERRAIN_EXPORT Terrain : public osg::Group { public: diff --git a/include/osgTerrain/TerrainTile b/include/osgTerrain/TerrainTile index 82ba82ea8..42b7ece3a 100644 --- a/include/osgTerrain/TerrainTile +++ b/include/osgTerrain/TerrainTile @@ -117,7 +117,7 @@ class OSGTERRAIN_EXPORT TerrainTile : public osg::Group /** Get the coordinate frame locator of the terrain node.*/ Locator* getLocator() { return _locator.get(); } - /** Get the coordinate frame locator of the terrain node.*/ + /** Get the const coordinate frame locator of the terrain node.*/ const Locator* getLocator() const { return _locator.get(); } /** Set the layer to use to define the elevations of the terrain.*/ diff --git a/src/osg/Shape.cpp b/src/osg/Shape.cpp index 8b90d9f1a..97308a67f 100644 --- a/src/osg/Shape.cpp +++ b/src/osg/Shape.cpp @@ -138,7 +138,7 @@ Vec3 HeightField::getNormal(unsigned int c,unsigned int r) const Vec2 HeightField::getHeightDelta(unsigned int c,unsigned int r) const { - // four point normal generation. + // four point height generation. Vec2 heightDelta; if (c==0) { diff --git a/src/osg/ShapeDrawable.cpp b/src/osg/ShapeDrawable.cpp index 6203fd9db..1cfe8aa44 100644 --- a/src/osg/ShapeDrawable.cpp +++ b/src/osg/ShapeDrawable.cpp @@ -953,6 +953,7 @@ void DrawShapeVisitor::apply(const HeightField& field) + // draw each row of HeightField for(unsigned int row=0;rowsize()>=targetNumVertices) { // finishing setting up the current geometry and add it to the geode. - geometry->setUseDisplayList(true); - geometry->setUseVertexBufferObjects(true); + geometry->setUseDisplayList(true); + geometry->setUseVertexBufferObjects(true); geometry->setVertexArray(vertices); geometry->setNormalArray(normals); geometry->setNormalBinding(osg::Geometry::BIND_PER_VERTEX); @@ -175,7 +175,7 @@ class ReaderWriter3DC : public osgDB::ReaderWriter geometry->setUseDisplayList(true); - geometry->setUseVertexBufferObjects(true); + geometry->setUseVertexBufferObjects(true); geometry->setVertexArray(vertices); geometry->setNormalArray(normals); geometry->setNormalBinding(osg::Geometry::BIND_PER_VERTEX); @@ -189,19 +189,19 @@ class ReaderWriter3DC : public osgDB::ReaderWriter } - virtual WriteResult writeNode(const osg::Node& node,const std::string& fileName,const Options* options =NULL) const - { - if (!acceptsExtension(osgDB::getFileExtension(fileName))) - return WriteResult(WriteResult::FILE_NOT_HANDLED); + virtual WriteResult writeNode(const osg::Node& node,const std::string& fileName,const Options* options =NULL) const + { + std::string ext = osgDB::getLowerCaseFileExtension(fileName); + if( !acceptsExtension(ext)) return WriteResult::FILE_NOT_HANDLED; osgDB::ofstream f(fileName.c_str()); - Writer3DCNodeVisitor nv(f); + Writer3DCNodeVisitor nv(f); // we must cast away constness (const_cast(&node))->accept(nv); - return WriteResult(WriteResult::FILE_SAVED); + return WriteResult::FILE_SAVED; } }; diff --git a/src/osgPlugins/scale/ReaderWriterSCALE.cpp b/src/osgPlugins/scale/ReaderWriterSCALE.cpp index 068539754..df6401943 100644 --- a/src/osgPlugins/scale/ReaderWriterSCALE.cpp +++ b/src/osgPlugins/scale/ReaderWriterSCALE.cpp @@ -1,6 +1,6 @@ -/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2004 Robert Osfield +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2004 Robert Osfield * - * This application is open source and may be redistributed and/or modified + * This application is open source and may be redistributed and/or modified * freely and without restriction, both in commericial and non commericial * applications, as long as this copyright notice is maintained. * @@ -55,7 +55,7 @@ static bool getFilenameAndParams(const std::string& input, std::string& filename return false; } - // clear the params sting of any brackets. + // clear the params string of any brackets. std::string::size_type params_pos = params.size(); for(; params_pos>0; ) { @@ -81,10 +81,10 @@ static bool getFilenameAndParams(const std::string& input, std::string& filename * This pseudo-loader make it simple to change the size of a saved model * by specifying a correcting scale factor as part of the filename. * - * Usage: .,,.globe - * ..globe + * Usage: .,,.scale + * ..scale * where: - * = an model filename. + * = a model filename. * = scale factor along the X axis. * = scale factor along the Y axis. * = scale factor along the Z axis. @@ -104,7 +104,7 @@ public: virtual const char* className() const { return "scaling pseudo-loader"; } virtual bool acceptsExtension(const std::string& extension) const - { + { return osgDB::equalCaseInsensitive( extension, EXTENSION_NAME ); } diff --git a/src/osgSim/LightPointNode.cpp b/src/osgSim/LightPointNode.cpp index a4311d51e..ff8bd301e 100644 --- a/src/osgSim/LightPointNode.cpp +++ b/src/osgSim/LightPointNode.cpp @@ -36,7 +36,7 @@ osg::StateSet* getSingletonLightPointSystemSet() if (!s_stateset) { s_stateset = new osg::StateSet; - // force light point nodes to be drawn after everything else by picking a renderin bin number after + // force light point nodes to be drawn after everything else by picking a rendering bin number after // the transparent bin. s_stateset->setRenderBinDetails(20,"DepthSortedBin"); } @@ -147,7 +147,7 @@ void LightPointNode::traverse(osg::NodeVisitor& nv) #endif - // should we disabled small feature culling here? + // should we disable small feature culling here? if (cv /*&& !cv->isCulled(_bbox)*/) { @@ -158,7 +158,7 @@ void LightPointNode::traverse(osg::NodeVisitor& nv) if (rg->leaves_empty()) { // this is first leaf to be added to StateGraph - // and therefore should not already know to current render bin, + // and therefore should not already know current render bin, // so need to add it. cv->getCurrentRenderBin()->addStateGraph(rg); } @@ -210,7 +210,7 @@ void LightPointNode::traverse(osg::NodeVisitor& nv) if (litr == rg->_leaves.end()) { - // havn't found the drawable added in the RenderLeaf list, there this my be the + // haven't found the drawable added in the RenderLeaf list, therefore this may be the // first time through LightPointNode in this frame, so need to add drawable into the StateGraph RenderLeaf list // and update its time signatures. @@ -267,7 +267,7 @@ void LightPointNode::traverse(osg::NodeVisitor& nv) float intensity = (_lightSystem.valid()) ? _lightSystem->getIntensity() : lp._intensity; - // slip light point if it is intensity is 0.0 or negative. + // slip light point if its intensity is 0.0 or negative. if (intensity<=minimumIntensity) continue; // (SIB) Clip on distance, if close to limit, add transparancy @@ -286,7 +286,7 @@ void LightPointNode::traverse(osg::NodeVisitor& nv) { intensity *= (*lp._sector)(dv); - // slip light point if it is intensity is 0.0 or negative. + // skip light point if it is intensity is 0.0 or negative. if (intensity<=minimumIntensity) continue; } @@ -308,7 +308,7 @@ void LightPointNode::traverse(osg::NodeVisitor& nv) color[3] *= bs[3]; } - // if alpha value is less than the min intentsive then skip + // if alpha value is less than the min intentsity then skip if (color[3]<=minimumIntensity) continue; float pixelSize = cv->pixelSize(position,lp._radius); @@ -318,7 +318,7 @@ void LightPointNode::traverse(osg::NodeVisitor& nv) // adjust pixel size to account for intensity. if (intensity!=1.0) pixelSize *= sqrt(intensity); - // adjust alfa to account for max range (Fade on distance) + // adjust alpha to account for max range (Fade on distance) color[3] *= distanceFactor; // round up to the minimum pixel size if required. diff --git a/src/osgUtil/CullVisitor.cpp b/src/osgUtil/CullVisitor.cpp index e25f65563..b47811aa8 100644 --- a/src/osgUtil/CullVisitor.cpp +++ b/src/osgUtil/CullVisitor.cpp @@ -1092,7 +1092,7 @@ void CullVisitor::apply(osg::ClearNode& node) } else { - // we have an earth sky implementation to do the work for use + // we have an earth sky implementation to do the work for us // so we don't need to clear. getCurrentRenderBin()->getStage()->setClearMask(0); } diff --git a/src/osgUtil/RenderBin.cpp b/src/osgUtil/RenderBin.cpp index 1ea40e8eb..2637fd775 100644 --- a/src/osgUtil/RenderBin.cpp +++ b/src/osgUtil/RenderBin.cpp @@ -67,7 +67,7 @@ RenderBin* RenderBin::createRenderBin(const std::string& binName) if (prototype) return dynamic_cast(prototype->clone(osg::CopyOp::DEEP_COPY_ALL)); } - osg::notify(osg::WARN) <<"Warning: RenderBin \""<second.get(); - // create a renderin bin and insert into bin list. + // create a rendering bin and insert into bin list. RenderBin* rb = RenderBin::createRenderBin(binName); if (rb) {