Fixed warnings, updated NEWS

This commit is contained in:
Robert Osfield 2009-01-30 10:55:28 +00:00
parent 6710fbc78a
commit 411431f3be
18 changed files with 37 additions and 36 deletions

View File

@ -22,9 +22,10 @@ The !OpenSceneGraph 2.8 release is the culmination of 9 years of work by the lea
* New PDF widget support (based on libPoppler) * New PDF widget support (based on libPoppler)
* New VNC client widget support (based on libVNCServer) * New VNC client widget support (based on libVNCServer)
* New Browser client widget support (based on Gecko/UBrowser) * New Browser client widget support (based on Gecko/UBrowser)
* New plugins for loading Half-Life 2 maps and models.
* Improvements to DatabasePager tailored for low latency paging. * Improvements to DatabasePager tailored for low latency paging.
* Improved stats collection and on screen reporting. * Improved stats collection and on screen reporting.
* Support for the OpenGL geometry instancing extension. * Support for the OpenGL draw instanced extension.
* Improvements to COLLADA support. * Improvements to COLLADA support.
* Build reporting using CDash * Build reporting using CDash
* New Packing support using CPack * New Packing support using CPack

View File

@ -226,8 +226,8 @@ class TemplateArray : public Array, public MixinVector<T>
} }
virtual const GLvoid* getDataPointer() const { if (!this->empty()) return &this->front(); else return 0; } virtual const GLvoid* getDataPointer() const { if (!this->empty()) return &this->front(); else return 0; }
virtual unsigned int getTotalDataSize() const { return this->size()*sizeof(T); } virtual unsigned int getTotalDataSize() const { return static_cast<unsigned int>(this->size()*sizeof(T)); }
virtual unsigned int getNumElements() const { return this->size(); } virtual unsigned int getNumElements() const { return static_cast<unsigned int>(this->size()); }
typedef T ElementDataType; // expose T typedef T ElementDataType; // expose T
@ -312,8 +312,8 @@ class TemplateIndexArray : public IndexArray, public MixinVector<T>
} }
virtual const GLvoid* getDataPointer() const { if (!this->empty()) return &this->front(); else return 0; } virtual const GLvoid* getDataPointer() const { if (!this->empty()) return &this->front(); else return 0; }
virtual unsigned int getTotalDataSize() const { return this->size()*sizeof(T); } virtual unsigned int getTotalDataSize() const { return static_cast<unsigned int>(this->size()*sizeof(T)); }
virtual unsigned int getNumElements() const { return this->size(); } virtual unsigned int getNumElements() const { return static_cast<unsigned int>(this->size()); }
virtual unsigned int index(unsigned int pos) const { return (*this)[pos]; } virtual unsigned int index(unsigned int pos) const { return (*this)[pos]; }

View File

@ -154,7 +154,7 @@ class OSG_EXPORT Drawable : public Object
* Get the number of parents of node. * Get the number of parents of node.
* @return the number of parents of this node. * @return the number of parents of this node.
*/ */
inline unsigned int getNumParents() const { return _parents.size(); } inline unsigned int getNumParents() const { return static_cast<unsigned int>(_parents.size()); }
/** Get the list of matrices that transform this node from local coordinates to world coordinates. /** Get the list of matrices that transform this node from local coordinates to world coordinates.
* The optional Node* haltTraversalAtNode allows the user to prevent traversal beyond a specifed node. */ * The optional Node* haltTraversalAtNode allows the user to prevent traversal beyond a specifed node. */

View File

@ -199,7 +199,7 @@ class OSG_EXPORT Geometry : public Drawable
ArrayData& getTexCoordData(unsigned int index); ArrayData& getTexCoordData(unsigned int index);
const ArrayData& getTexCoordData(unsigned int index) const; const ArrayData& getTexCoordData(unsigned int index) const;
unsigned int getNumTexCoordArrays() const { return _texCoordList.size(); } unsigned int getNumTexCoordArrays() const { return static_cast<unsigned int>(_texCoordList.size()); }
ArrayDataList& getTexCoordArrayList() { return _texCoordList; } ArrayDataList& getTexCoordArrayList() { return _texCoordList; }
const ArrayDataList& getTexCoordArrayList() const { return _texCoordList; } const ArrayDataList& getTexCoordArrayList() const { return _texCoordList; }
@ -219,7 +219,7 @@ class OSG_EXPORT Geometry : public Drawable
ArrayData& getVertexAttribData(unsigned int index); ArrayData& getVertexAttribData(unsigned int index);
const ArrayData& getVertexAttribData(unsigned int index) const; const ArrayData& getVertexAttribData(unsigned int index) const;
unsigned int getNumVertexAttribArrays() const { return _vertexAttribList.size(); } unsigned int getNumVertexAttribArrays() const { return static_cast<unsigned int>(_vertexAttribList.size()); }
ArrayDataList& getVertexAttribArrayList() { return _vertexAttribList; } ArrayDataList& getVertexAttribArrayList() { return _vertexAttribList; }
const ArrayDataList& getVertexAttribArrayList() const { return _vertexAttribList; } const ArrayDataList& getVertexAttribArrayList() const { return _vertexAttribList; }
@ -231,7 +231,7 @@ class OSG_EXPORT Geometry : public Drawable
PrimitiveSetList& getPrimitiveSetList() { return _primitives; } PrimitiveSetList& getPrimitiveSetList() { return _primitives; }
const PrimitiveSetList& getPrimitiveSetList() const { return _primitives; } const PrimitiveSetList& getPrimitiveSetList() const { return _primitives; }
unsigned int getNumPrimitiveSets() const { return _primitives.size(); } unsigned int getNumPrimitiveSets() const { return static_cast<unsigned int>(_primitives.size()); }
PrimitiveSet* getPrimitiveSet(unsigned int pos) { return _primitives[pos].get(); } PrimitiveSet* getPrimitiveSet(unsigned int pos) { return _primitives[pos].get(); }
const PrimitiveSet* getPrimitiveSet(unsigned int pos) const { return _primitives[pos].get(); } const PrimitiveSet* getPrimitiveSet(unsigned int pos) const { return _primitives[pos].get(); }

View File

@ -97,7 +97,7 @@ class OSG_EXPORT Group : public Node
virtual bool replaceChild( Node *origChild, Node* newChild ); virtual bool replaceChild( Node *origChild, Node* newChild );
/** Return the number of children nodes. */ /** Return the number of children nodes. */
inline unsigned int getNumChildren() const { return _children.size(); } inline unsigned int getNumChildren() const { return static_cast<unsigned int>(_children.size()); }
/** Set child node at position i. /** Set child node at position i.
* Return true if set correctly, false on failure (if node==NULL || i is out of range). * Return true if set correctly, false on failure (if node==NULL || i is out of range).
@ -139,7 +139,7 @@ class OSG_EXPORT Group : public Node
{ {
if (_children[childNum]==node) return childNum; if (_children[childNum]==node) return childNum;
} }
return _children.size(); // node not found. return static_cast<unsigned int>(_children.size()); // node not found.
} }
/** Set whether to use a mutex to ensure ref() and unref() are thread safe.*/ /** Set whether to use a mutex to ensure ref() and unref() are thread safe.*/

View File

@ -273,7 +273,7 @@ class OSG_EXPORT Image : public Object
unsigned int getNumMipmapLevels() const unsigned int getNumMipmapLevels() const
{ {
return _mipmapData.size()+1; return static_cast<unsigned int>(_mipmapData.size())+1;
}; };
/** Send offsets into data. It is assumed that first mipmap offset (index 0) is 0.*/ /** Send offsets into data. It is assumed that first mipmap offset (index 0) is 0.*/

View File

@ -131,7 +131,7 @@ class OSG_EXPORT KdTree : public osg::Shape
int addNode(const KdNode& node) int addNode(const KdNode& node)
{ {
int num = _kdNodes.size(); int num = static_cast<int>(_kdNodes.size());
_kdNodes.push_back(node); _kdNodes.push_back(node);
return num; return num;
} }
@ -147,7 +147,7 @@ class OSG_EXPORT KdTree : public osg::Shape
unsigned int addTriangle(const Triangle& tri) unsigned int addTriangle(const Triangle& tri)
{ {
unsigned int num = _triangles.size(); unsigned int num = static_cast<unsigned int>(_triangles.size());
_triangles.push_back(tri); _triangles.push_back(tri);
return num; return num;
} }

View File

@ -144,7 +144,7 @@ class OSG_EXPORT Node : public Object
* Get the number of parents of node. * Get the number of parents of node.
* @return the number of parents of this node. * @return the number of parents of this node.
*/ */
inline unsigned int getNumParents() const { return _parents.size(); } inline unsigned int getNumParents() const { return static_cast<unsigned int>(_parents.size()); }
/** Get the list of node paths parent paths. /** Get the list of node paths parent paths.
* The optional Node* haltTraversalAtNode allows the user to prevent traversal beyond a specifed node. */ * The optional Node* haltTraversalAtNode allows the user to prevent traversal beyond a specifed node. */
@ -279,7 +279,7 @@ class OSG_EXPORT Node : public Object
inline std::string& getDescription(unsigned int i) { return _descriptions[i]; } inline std::string& getDescription(unsigned int i) { return _descriptions[i]; }
/** Get the number of descriptions of the node.*/ /** Get the number of descriptions of the node.*/
inline unsigned int getNumDescriptions() const { return _descriptions.size(); } inline unsigned int getNumDescriptions() const { return static_cast<unsigned int>(_descriptions.size()); }
/** Add a description string to the node.*/ /** Add a description string to the node.*/
void addDescription(const std::string& desc) { _descriptions.push_back(desc); } void addDescription(const std::string& desc) { _descriptions.push_back(desc); }

View File

@ -108,7 +108,7 @@ class OSG_EXPORT OperationQueue : public Referenced
bool empty() const { return _operations.empty(); } bool empty() const { return _operations.empty(); }
/** Return the num of pending operations that are sitting in the OperationQueue.*/ /** Return the num of pending operations that are sitting in the OperationQueue.*/
unsigned int getNumOperationsInQueue() const { return _operations.size(); } unsigned int getNumOperationsInQueue() const { return static_cast<unsigned int>(_operations.size()); }
/** Add operation to end of OperationQueue, this will be /** Add operation to end of OperationQueue, this will be
* executed by the operation thread once this operation gets to the head of the queue.*/ * executed by the operation thread once this operation gets to the head of the queue.*/

View File

@ -316,8 +316,8 @@ class OSG_EXPORT DrawArrays : public PrimitiveSet
virtual void accept(PrimitiveFunctor& functor) const; virtual void accept(PrimitiveFunctor& functor) const;
virtual void accept(PrimitiveIndexFunctor& functor) const; virtual void accept(PrimitiveIndexFunctor& functor) const;
virtual unsigned int getNumIndices() const { return _count; } virtual unsigned int getNumIndices() const { return static_cast<unsigned int>(_count); }
virtual unsigned int index(unsigned int pos) const { return _first+pos; } virtual unsigned int index(unsigned int pos) const { return static_cast<unsigned int>(_first)+pos; }
virtual void offsetIndices(int offset) { _first += offset; } virtual void offsetIndices(int offset) { _first += offset; }
protected: protected:
@ -493,7 +493,7 @@ class OSG_EXPORT DrawElementsUByte : public DrawElements, public VectorGLubyte
virtual const char* className() const { return "DrawElementsUByte"; } virtual const char* className() const { return "DrawElementsUByte"; }
virtual const GLvoid* getDataPointer() const { return empty()?0:&front(); } virtual const GLvoid* getDataPointer() const { return empty()?0:&front(); }
virtual unsigned int getTotalDataSize() const { return size(); } virtual unsigned int getTotalDataSize() const { return static_cast<unsigned int>(size()); }
virtual bool supportsBufferObject() const { return false; } virtual bool supportsBufferObject() const { return false; }
virtual void draw(State& state, bool useVertexBufferObjects) const ; virtual void draw(State& state, bool useVertexBufferObjects) const ;
@ -501,7 +501,7 @@ class OSG_EXPORT DrawElementsUByte : public DrawElements, public VectorGLubyte
virtual void accept(PrimitiveFunctor& functor) const; virtual void accept(PrimitiveFunctor& functor) const;
virtual void accept(PrimitiveIndexFunctor& functor) const; virtual void accept(PrimitiveIndexFunctor& functor) const;
virtual unsigned int getNumIndices() const { return size(); } virtual unsigned int getNumIndices() const { return static_cast<unsigned int>(size()); }
virtual unsigned int index(unsigned int pos) const { return (*this)[pos]; } virtual unsigned int index(unsigned int pos) const { return (*this)[pos]; }
virtual void offsetIndices(int offset); virtual void offsetIndices(int offset);
@ -568,7 +568,7 @@ class OSG_EXPORT DrawElementsUShort : public DrawElements, public VectorGLushort
virtual const char* className() const { return "DrawElementsUShort"; } virtual const char* className() const { return "DrawElementsUShort"; }
virtual const GLvoid* getDataPointer() const { return empty()?0:&front(); } virtual const GLvoid* getDataPointer() const { return empty()?0:&front(); }
virtual unsigned int getTotalDataSize() const { return 2*size(); } virtual unsigned int getTotalDataSize() const { return 2u*static_cast<unsigned int>(size()); }
virtual bool supportsBufferObject() const { return false; } virtual bool supportsBufferObject() const { return false; }
virtual void draw(State& state, bool useVertexBufferObjects) const; virtual void draw(State& state, bool useVertexBufferObjects) const;
@ -576,7 +576,7 @@ class OSG_EXPORT DrawElementsUShort : public DrawElements, public VectorGLushort
virtual void accept(PrimitiveFunctor& functor) const; virtual void accept(PrimitiveFunctor& functor) const;
virtual void accept(PrimitiveIndexFunctor& functor) const; virtual void accept(PrimitiveIndexFunctor& functor) const;
virtual unsigned int getNumIndices() const { return size(); } virtual unsigned int getNumIndices() const { return static_cast<unsigned int>(size()); }
virtual unsigned int index(unsigned int pos) const { return (*this)[pos]; } virtual unsigned int index(unsigned int pos) const { return (*this)[pos]; }
virtual void offsetIndices(int offset); virtual void offsetIndices(int offset);
@ -642,7 +642,7 @@ class OSG_EXPORT DrawElementsUInt : public DrawElements, public VectorGLuint
virtual const char* className() const { return "DrawElementsUInt"; } virtual const char* className() const { return "DrawElementsUInt"; }
virtual const GLvoid* getDataPointer() const { return empty()?0:&front(); } virtual const GLvoid* getDataPointer() const { return empty()?0:&front(); }
virtual unsigned int getTotalDataSize() const { return 4*size(); } virtual unsigned int getTotalDataSize() const { return 4u*static_cast<unsigned int>(size()); }
virtual bool supportsBufferObject() const { return false; } virtual bool supportsBufferObject() const { return false; }
virtual void draw(State& state, bool useVertexBufferObjects) const; virtual void draw(State& state, bool useVertexBufferObjects) const;
@ -650,7 +650,7 @@ class OSG_EXPORT DrawElementsUInt : public DrawElements, public VectorGLuint
virtual void accept(PrimitiveFunctor& functor) const; virtual void accept(PrimitiveFunctor& functor) const;
virtual void accept(PrimitiveIndexFunctor& functor) const; virtual void accept(PrimitiveIndexFunctor& functor) const;
virtual unsigned int getNumIndices() const { return size(); } virtual unsigned int getNumIndices() const { return static_cast<unsigned int>(size()); }
virtual unsigned int index(unsigned int pos) const { return (*this)[pos]; } virtual unsigned int index(unsigned int pos) const { return (*this)[pos]; }
virtual void offsetIndices(int offset); virtual void offsetIndices(int offset);

View File

@ -83,7 +83,7 @@ class OSG_EXPORT Program : public osg::StateAttribute
* Mark Program as needing relink. Return true for success */ * Mark Program as needing relink. Return true for success */
bool addShader( Shader* shader ); bool addShader( Shader* shader );
unsigned int getNumShaders() const { return _shaderList.size(); } unsigned int getNumShaders() const { return static_cast<unsigned int>(_shaderList.size()); }
Shader* getShader( unsigned int i ) { return _shaderList[i].get(); } Shader* getShader( unsigned int i ) { return _shaderList[i].get(); }
const Shader* getShader( unsigned int i ) const { return _shaderList[i].get(); } const Shader* getShader( unsigned int i ) const { return _shaderList[i].get(); }

View File

@ -609,7 +609,7 @@ class OSG_EXPORT CompositeShape : public Shape
const Shape* getShape() const { return _shape.get(); } const Shape* getShape() const { return _shape.get(); }
/** Get the number of children of this composite shape.*/ /** Get the number of children of this composite shape.*/
unsigned int getNumChildren() const { return _children.size(); } unsigned int getNumChildren() const { return static_cast<unsigned int>(_children.size()); }
/** Get a child.*/ /** Get a child.*/
Shape* getChild(unsigned int i) { return _children[i].get(); } Shape* getChild(unsigned int i) { return _children[i].get(); }
@ -631,7 +631,7 @@ class OSG_EXPORT CompositeShape : public Shape
{ {
if (_children[childNo]==shape) return childNo; if (_children[childNo]==shape) return childNo;
} }
return _children.size(); // node not found. return static_cast<unsigned int>(_children.size()); // node not found.
} }

View File

@ -134,7 +134,7 @@ class OSG_EXPORT State : public Referenced, public Observer
void removeStateSet(unsigned int pos); void removeStateSet(unsigned int pos);
/** Get the number of StateSet's on the StateSet stack.*/ /** Get the number of StateSet's on the StateSet stack.*/
unsigned int getStateSetStackSize() { return _stateStateStack.size(); } unsigned int getStateSetStackSize() { return static_cast<unsigned int>(_stateStateStack.size()); }
/** Pop StateSet's for the StateSet stack till its size equals the specified size.*/ /** Pop StateSet's for the StateSet stack till its size equals the specified size.*/
void popStateSetStackToSize(unsigned int size) { while (_stateStateStack.size()>size) popStateSet(); } void popStateSetStackToSize(unsigned int size) { while (_stateStateStack.size()>size) popStateSet(); }

View File

@ -256,7 +256,7 @@ class OSG_EXPORT StateAttribute : public Object
* Get the number of parents of this StateAttribute. * Get the number of parents of this StateAttribute.
* @return the number of parents of this StateAttribute. * @return the number of parents of this StateAttribute.
*/ */
inline unsigned int getNumParents() const { return _parents.size(); } inline unsigned int getNumParents() const { return static_cast<unsigned int>(_parents.size()); }
struct ModeUsage struct ModeUsage

View File

@ -89,7 +89,7 @@ class OSG_EXPORT StateSet : public Object
* Get the number of parents of this StateSet. * Get the number of parents of this StateSet.
* @return the number of parents of this StateSet. * @return the number of parents of this StateSet.
*/ */
inline unsigned int getNumParents() const { return _parents.size(); } inline unsigned int getNumParents() const { return static_cast<unsigned int>(_parents.size()); }
/** Compute the DataVariance based on an assessment of callback etc.*/ /** Compute the DataVariance based on an assessment of callback etc.*/

View File

@ -38,7 +38,7 @@ class OSG_EXPORT Stats : public osg::Referenced
void allocate(unsigned int numberOfFrames); void allocate(unsigned int numberOfFrames);
int getEarliestFrameNumber() const { return _latestFrameNumber < static_cast<int>(_attributeMapList.size()) ? 0 : _latestFrameNumber - _attributeMapList.size() + 1; } int getEarliestFrameNumber() const { return _latestFrameNumber < static_cast<int>(_attributeMapList.size()) ? 0 : _latestFrameNumber - static_cast<int>(_attributeMapList.size()) + 1; }
int getLatestFrameNumber() const { return _latestFrameNumber; } int getLatestFrameNumber() const { return _latestFrameNumber; }
typedef std::map<std::string, double> AttributeMap; typedef std::map<std::string, double> AttributeMap;
@ -102,7 +102,7 @@ class OSG_EXPORT Stats : public osg::Referenced
if (frameNumber < getEarliestFrameNumber()) return -1; if (frameNumber < getEarliestFrameNumber()) return -1;
if (frameNumber >= _baseFrameNumber) return frameNumber - _baseFrameNumber; if (frameNumber >= _baseFrameNumber) return frameNumber - _baseFrameNumber;
else return _attributeMapList.size() - (_baseFrameNumber-frameNumber); else return static_cast<int>(_attributeMapList.size()) - (_baseFrameNumber-frameNumber);
} }
std::string _name; std::string _name;

View File

@ -131,7 +131,7 @@ class OSG_EXPORT View : public virtual osg::Object
bool removeSlave(unsigned int pos); bool removeSlave(unsigned int pos);
unsigned int getNumSlaves() const { return _slaves.size(); } unsigned int getNumSlaves() const { return static_cast<unsigned int>(_slaves.size()); }
Slave& getSlave(unsigned int pos) { return _slaves[pos]; } Slave& getSlave(unsigned int pos) { return _slaves[pos]; }
const Slave& getSlave(unsigned int pos) const { return _slaves[pos]; } const Slave& getSlave(unsigned int pos) const { return _slaves[pos]; }

View File

@ -180,8 +180,6 @@ class OSGVOLUME_EXPORT ScalarProperty : public Property
{ {
public: public:
ScalarProperty();
ScalarProperty(const std::string& scaleName, float value); ScalarProperty(const std::string& scaleName, float value);
ScalarProperty(const ScalarProperty& scalarProperty,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY); ScalarProperty(const ScalarProperty& scalarProperty,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
@ -206,6 +204,8 @@ class OSGVOLUME_EXPORT ScalarProperty : public Property
virtual ~ScalarProperty() {} virtual ~ScalarProperty() {}
ScalarProperty();
osg::ref_ptr<osg::Uniform> _uniform; osg::ref_ptr<osg::Uniform> _uniform;
}; };