Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Laurens Voerman
2016-06-08 16:16:48 +02:00
164 changed files with 550 additions and 426 deletions

View File

@@ -957,7 +957,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
SET(OSG_AGGRESSIVE_WARNING_FLAGS -Wall -Wparentheses -Wno-long-long -Wno-import -pedantic -Wreturn-type -Wmissing-braces -Wunknown-pragmas -Wunused)
IF(${CMAKE_MAJOR_VERSION} GREATER 2 AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9)
SET(OSG_AGGRESSIVE_WARNING_FLAGS ${OSG_AGGRESSIVE_WARNING_FLAGS} -Wshadow)
SET(OSG_AGGRESSIVE_WARNING_FLAGS ${OSG_AGGRESSIVE_WARNING_FLAGS} -Wshadow -Wmaybe-uninitialized -Wextra)
ENDIF()
# Previous included -Wformat=2 in OSG_AGGRESSIVE_WARNING_FLAGS but had to remove it due to standard library errors

View File

@@ -141,7 +141,7 @@ class CameraPacket {
void writeEventQueue(osgViewer::Viewer& viewer);
void setMasterKilled(const bool flag) { _masterKilled = flag; }
const bool getMasterKilled() const { return _masterKilled; }
bool getMasterKilled() const { return _masterKilled; }
unsigned int _byte_order;
bool _masterKilled;

View File

@@ -86,7 +86,7 @@ bool SpellChecker::isCorrect(const std::string& word) const
return true;
}
SpellChecker::WordList SpellChecker::suggest(const std::string& word) const
SpellChecker::WordList SpellChecker::suggest(const std::string& /*word*/) const
{
return WordList();
}

View File

@@ -137,7 +137,7 @@ class ForwardToDeviceEventHandler : public osgGA::GUIEventHandler {
public:
ForwardToDeviceEventHandler(osgGA::Device* device, bool format_mouse_events) : osgGA::GUIEventHandler(), _device(device), _forwardMouseEvents(format_mouse_events) {}
virtual bool handle (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa, osg::Object *, osg::NodeVisitor *)
virtual bool handle (const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& /*aa*/, osg::Object *, osg::NodeVisitor *)
{
switch (ea.getEventType())
{
@@ -180,7 +180,7 @@ class DumpEventHandler : public osgGA::GUIEventHandler {
public:
DumpEventHandler() : osgGA::GUIEventHandler() {}
virtual bool handle (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa, osg::Object *, osg::NodeVisitor *)
virtual bool handle (const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& /*aa*/, osg::Object *, osg::NodeVisitor *)
{
switch (ea.getEventType())
{

View File

@@ -142,7 +142,7 @@ enum Channel
class ShaderStorageBufferCallback : public osg::StateAttributeCallback
{
public:
void operator() (osg::StateAttribute* attr, osg::NodeVisitor* nv)
void operator() (osg::StateAttribute* /*attr*/, osg::NodeVisitor* /*nv*/)
{
//if you need to process the data in your app-code , better leaving it on GPU and processing there, uploading per frame will make it slow
#if 0

View File

@@ -552,7 +552,7 @@ public:
{
}
virtual void operator () (osg::Object* object)
virtual void operator () (osg::Object* /*object*/)
{
osg::notify(osg::NOTICE)<<"LoadAndCompileOperation "<<_filename<<std::endl;
@@ -596,7 +596,7 @@ public:
osg::notify(osg::NOTICE)<<"done LoadAndCompileOperation "<<_filename<<std::endl;
}
virtual bool compileCompleted(osgUtil::IncrementalCompileOperation::CompileSet* compileSet)
virtual bool compileCompleted(osgUtil::IncrementalCompileOperation::CompileSet* /*compileSet*/)
{
OSG_NOTICE<<"compileCompleted"<<std::endl;
_modelReadyToMerge = true;
@@ -614,7 +614,7 @@ public:
class TexturePoolHandler : public osgGA::GUIEventHandler
{
public:
virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa)
virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& /*aa*/)
{
if (ea.getEventType() == osgGA::GUIEventAdapter::KEYUP)
{

View File

@@ -317,7 +317,8 @@ public:
}
};
int main(int argc, char** argv) {
int main(int, char**)
{
osgViewer::Viewer viewer;
osgWidget::WindowManager* wm = new osgWidget::WindowManager(

View File

@@ -1,14 +1,14 @@
/* -*-c++-*-
/* -*-c++-*-
* Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net>
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*
* Authors:
@@ -33,7 +33,7 @@
public:
META_Object(osgAnimation, AnimtkUpdateCallback);
AnimtkUpdateCallback()
AnimtkUpdateCallback()
{
_sampler = new osgAnimation::Vec3CubicBezierSampler;
_playing = false;
@@ -41,6 +41,7 @@
}
AnimtkUpdateCallback(const AnimtkUpdateCallback& val, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY):
osg::Object(val, copyop),
osg::Callback(val, copyop),
osg::NodeCallback(val, copyop),
_sampler(val._sampler),
_startTime(val._startTime),
@@ -52,16 +53,16 @@
/** Callback method called by the NodeVisitor when visiting a node.*/
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
{
if (nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR &&
nv->getFrameStamp() &&
nv->getFrameStamp()->getFrameNumber() != _lastUpdate)
{
if (nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR &&
nv->getFrameStamp() &&
nv->getFrameStamp()->getFrameNumber() != _lastUpdate)
{
_lastUpdate = nv->getFrameStamp()->getFrameNumber();
_currentTime = osg::Timer::instance()->tick();
if (_playing && _sampler.get() && _sampler->getKeyframeContainer())
if (_playing && _sampler.get() && _sampler->getKeyframeContainer())
{
osg::MatrixTransform* transform = dynamic_cast<osg::MatrixTransform*>(node);
if (transform) {
@@ -97,7 +98,7 @@ class AnimtkStateSetUpdateCallback : public osg::StateSet::Callback
public:
META_Object(osgAnimation, AnimtkStateSetUpdateCallback);
AnimtkStateSetUpdateCallback()
AnimtkStateSetUpdateCallback()
{
_sampler = new osgAnimation::Vec4LinearSampler;
_playing = false;
@@ -106,6 +107,7 @@ public:
AnimtkStateSetUpdateCallback(const AnimtkStateSetUpdateCallback& val, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY):
osg::Object(val, copyop),
osg::Callback(val, copyop),
osg::StateSet::Callback(val, copyop),
_sampler(val._sampler),
_startTime(val._startTime),
@@ -117,19 +119,19 @@ public:
/** Callback method called by the NodeVisitor when visiting a node.*/
virtual void operator()(osg::StateSet* state, osg::NodeVisitor* nv)
{
if (state &&
nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR &&
nv->getFrameStamp() &&
{
if (state &&
nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR &&
nv->getFrameStamp() &&
nv->getFrameStamp()->getFrameNumber() != _lastUpdate) {
_lastUpdate = nv->getFrameStamp()->getFrameNumber();
_currentTime = osg::Timer::instance()->tick();
if (_playing && _sampler.get() && _sampler->getKeyframeContainer())
if (_playing && _sampler.get() && _sampler->getKeyframeContainer())
{
osg::Material* material = dynamic_cast<osg::Material*>(state->getAttribute(osg::StateAttribute::MATERIAL));
if (material)
if (material)
{
osg::Vec4 result;
float t = osg::Timer::instance()->delta_s(_startTime, _currentTime);
@@ -155,7 +157,7 @@ public:
// This won't really give good results in any situation, but it does demonstrate
// on possible "fast" usage...
class MakePathTimeCallback: public AnimtkUpdateCallback
class MakePathTimeCallback: public AnimtkUpdateCallback
{
osg::ref_ptr<osg::Geode> _geode;
float _lastAdd;
@@ -168,11 +170,11 @@ public:
_addSeconds(0.08f) {
}
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
{
float t = osg::Timer::instance()->delta_s(_startTime, _currentTime);
if(_lastAdd + _addSeconds <= t && t <= 8.0f)
if(_lastAdd + _addSeconds <= t && t <= 8.0f)
{
osg::Vec3 pos;
@@ -190,7 +192,7 @@ public:
// This will give great results if you DO NOT have VSYNC enabled and can generate
// decent FPS.
class MakePathDistanceCallback: public AnimtkUpdateCallback
class MakePathDistanceCallback: public AnimtkUpdateCallback
{
osg::ref_ptr<osg::Geode> _geode;
osg::Vec3 _lastAdd;
@@ -203,7 +205,7 @@ public:
_threshold(0.5f),
_count(0) {}
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
{
static bool countReported = false;
@@ -215,13 +217,13 @@ public:
osg::Vec3 distance = _lastAdd - pos;
if(t <= 8.0f && distance.length() >= _threshold)
if(t <= 8.0f && distance.length() >= _threshold)
{
_geode->addDrawable(new osg::ShapeDrawable(new osg::Sphere(pos, 0.25f)));
_lastAdd = pos;
_count++;
}
else if(t > 8.0f)
else if(t > 8.0f)
{
if(!countReported) std::cout << "Created " << _count << " nodes." << std::endl;
countReported = true;
@@ -231,13 +233,13 @@ public:
}
};
osg::StateSet* setupStateSet()
osg::StateSet* setupStateSet()
{
osg::StateSet* st = new osg::StateSet();
st->setAttributeAndModes(new osg::Material(), true);
st->setMode(GL_BLEND, true);
AnimtkStateSetUpdateCallback* callback = new AnimtkStateSetUpdateCallback();
osgAnimation::Vec4KeyframeContainer* keys = callback->_sampler->getOrCreateKeyframeContainer();
keys->push_back(osgAnimation::Vec4Keyframe(0, osg::Vec4(1,0,0,1)));
@@ -248,11 +250,11 @@ osg::StateSet* setupStateSet()
keys->push_back(osgAnimation::Vec4Keyframe(10, osg::Vec4(1,0,0,1)));
callback->start();
st->setUpdateCallback(callback);
return st;
}
osg::MatrixTransform* setupAnimtkNode(osg::Geode* staticGeode)
osg::MatrixTransform* setupAnimtkNode(osg::Geode* staticGeode)
{
osg::Vec3 v[5];
@@ -300,20 +302,20 @@ osg::MatrixTransform* setupAnimtkNode(osg::Geode* staticGeode)
node->setUpdateCallback(callback);
osg::Geode* geode = new osg::Geode();
geode->setStateSet(setupStateSet());
geode->addDrawable(new osg::ShapeDrawable(new osg::Sphere(osg::Vec3(0.0f, 0.0f, 0.0f), 2)));
node->addChild(geode);
return node;
}
int main(int argc, char** argv)
int main(int argc, char** argv)
{
osg::ArgumentParser arguments(&argc, argv);
osgViewer::Viewer viewer(arguments);
osgGA::TrackballManipulator* tbm = new osgGA::TrackballManipulator();
viewer.setCameraManipulator(tbm);

View File

@@ -35,6 +35,7 @@ public:
}
AnimtkUpdateCallback(const AnimtkUpdateCallback& val, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY):
osg::Object(val, copyop),
osg::Callback(val, copyop),
osg::NodeCallback(val, copyop),
_sampler(val._sampler),
_startTime(val._startTime),
@@ -98,6 +99,7 @@ public:
AnimtkStateSetUpdateCallback(const AnimtkStateSetUpdateCallback& val, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY):
osg::Object(val, copyop),
osg::Callback(val, copyop),
osg::StateSet::Callback(val, copyop),
_sampler(val._sampler),
_startTime(val._startTime),

View File

@@ -38,7 +38,7 @@
struct NoseBegin : public osgAnimation::Action::Callback
{
virtual void operator()(osgAnimation::Action* action, osgAnimation::ActionVisitor* nv)
virtual void operator()(osgAnimation::Action* action, osgAnimation::ActionVisitor* /*nv*/)
{
std::cout << "sacrebleu, it scratches my nose, let me scratch it" << std::endl;
std::cout << "process NoseBegin call back " << action->getName() << std::endl << std::endl;
@@ -47,7 +47,7 @@ struct NoseBegin : public osgAnimation::Action::Callback
struct NoseEnd : public osgAnimation::Action::Callback
{
virtual void operator()(osgAnimation::Action* action, osgAnimation::ActionVisitor* nv)
virtual void operator()(osgAnimation::Action* action, osgAnimation::ActionVisitor* /*nv*/)
{
std::cout << "shhhrt shrrrrt shhhhhhrrrrt, haaa it's better"<< std::endl;
std::cout << "process NoseEnd call back " << action->getName() << std::endl << std::endl;

View File

@@ -162,7 +162,7 @@ struct TestDrawableUpdateCallback : public osg::DrawableUpdateCallback
{
TestDrawableUpdateCallback(const std::string &message): _message(message) {}
virtual void update(osg::NodeVisitor*, osg::Drawable* drw) {
virtual void update(osg::NodeVisitor*, osg::Drawable* /*drw*/) {
printf("%s\n", _message.c_str());
}
std::string _message;
@@ -172,7 +172,7 @@ struct TestNodeUpdateCallback : public osg::NodeCallback
{
TestNodeUpdateCallback(const std::string &message): _message(message) {}
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) {
virtual void operator()(osg::Node* /*node*/, osg::NodeVisitor* /*nv*/) {
printf("%s\n", _message.c_str());
}
std::string _message;

View File

@@ -74,7 +74,7 @@ class CameraPacket {
void writeEventQueue(osgViewer::Viewer& viewer);
void setMasterKilled(const bool flag) { _masterKilled = flag; }
const bool getMasterKilled() const { return _masterKilled; }
bool getMasterKilled() const { return _masterKilled; }
unsigned int _byte_order;
bool _masterKilled;

View File

@@ -106,7 +106,7 @@ public:
{
}
virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa, osg::Object* object, osg::NodeVisitor* nv)
virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& /*aa*/, osg::Object* object, osg::NodeVisitor* nv)
{
osg::Camera* camera = dynamic_cast<osg::Camera*>(object);
if (!camera) return false;

View File

@@ -1,14 +1,14 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2014 Robert Osfield
* Copyright (C) 2014 Pawel Ksiezopolski
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*
*/
@@ -25,14 +25,14 @@
// with data matching users needs
struct ConvertTrianglesOperator : public osg::Referenced
{
ConvertTrianglesOperator()
ConvertTrianglesOperator()
: osg::Referenced()
{
}
virtual void initGeometry( osg::Geometry* outputGeometry ) = 0;
virtual bool pushNode( osg::Node* node )
{
return false;
virtual bool pushNode( osg::Node* /*node*/ )
{
return false;
}
virtual void popNode() = 0;
virtual void setGeometryData( const osg::Matrix &matrix, osg::Geometry *inputGeometry, osg::Geometry* outputGeometry, float typeID, float lodNumber ) = 0;
@@ -47,7 +47,7 @@ public:
}
void apply( GLfloat& value )
{
out = osg::Vec2( value, 0.0 );
out = osg::Vec2( value, 0.0 );
}
void apply( osg::Vec2& value )
{
@@ -83,7 +83,7 @@ public:
// texCoord1 holds additional information about vertex ( typeID, lodNumber, boneIndex )
struct ConvertTrianglesOperatorClassic : public ConvertTrianglesOperator
{
ConvertTrianglesOperatorClassic()
ConvertTrianglesOperatorClassic()
: ConvertTrianglesOperator(), _typeID(0.0f), _lodNumber(0.0f)
{
@@ -113,18 +113,18 @@ struct ConvertTrianglesOperatorClassic : public ConvertTrianglesOperator
virtual void setGeometryData( const osg::Matrix &matrix, osg::Geometry *inputGeometry, osg::Geometry* outputGeometry, float typeID, float lodNumber )
{
_matrix = matrix;
_inputVertices = dynamic_cast<osg::Vec3Array *>( inputGeometry->getVertexArray() );
_inputColors = dynamic_cast<osg::Vec4Array *>( inputGeometry->getColorArray() );
_inputNormals = dynamic_cast<osg::Vec3Array *>( inputGeometry->getNormalArray() );
_inputTexCoord0 = inputGeometry->getTexCoordArray(0);
_outputVertices = dynamic_cast<osg::Vec3Array *>( outputGeometry->getVertexArray() );
_outputColors = dynamic_cast<osg::Vec4Array *>( outputGeometry->getColorArray() );
_outputNormals = dynamic_cast<osg::Vec3Array *>( outputGeometry->getNormalArray() );
_outputTexCoord0 = dynamic_cast<osg::Vec2Array *>( outputGeometry->getTexCoordArray(0) );
_outputTexCoord1 = dynamic_cast<osg::Vec3Array *>( outputGeometry->getTexCoordArray(1) );
_typeID = typeID;
_lodNumber = lodNumber;
}
@@ -147,7 +147,7 @@ struct ConvertTrianglesOperatorClassic : public ConvertTrianglesOperator
_outputVertices->push_back( _inputVertices->at( i1 ) * _matrix );
_outputVertices->push_back( _inputVertices->at( i2 ) * _matrix );
_outputVertices->push_back( _inputVertices->at( i3 ) * _matrix );
if( _inputColors != NULL )
{
_outputColors->push_back( _inputColors->at( ic1 ) );
@@ -159,7 +159,7 @@ struct ConvertTrianglesOperatorClassic : public ConvertTrianglesOperator
for(unsigned int i=0; i<3; ++i)
_outputColors->push_back( osg::Vec4(1.0,1.0,1.0,1.0) );
}
if( _inputNormals != NULL )
{
_outputNormals->push_back( osg::Matrix::transform3x3( _inputNormals->at( in1 ), _matrix ) );
@@ -185,7 +185,7 @@ struct ConvertTrianglesOperatorClassic : public ConvertTrianglesOperator
for(unsigned int i=0; i<3; ++i)
_outputTexCoord0->push_back( osg::Vec2(0.0,0.0) );
}
for(unsigned int i=0; i<3; ++i)
_outputTexCoord1->push_back( osg::Vec3( _typeID, _lodNumber, _boneIndices.back() ) );
}
@@ -195,24 +195,24 @@ struct ConvertTrianglesOperatorClassic : public ConvertTrianglesOperator
}
osg::Matrix _matrix;
osg::Vec3Array* _inputVertices;
osg::Vec4Array* _inputColors;
osg::Vec3Array* _inputNormals;
osg::Array* _inputTexCoord0;
osg::Vec3Array* _outputVertices;
osg::Vec4Array* _outputColors;
osg::Vec3Array* _outputNormals;
osg::Vec2Array* _outputTexCoord0;
osg::Vec3Array* _outputTexCoord1;
float _typeID;
float _lodNumber;
std::vector<float> _boneIndices;
std::map<std::string,float> _boneNames;
GetVec2FromArrayVisitor _inputTexCoord0Visitor;
};
@@ -220,10 +220,10 @@ struct ConvertTrianglesOperatorClassic : public ConvertTrianglesOperator
class AggregateGeometryVisitor : public osg::NodeVisitor
{
public:
public:
AggregateGeometryVisitor( ConvertTrianglesOperator* ctOperator );
void init();
// osg::TriangleIndexFunctor uses its template parameter as a base class, so we must use an adapter pattern to hack it
struct ConvertTrianglesBridge
{
@@ -251,10 +251,10 @@ public:
{
_converter->operator()(i1,i2,i3);
}
osg::ref_ptr<ConvertTrianglesOperator> _converter;
};
// struct returning information about added object ( first vertex, vertex count, primitiveset index )
// used later to create indirect command texture buffers
@@ -269,11 +269,11 @@ public:
unsigned int index;
};
AddObjectResult addObject( osg::Node* object, unsigned int typeID, unsigned int lodNumber );
void apply( osg::Node& node );
void apply( osg::Transform& transform );
void apply( osg::Geode& geode );
inline osg::Geometry* getAggregatedGeometry()
{
return _aggregatedGeometry.get();
@@ -282,7 +282,7 @@ protected:
osg::ref_ptr<osg::Geometry> _aggregatedGeometry;
osg::TriangleIndexFunctor<ConvertTrianglesBridge> _ctOperator;
std::vector<osg::Matrix> _matrixStack;
unsigned int _currentTypeID;
unsigned int _currentLodNumber;
};

View File

@@ -1,14 +1,14 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2014 Robert Osfield
* Copyright (C) 2014 Pawel Ksiezopolski
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*
*/
@@ -19,32 +19,32 @@
#include <osg/GLExtensions>
#include <osg/Drawable>
void DrawArraysIndirect::draw(osg::State& state, bool useVertexBufferObjects) const
void DrawArraysIndirect::draw(osg::State& state, bool /*useVertexBufferObjects*/) const
{
if( !_buffer.valid() )
return;
_buffer->bindBufferAs( state.getContextID(), GL_DRAW_INDIRECT_BUFFER );
// if you want to see how many primitives were rendered - uncomment code below, but
// if you want to see how many primitives were rendered - uncomment code below, but
// be warned : it is a serious performance killer ( because of GPU->CPU roundtrip )
// osg::Drawable::Extensions *dext = osg::Drawable::getExtensions( state.getContextID(),true );
// int* tab = (int*)dext->glMapBuffer(GL_DRAW_INDIRECT_BUFFER,GL_READ_ONLY);
// int val = _indirect/sizeof(int);
// OSG_WARN<<"DrawArraysIndirect ("<<val<<"): "<< tab[val] << " " << tab[val+1] << " " << tab[val+2] << " " << tab[val+3] << std::endl;
// dext->glUnmapBuffer(GL_DRAW_INDIRECT_BUFFER);
DrawIndirectGLExtensions *ext = DrawIndirectGLExtensions::getExtensions( state.getContextID(),true );
ext->glDrawArraysIndirect( _mode, reinterpret_cast<const void*>(_indirect) );
_buffer->unbindBufferAs( state.getContextID(), GL_DRAW_INDIRECT_BUFFER );
}
void MultiDrawArraysIndirect::draw(osg::State& state, bool useVertexBufferObjects) const
void MultiDrawArraysIndirect::draw(osg::State& state, bool /*useVertexBufferObjects*/) const
{
if( !_buffer.valid() )
return;
_buffer->bindBufferAs( state.getContextID(), GL_DRAW_INDIRECT_BUFFER );
DrawIndirectGLExtensions *ext = DrawIndirectGLExtensions::getExtensions( state.getContextID(),true );
ext->glMultiDrawArraysIndirect( _mode, reinterpret_cast<const void*>(_indirect), _drawcount, _stride );
_buffer->unbindBufferAs( state.getContextID(), GL_DRAW_INDIRECT_BUFFER );
@@ -80,7 +80,7 @@ void DrawIndirectGLExtensions::lowestCommonDenominator( const DrawIndirectGLExte
}
}
void DrawIndirectGLExtensions::setupGLExtensions( unsigned int contextID )
void DrawIndirectGLExtensions::setupGLExtensions( unsigned int /*contextID*/ )
{
_glDrawArraysIndirect = 0;
_glMultiDrawArraysIndirect = 0;
@@ -110,7 +110,7 @@ void DrawIndirectGLExtensions::glMultiDrawArraysIndirect(GLenum mode, const void
else
{
OSG_WARN<<"Error: glMultiDrawArraysIndirect not supported by OpenGL driver"<<std::endl;
}
}
}
void DrawIndirectGLExtensions::glMemoryBarrier(GLbitfield barriers)

View File

@@ -38,7 +38,7 @@ public:
{
}
virtual osg::Object* cloneType() const { return new DrawArraysIndirect(); }
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return NULL; }
virtual osg::Object* clone(const osg::CopyOp& /*copyop*/) const { return NULL; }
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const DrawArraysIndirect*>(obj)!=NULL; }
virtual const char* libraryName() const { return "osg"; }
virtual const char* className() const { return "DrawArraysIndirect"; }
@@ -57,7 +57,7 @@ public:
{
}
virtual osg::Object* cloneType() const { return new MultiDrawArraysIndirect(); }
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return NULL; }
virtual osg::Object* clone(const osg::CopyOp& /*copyop*/) const { return NULL; }
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const MultiDrawArraysIndirect*>(obj)!=NULL; }
virtual const char* libraryName() const { return "osg"; }
virtual const char* className() const { return "MultiDrawArraysIndirect"; }

View File

@@ -692,7 +692,7 @@ struct ResetTexturesCallback : public osg::StateSet::Callback
texUnitsDirtyParams.push_back(texUnit);
}
virtual void operator() (osg::StateSet* stateset, osg::NodeVisitor* nv)
virtual void operator() (osg::StateSet* stateset, osg::NodeVisitor* /*nv*/)
{
std::vector<unsigned int>::iterator it,eit;
for(it=texUnitsDirty.begin(), eit=texUnitsDirty.end(); it!=eit; ++it)

View File

@@ -42,7 +42,8 @@ class TrackSegment : public osg::Object
public:
TrackSegment() {}
TrackSegment(const TrackSegment& ts, const osg::CopyOp=osg::CopyOp::SHALLOW_COPY) {}
TrackSegment(const TrackSegment& ts, const osg::CopyOp copyop=osg::CopyOp::SHALLOW_COPY):
osg::Object(ts, copyop) {}
META_Object(osg, TrackSegment)
@@ -78,7 +79,8 @@ class Track : public osg::Object
public:
Track() {}
Track(const Track& track, const osg::CopyOp=osg::CopyOp::SHALLOW_COPY) {}
Track(const Track& track, const osg::CopyOp copyop=osg::CopyOp::SHALLOW_COPY):
osg::Object(track, copyop) {}
META_Object(osg, Track)

View File

@@ -330,7 +330,7 @@ void MovieEventHandler::set(osg::Node* node)
}
bool MovieEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa, osg::Object*, osg::NodeVisitor* nv)
bool MovieEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter&, osg::Object*, osg::NodeVisitor*)
{
switch(ea.getEventType())
{

View File

@@ -701,8 +701,8 @@ void SDLAudioSink::play()
SDL_AudioSpec specs = { 0 };
SDL_AudioSpec wanted_specs = { 0 };
SDL_AudioSpec specs;
SDL_AudioSpec wanted_specs;
wanted_specs.freq = _audioStream->audioFrequency();
wanted_specs.channels = _audioStream->audioNbChannels();

View File

@@ -141,7 +141,7 @@ protected:
};
bool MovieEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa, osg::Object*, osg::NodeVisitor* nv)
bool MovieEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa, osg::Object*, osg::NodeVisitor* /*nv*/)
{
switch(ea.getEventType())
{
@@ -490,7 +490,7 @@ public:
loadSlide(_currentFile);
}
bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa, osg::Object*, osg::NodeVisitor* nv)
bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& /*aa*/, osg::Object*, osg::NodeVisitor* /*nv*/)
{
switch(ea.getEventType())
{

View File

@@ -188,7 +188,7 @@ public:
TerrainHandler(osgTerrain::Terrain* terrain):
_terrain(terrain) {}
bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa)
bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& /*aa*/)
{
switch(ea.getEventType())
{

View File

@@ -285,7 +285,7 @@ OcclusionQueryVisitor::getOccluderThreshold() const
}
void
OcclusionQueryVisitor::apply( osg::OcclusionQueryNode& oqn )
OcclusionQueryVisitor::apply( osg::OcclusionQueryNode& /*oqn*/ )
{
// A subgraph is already under osgOQ control.
// Don't traverse further.

View File

@@ -198,7 +198,7 @@ private:
std::ostringstream _ss;
};
bool UserEventHandler::handle(osgGA::Event* event, osg::Object* object, osg::NodeVisitor* nv)
bool UserEventHandler::handle(osgGA::Event* event, osg::Object* /*object*/, osg::NodeVisitor* nv)
{
OSG_ALWAYS << "handle user-event: " << event->getName() << std::endl;
@@ -347,7 +347,7 @@ class ForwardToDeviceEventHandler : public osgGA::EventHandler {
public:
ForwardToDeviceEventHandler(osgGA::Device* device) : osgGA::EventHandler(), _device(device) {}
virtual bool handle(osgGA::Event* event, osg::Object* object, osg::NodeVisitor* nv)
virtual bool handle(osgGA::Event* event, osg::Object* /*object*/, osg::NodeVisitor* /*nv*/)
{
_device->sendEvent(*event);
return false;

View File

@@ -321,7 +321,7 @@ void PosterPrinter::frame( const osg::FrameStamp* fs, osg::Node* node )
}
}
bool PosterPrinter::addCullCallbacks( const osg::FrameStamp* fs, osg::Node* node )
bool PosterPrinter::addCullCallbacks( const osg::FrameStamp* fs, osg::Node* /*node*/ )
{
if ( !_visitor->inQueue() || done() )
return false;
@@ -335,7 +335,7 @@ bool PosterPrinter::addCullCallbacks( const osg::FrameStamp* fs, osg::Node* node
return true;
}
void PosterPrinter::removeCullCallbacks( osg::Node* node )
void PosterPrinter::removeCullCallbacks( osg::Node* /*node*/ )
{
_visitor->setAddingCallbacks( false );
_camera->accept( *_visitor );

View File

@@ -72,7 +72,7 @@ public:
}
/** Deprecated, Handle events, return true if handled, false otherwise. */
virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa)
virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& /*aa*/)
{
if (ea.getEventType() == osgGA::GUIEventAdapter::KEYUP)
{
@@ -122,7 +122,7 @@ public:
void set( bool value ) { _value = value; }
/** Deprecated, Handle events, return true if handled, false otherwise. */
virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa)
virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& /*aa*/)
{
if (ea.getEventType() == osgGA::GUIEventAdapter::KEYUP)
{
@@ -149,7 +149,7 @@ public:
bool getAnimating() const { return _animating; }
/** Deprecated, Handle events, return true if handled, false otherwise. */
virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa)
virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& /*aa*/)
{
if (ea.getEventType() == osgGA::GUIEventAdapter::KEYUP)
{
@@ -622,7 +622,7 @@ namespace ModelFive
return apcb.release();
}
osg::Group* createModel(osg::ArgumentParser& arguments)
osg::Group* createModel(osg::ArgumentParser& /*arguments*/)
{
// Set the ground (only receives shadow)
osg::ref_ptr<osg::MatrixTransform> groundNode = new osg::MatrixTransform;

View File

@@ -52,7 +52,7 @@ public:
}
/** Copy ctor. */
MyArray(const MyArray& other, const osg::CopyOp& copyop) :
MyArray(const MyArray& other, const osg::CopyOp& /*copyop*/) :
osg::Array(osg::Array::Vec3ArrayType,3,GL_FLOAT),
_numElements(other._numElements),
_ptr(other._ptr) {
@@ -125,8 +125,8 @@ public:
return _numElements * sizeof(osg::Vec3);
}
virtual void reserveArray(unsigned int num) { OSG_NOTICE<<"reserveArray() not supported"<<std::endl; }
virtual void resizeArray(unsigned int num) { OSG_NOTICE<<"resizeArray() not supported"<<std::endl; }
virtual void reserveArray(unsigned int /*num*/) { OSG_NOTICE<<"reserveArray() not supported"<<std::endl; }
virtual void resizeArray(unsigned int /*num*/) { OSG_NOTICE<<"resizeArray() not supported"<<std::endl; }
private:
unsigned int _numElements;

View File

@@ -49,7 +49,12 @@ public:
{
}
SwitchDOFVisitor(const SwitchDOFVisitor& sdfv, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY) {}
SwitchDOFVisitor(const SwitchDOFVisitor& sdfv, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
osg::Object(sdfv, copyop),
osg::Callback(sdfv, copyop),
osg::NodeVisitor(sdfv, copyop),
osgGA::GUIEventHandler(sdfv, copyop)
{}
META_Object(osg, SwitchDOFVisitor)

View File

@@ -160,7 +160,7 @@ class RotateUpdateCallback : public osg::NodeCallback
{
public:
RotateUpdateCallback() { i=0;}
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
virtual void operator()(osg::Node* node, osg::NodeVisitor* /*nv*/)
{
osgSim::SphereSegment * ss = dynamic_cast<osgSim::SphereSegment *>(node);
if (ss)

View File

@@ -85,7 +85,7 @@ public:
_terrain(terrain),
_mtc(mtc) {}
bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa)
bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& /*aa*/)
{
switch(ea.getEventType())
{

View File

@@ -120,7 +120,7 @@ static const char* fragSource = {
"}\n"
};
osg::ref_ptr<osg::Geode> CreateIcosahedron(osg::Program *program)
osg::ref_ptr<osg::Geode> CreateIcosahedron(osg::Program* /*program*/)
{
osg::Geode *geode=new osg::Geode();
osg::Geometry *geometry = new osg::Geometry();
@@ -264,7 +264,7 @@ private:
}
};
int main(int argc, char* argv[])
int main(int, char* [])
{
osgViewer::Viewer viewer;
viewer.setUpViewInWindow(100,100,800,600);

View File

@@ -25,7 +25,7 @@ osg::Group* test_create3DText(const osg::Vec3& center,float radius)
float characterSize=radius*0.2f;
float characterDepth=characterSize*0.2f;
osg::Vec3 pos(center.x()-radius*.5f,center.y()-radius*.5f,center.z()-radius*.5f);
#define SHOW_INTESECTION_CEASH
#ifdef SHOW_INTESECTION_CEASH
@@ -72,22 +72,22 @@ osg::Group* test_create3DText(const osg::Vec3& center,float radius)
stateset->setAttributeAndModes(polymode,osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON);
rootNode->setStateSet(stateset);
#endif
return rootNode;
return rootNode;
}
//////////////////////////////////////////////////////////////////////////
#include <osg/PositionAttitudeTransform>
#include <osg/ShapeDrawable>
class CInputHandler : public osgGA::GUIEventHandler
class CInputHandler : public osgGA::GUIEventHandler
{
public:
CInputHandler( osg::PositionAttitudeTransform* pPatSphere )
{
m_rPatSphere = pPatSphere;
}
virtual bool handle( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa, osg::Object* pObject, osg::NodeVisitor* pNodeVisitor )
virtual bool handle( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa, osg::Object* /*pObject*/, osg::NodeVisitor* /*pNodeVisitor*/ )
{
osgViewer::Viewer* pViewer = dynamic_cast<osgViewer::Viewer*>(&aa);
if ( !pViewer )

View File

@@ -30,7 +30,7 @@
// Creates a stateset which contains a 1D texture which is populated by contour banded color,
// and allows tex gen to override the S texture coordinate
osg::StateSet* create1DTextureStateToDecorate(osg::Node* loadedModel)
osg::StateSet* create1DTextureStateToDecorate(osg::Node* /*loadedModel*/)
{
osg::Image* image = new osg::Image;

View File

@@ -42,8 +42,8 @@ typedef std::vector< osg::ref_ptr<osg::Image> > ImageList;
class SubloadCallback : public osg::Texture2DArray::SubloadCallback
{
public:
virtual void load(const osg::Texture2DArray& texture, osg::State& state) const { }
virtual void subload(const osg::Texture2DArray& texture, osg::State& state) const { }
virtual void load(const osg::Texture2DArray& /*texture*/, osg::State& /*state*/) const { }
virtual void subload(const osg::Texture2DArray& /*texture*/, osg::State& /*state*/) const { }
};

View File

@@ -87,7 +87,7 @@ public:
_incrementalCompileOperation(ico),
_block(block) {}
virtual void operator () (osg::Object* object)
virtual void operator () (osg::Object* /*object*/)
{
// osg::notify(osg::NOTICE)<<"LoadAndCompileOperation "<<_filename<<std::endl;
@@ -481,7 +481,7 @@ public:
FilterHandler(osgTerrain::GeometryTechnique* gt):
_gt(gt) {}
bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& /*aa*/)
{
if (!_gt) return false;
@@ -555,7 +555,7 @@ public:
LayerHandler(osgTerrain::Layer* layer):
_layer(layer) {}
bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& /*aa*/)
{
if (!_layer) return false;

View File

@@ -103,12 +103,12 @@ struct PopulateHistogram
void luminance(float l) { update(l); }
void alpha(float a) { update(a); }
void luminance_alpha(float l, float a) { update(l); }
void rgb(float r, float g, float b) { update(r); }
void rgba(float r, float g, float b, float a) { update(a); }
void luminance_alpha(float l, float /*a*/) { update(l); }
void rgb(float r, float /*g*/, float /*b*/) { update(r); }
void rgba(float /*r*/, float /*g*/, float /*b*/, float a) { update(a); }
};
void Histogram::analyse(const osg::Image* image, double interval)
void Histogram::analyse(const osg::Image* image, double /*interval*/)
{
PopulateHistogram populateHistogram(_valueMap);
readImage(image, populateHistogram);

View File

@@ -1,4 +1,14 @@
SET(TARGET_SRC osguserdata.cpp)
################################################################################
## Quieten warnings that a due to optional code paths
IF(CMAKE_COMPILER_IS_GNUCXX)
# Remove -Wextra flag as it barfs on ffmoeg headers
STRING(REGEX REPLACE "-Wextra" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
ENDIF()
#### end var setup ###
SETUP_EXAMPLE(osguserdata)

View File

@@ -105,7 +105,7 @@ class ConvertToVertexAttibArrays : public osg::NodeVisitor
shader.setShaderSource(source);
}
void convertFragmentShader(osg::Program& program, osg::Shader& shader)
void convertFragmentShader(osg::Program& /*program*/, osg::Shader& /*shader*/)
{
}

View File

@@ -81,7 +81,7 @@ public:
return new osgQt::GraphicsWindowQt(traits.get());
}
virtual void paintEvent( QPaintEvent* event )
virtual void paintEvent( QPaintEvent* /*event*/ )
{ frame(); }
protected:

View File

@@ -312,7 +312,7 @@ public:
errorMessage(),
maximumTextureSize(256) {}
virtual void operator () (osg::GraphicsContext* gc)
virtual void operator () (osg::GraphicsContext* /*gc*/)
{
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(mutex);

View File

@@ -41,13 +41,13 @@ public:
virtual bool mousePush(double, double, const osgWidget::WindowManager*) {
addColor(0.2f, 0.2f, 0.2f, 0.0f);
return true;
}
virtual bool mouseRelease(double, double, const osgWidget::WindowManager*) {
addColor(-0.2f, -0.2f, -0.2f, 0.0f);
return true;
}
};
@@ -86,7 +86,7 @@ public:
wm->addChild(_win1.get());
}
bool handlePressAdd(osgWidget::Event& ev) {
bool handlePressAdd(osgWidget::Event& /*ev*/) {
static unsigned int num = 0;
std::stringstream ss;
@@ -100,10 +100,10 @@ public:
return true;
}
bool handlePressRemove(osgWidget::Event& ev) {
bool handlePressRemove(osgWidget::Event& /*ev*/) {
// TODO: Temporary hack!
const osgWidget::Box::Vector& v = _win1->getObjects();
if(!v.size()) return false;
osgWidget::Widget* w = _win1->getObjects()[v.size() - 1].get();
@@ -114,7 +114,8 @@ public:
}
};
int main(int argc, char** argv) {
int main(int, char**)
{
osgViewer::Viewer viewer;
osgWidget::WindowManager* wm = new osgWidget::WindowManager(
@@ -123,7 +124,7 @@ int main(int argc, char** argv) {
1024.0f,
MASK_2D
);
osgWidget::Box* buttons = new AddRemove();
wm->addChild(buttons);

View File

@@ -49,7 +49,7 @@ struct ColorWidget: public osgWidget::Widget {
return true;
}
bool keyUp(int key, int keyMask, osgWidget::WindowManager*) {
bool keyUp(int /*key*/, int /*keyMask*/, osgWidget::WindowManager*) {
// osgWidget::warn() << "..." << key << " - " << keyMask << std::endl;
return true;
@@ -78,7 +78,8 @@ osgWidget::Box* createBox(const std::string& name, osgWidget::Box::BoxType bt) {
return box;
}
int main(int argc, char** argv) {
int main(int, char**)
{
osgViewer::Viewer viewer;
osgWidget::WindowManager* wm = new osgWidget::WindowManager(

View File

@@ -11,7 +11,7 @@ bool colorWidgetEnter(osgWidget::Event& event) {
event.getWidget()->addColor(0.5f, 0.2f, 0.3f, 0.0f);
// osgWidget::warn() << "WIDGET mouseEnter " << event.getWidget()->getName() << std::endl;
return false;
}
@@ -19,7 +19,7 @@ bool colorWidgetLeave(osgWidget::Event& event) {
event.getWidget()->addColor(-0.5f, -0.2f, -0.3f, 0.0f);
// osgWidget::warn() << "WIDGET mouseLeave" << std::endl;
return true;
}
@@ -52,11 +52,12 @@ osgWidget::Widget* createWidget(
widget->addCallback(new osgWidget::Callback(&widgetMouseOver, osgWidget::EVENT_MOUSE_OVER));
widget->setColor(col, col, col, 0.5f);
widget->setLayer(layer);
return widget;
}
int main(int argc, char** argv) {
int main(int, char**)
{
osgViewer::Viewer viewer;
osgWidget::WindowManager* wm = new osgWidget::WindowManager(
@@ -66,7 +67,7 @@ int main(int argc, char** argv) {
MASK_2D,
osgWidget::WindowManager::WM_PICK_DEBUG
);
osgWidget::Canvas* canvas = new osgWidget::Canvas("canvas");
canvas->addCallback(new osgWidget::Callback(&windowMouseOver, osgWidget::EVENT_MOUSE_OVER));
@@ -79,7 +80,7 @@ int main(int argc, char** argv) {
0.0f,
0.0f
);
canvas->addWidget(
createWidget("w2", 0.4f, osgWidget::Widget::LAYER_MIDDLE),
200.0f,
@@ -103,7 +104,7 @@ int main(int argc, char** argv) {
osgWidget::warn() << canvas->getWidth() << std::endl;
canvas->addWidget(relWidget, 0.4f, 0.4f);
relWidget->addOrigin(0.1f, 0.1f);
relWidget->addSize(0.2f, 0.2f);
@@ -126,7 +127,7 @@ int main(int argc, char** argv) {
MASK_2D,
osgWidget::WindowManager::WM_PICK_DEBUG
);
osgWidget::Canvas* canvas = new osgWidget::Canvas("canvas");
canvas->addWidget(new osgWidget::Widget("spacer", 2.0f, 300.0f), 1280.0f, 0.0f);

View File

@@ -9,7 +9,8 @@
const unsigned int MASK_2D = 0xF0000000;
int main(int argc, char** argv) {
int main(int, char**)
{
osgViewer::Viewer viewer;
osgWidget::WindowManager* wm = new osgWidget::WindowManager(

View File

@@ -11,7 +11,8 @@
const unsigned int MASK_2D = 0xF0000000;
int main(int argc, char** argv) {
int main(int, char**)
{
osgViewer::Viewer viewer;
osgWidget::WindowManager* wm = new osgWidget::WindowManager(
@@ -21,7 +22,7 @@ int main(int argc, char** argv) {
MASK_2D,
osgWidget::WindowManager::WM_PICK_DEBUG
);
osgWidget::Box* box = new osgWidget::Box("vbox", osgWidget::Box::VERTICAL);
osgWidget::Input* input = new osgWidget::Input("input", "", 50);

View File

@@ -16,7 +16,7 @@ const char* LABEL1 =
"nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in..."
;
const char* LABEL2 =
const char* LABEL2 =
"...reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla\n"
"pariatur. Excepteur sint occaecat cupidatat non proident, sunt in \n"
"culpa qui officia deserunt mollit anim id est laborum. BBBBB"
@@ -39,7 +39,8 @@ osgWidget::Label* createLabel(const std::string& l, unsigned int size=13) {
return label;
}
int main(int argc, char** argv) {
int main(int, char**)
{
osgViewer::Viewer viewer;
osgWidget::WindowManager* wm = new osgWidget::WindowManager(
@@ -50,7 +51,7 @@ int main(int argc, char** argv) {
// osgWidget::WindowManager::WM_USE_RENDERBINS |
osgWidget::WindowManager::WM_PICK_DEBUG
);
osgWidget::Box* box = new osgWidget::Box("HBOX", osgWidget::Box::HORIZONTAL);
osgWidget::Box* vbox = new osgWidget::Box("vbox", osgWidget::Box::VERTICAL);
osgWidget::Label* label1 = createLabel(LABEL1);
@@ -86,7 +87,7 @@ int main(int argc, char** argv) {
label3->setColor(0.0f, 0.0f, 0.5f, 0.5f);
label4->setColor(0.0f, 0.0f, 0.5f, 0.5f);
label5->setColor(0.0f, 0.0f, 0.5f, 0.5f);
//label5->setAlignHorizontal(osgWidget::Widget::HA_LEFT);
//label5->setAlignVertical(osgWidget::Widget::VA_BOTTOM);
@@ -111,7 +112,7 @@ int main(int argc, char** argv) {
// Test our label-in-window copy construction...
osgWidget::Box* clonedBox = osg::clone(box, "HBOX-new", osg::CopyOp::DEEP_COPY_ALL);
clonedBox->getBackground()->setColor(0.0f, 1.0f, 0.0f, 0.5f);
wm->addChild(box);

View File

@@ -97,7 +97,8 @@ public:
}
};
int main(int argc, char** argv) {
int main(int, char**)
{
osgViewer::Viewer viewer;
osgWidget::WindowManager* wm = new osgWidget::WindowManager(

View File

@@ -300,9 +300,8 @@ const char* LABEL1 =
"nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in..."
;
int main(int argc, char** argv)
int main(int, char**)
{
osgViewer::Viewer viewer;
osgWidget::WindowManager* wm = new osgWidget::WindowManager(

View File

@@ -104,7 +104,7 @@ public:
label->addSize(20.0f, 20.0f);
label->setShadow(0.08f);
label->setCanFill(true);
addWidget(label);
addWidget(_tabs->embed());
addWidget(_windows->embed());
@@ -117,7 +117,8 @@ void bound(osg::Node* node) {
osgWidget::warn() << "center: " << bs.center() << " radius: " << bs.radius() << std::endl;
}
int main(int argc, char** argv) {
int main(int, char**)
{
osgViewer::Viewer viewer;
osgWidget::WindowManager* wm = new osgWidget::WindowManager(

View File

@@ -77,7 +77,8 @@ bool changeTheme(osgWidget::Event& ev) {
return true;
}
int main(int argc, char** argv) {
int main(int, char**)
{
osgViewer::Viewer viewer;
osgWidget::WindowManager* wm = new osgWidget::WindowManager(

View File

@@ -21,7 +21,8 @@ osgWidget::Widget* createWidget(
return widget;
}
int main(int argc, char** argv) {
int main(int, char**)
{
osgViewer::Viewer viewer;
osgWidget::WindowManager* wm = new osgWidget::WindowManager(
@@ -30,7 +31,7 @@ int main(int argc, char** argv) {
1024.0f,
MASK_2D
);
osgWidget::Canvas* canvas = new osgWidget::Canvas("canvas");
canvas->attachMoveCallback();
@@ -41,7 +42,7 @@ int main(int argc, char** argv) {
0.0f,
0.0f
);
canvas->addWidget(
createWidget("w2", 0.4f, osgWidget::Widget::LAYER_MIDDLE),
200.0f,
@@ -63,7 +64,7 @@ int main(int argc, char** argv) {
osg::Shader::VERTEX,
osgDB::findDataFile("osgWidget/osgwidgetshader-vert.glsl")
));
program->addShader(osg::Shader::readShaderFile(
osg::Shader::FRAGMENT,
osgDB::findDataFile("osgWidget/osgwidgetshader-frag.glsl")

View File

@@ -30,7 +30,7 @@ class CustomStyled: public osgWidget::Widget {
};
class CustomStyle: public osgWidget::Style {
virtual bool applyStyle(osgWidget::Widget* w, osgWidget::Reader r) {
virtual bool applyStyle(osgWidget::Widget* w, osgWidget::Reader /*r*/) {
CustomStyled* cs = dynamic_cast<CustomStyled*>(w);
if(!cs) return false;
@@ -41,7 +41,8 @@ class CustomStyle: public osgWidget::Style {
}
};
int main(int argc, char** argv) {
int main(int, char**)
{
osgViewer::Viewer viewer;
osgWidget::WindowManager* wm = new osgWidget::WindowManager(

View File

@@ -12,7 +12,8 @@ const unsigned int MASK_2D = 0xF0000000;
// dynamically added to. Secondly, a table is matrix Layout, with both vertical and
// horizontal placement cells. A Box, on the other hand, can only be vertical or horizontal.
int main(int argc, char** argv) {
int main(int, char**)
{
osgViewer::Viewer viewer;
osgWidget::WindowManager* wm = new osgWidget::WindowManager(
@@ -22,7 +23,7 @@ int main(int argc, char** argv) {
MASK_2D,
osgWidget::WindowManager::WM_PICK_DEBUG
);
osgWidget::Table* table = new osgWidget::Table("table", 3, 3);
// Here we create our "cells" manually, though it will often be convenient to
@@ -32,11 +33,11 @@ int main(int argc, char** argv) {
table->addWidget(new osgWidget::Widget("0, 0", 100.0f, 25.0f), 0, 0);
table->addWidget(new osgWidget::Widget("0, 1", 100.0f, 25.0f), 0, 1);
table->addWidget(new osgWidget::Widget("0, 2", 100.0f, 75.0f), 0, 2);
table->addWidget(new osgWidget::Widget("1, 0", 200.0f, 45.0f), 1, 0);
table->addWidget(new osgWidget::Widget("1, 1", 200.0f, 45.0f), 1, 1);
table->addWidget(new osgWidget::Widget("1, 2", 200.0f, 45.0f), 1, 2);
table->addWidget(new osgWidget::Widget("2, 0", 300.0f, 65.0f), 2, 0);
table->addWidget(new osgWidget::Widget("2, 1", 300.0f, 65.0f), 2, 1);
table->addWidget(new osgWidget::Widget("2, 2", 300.0f, 65.0f), 2, 2);
@@ -58,7 +59,7 @@ int main(int argc, char** argv) {
table->getByName("0, 0")->setAlignVertical(osgWidget::Widget::VA_BOTTOM);
table->getByName("0, 0")->setPadLeft(50.0f);
table->getByName("0, 0")->setPadTop(3.0f);
// Change the colors a bit to differentiate this row from the others.
table->getByName("2, 0")->setColor(1.0f, 0.0f, 0.0f, 1.0f, osgWidget::Widget::LOWER_LEFT);
table->getByName("2, 1")->setColor(1.0f, 0.0f, 0.0f, 0.5f);

View File

@@ -51,14 +51,15 @@ struct CallbackObject: public osgWidget::Callback {
osgWidget::Callback(evType) {
}
virtual bool operator()(osgWidget::Event& ev) {
virtual bool operator()(osgWidget::Event& /*ev*/) {
std::cout << "here" << std::endl;
return false;
}
};
int main(int argc, char** argv) {
int main(int, char**)
{
osgViewer::Viewer viewer;
// Let's get busy! The WindowManager class is actually an osg::Switch,

View File

@@ -79,10 +79,6 @@ protected:
Operation():
_keep(false) {}
Operation(const Operation& op):
_name(op._name),
_keep(op._keep) {}
virtual ~Operation() {}
std::string _name;

View File

@@ -32,6 +32,9 @@ namespace osgAnimation
const osg::Matrix& getMatrix() const;
protected:
typedef osg::MixinVector<osg::ref_ptr<StackedTransformElement> > inherited;
osg::Matrix _matrix;
};

View File

@@ -31,7 +31,7 @@ class OSGQT_EXPORT QWidgetImage : public osg::Image
QGraphicsViewAdapter* getQGraphicsViewAdapter() { return _adapter; }
virtual bool requiresUpdateCall() const { return true; }
virtual void update( osg::NodeVisitor* nv ) { render(); }
virtual void update( osg::NodeVisitor* /*nv*/ ) { render(); }
void clearWriteBuffer();

View File

@@ -88,7 +88,7 @@ class OSGVOLUME_EXPORT Property : public osg::Object
unsigned int getModifiedCount() const { return _modifiedCount; }
virtual void accept(PropertyVisitor& pv) { pv.apply(*this); }
virtual void traverse(PropertyVisitor& pv) {}
virtual void traverse(PropertyVisitor& /*pv*/) {}
protected:

View File

@@ -44,6 +44,14 @@ IF(MSVC)
ENDIF()
################################################################################
## Quieten warnings that a due to optional code paths
IF(CMAKE_COMPILER_IS_GNUCXX)
# Remove -Wextra flag as it barfs on ffmoeg headers
STRING(REGEX REPLACE "-Wextra" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
ENDIF()
# INSTALL_FILES(/include/OpenThreads/ FILES "${OPENTHREADS_CONFIG_HEADER}")
################################################################################

View File

@@ -420,6 +420,17 @@ SET(TARGET_SRC
${OPENSCENEGRAPH_VERSIONINFO_RC}
)
################################################################################
## Quieten warnings that a due to optional code paths
IF(CMAKE_COMPILER_IS_GNUCXX)
# Remove -Wextra flag as it barfs on ffmoeg headers
STRING(REGEX REPLACE "-Wextra" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
ENDIF()
SET(TARGET_LIBRARIES OpenThreads)
SET(TARGET_EXTERNAL_LIBRARIES

View File

@@ -795,6 +795,7 @@ KdTreeBuilder::KdTreeBuilder():
}
KdTreeBuilder::KdTreeBuilder(const KdTreeBuilder& rhs):
osg::Object(rhs),
osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN),
_buildOptions(rhs._buildOptions),
_kdTreePrototype(rhs._kdTreePrototype)

View File

@@ -15,7 +15,7 @@
#include <osgAnimation/ActionCallback>
#include <osgAnimation/Timeline>
void osgAnimation::RunAction::operator()(Action* action, ActionVisitor* visitor)
void osgAnimation::RunAction::operator()(Action* /*action*/, ActionVisitor* visitor)
{
Timeline* tm = visitor->getCurrentTimeline();
tm->addActionNow(_action.get(), _priority);

View File

@@ -62,7 +62,10 @@ void AnimationManagerBase::operator()(osg::Node* node, osg::NodeVisitor* nv)
}
AnimationManagerBase::AnimationManagerBase(const AnimationManagerBase& b, const osg::CopyOp& copyop) : osg::NodeCallback(b,copyop) // TODO check this
AnimationManagerBase::AnimationManagerBase(const AnimationManagerBase& b, const osg::CopyOp& copyop) :
osg::Object(b,copyop),
osg::Callback(b,copyop),
osg::NodeCallback(b,copyop) // TODO check this
{
const AnimationList& animationList = b.getAnimationList();
for (AnimationList::const_iterator it = animationList.begin();

View File

@@ -26,6 +26,7 @@ Skeleton::UpdateSkeleton::UpdateSkeleton() : _needValidate(true) {}
Skeleton::UpdateSkeleton::UpdateSkeleton(const UpdateSkeleton& us, const osg::CopyOp& copyop) :
osg::Object(us, copyop),
osg::Callback(us, copyop),
osg::NodeCallback(us, copyop)
{
_needValidate = true;

View File

@@ -18,7 +18,8 @@ using namespace osgAnimation;
StackedTransform::StackedTransform() {}
StackedTransform::StackedTransform(const StackedTransform& rhs, const osg::CopyOp& co)
StackedTransform::StackedTransform(const StackedTransform& rhs, const osg::CopyOp& co):
inherited(rhs)
{
reserve(rhs.size());
for (StackedTransform::const_iterator it = rhs.begin(); it != rhs.end(); ++it)

View File

@@ -18,7 +18,10 @@
using namespace osgAnimation;
UpdateMatrixTransform::UpdateMatrixTransform( const UpdateMatrixTransform& apc,const osg::CopyOp& copyop) : osg::Object(apc,copyop), AnimationUpdateCallback<osg::NodeCallback>(apc, copyop)
UpdateMatrixTransform::UpdateMatrixTransform( const UpdateMatrixTransform& apc,const osg::CopyOp& copyop) :
osg::Object(apc,copyop),
osg::Callback(apc,copyop),
AnimationUpdateCallback<osg::NodeCallback>(apc, copyop)
{
_transforms = StackedTransform(apc.getStackedTransforms(), copyop);
}

View File

@@ -165,6 +165,14 @@ IF( ZLIB_FOUND )
SET(COMPRESSION_LIBRARIES ZLIB_LIBRARY)
ENDIF()
################################################################################
## Quieten warnings that a due to optional code paths
IF(CMAKE_COMPILER_IS_GNUCXX)
# Remove -Wextra flag as it barfs on ffmoeg headers
STRING(REGEX REPLACE "-Wextra" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
ENDIF()
ADD_DEFINITIONS(-DOSG_PLUGIN_EXTENSION=${CMAKE_SHARED_MODULE_SUFFIX})
SET(TARGET_LIBRARIES

View File

@@ -59,8 +59,8 @@ public:
virtual void writeFloat( float f ) { write(f); }
virtual void writeDouble( double d ) { write(d); }
virtual void writeString( const std::string& s ) { _str.insert(_str.end(), s.begin(), s.end()); }
virtual void writeStream( std::ostream& (*fn)(std::ostream&) ) {}
virtual void writeBase( std::ios_base& (*fn)(std::ios_base&) ) {}
virtual void writeStream( std::ostream& (*)(std::ostream&) ) {}
virtual void writeBase( std::ios_base& (*)(std::ios_base&) ) {}
virtual void writeGLenum( const osgDB::ObjectGLenum& value ) { writeInt(value.get()); }
virtual void writeProperty( const osgDB::ObjectProperty& prop ) { _propertyName = prop._name; }
virtual void writeMark( const osgDB::ObjectMark& mark ) { _markName = mark._name; }
@@ -123,12 +123,12 @@ public:
virtual void readDouble( double& d ) { read(d); }
virtual void readString( std::string& s ) { s = std::string(_bufferData, _bufferSize); }
virtual void readStream( std::istream& (*fn)(std::istream&) ) {}
virtual void readBase( std::ios_base& (*fn)(std::ios_base&) ) {}
virtual void readStream( std::istream& (*)(std::istream&) ) {}
virtual void readBase( std::ios_base& (*)(std::ios_base&) ) {}
virtual void readGLenum( ObjectGLenum& value ) { readUInt(value._value); }
virtual void readProperty( ObjectProperty& prop ) {}
virtual void readMark( ObjectMark& mark ) {}
virtual void readProperty( ObjectProperty& ) {}
virtual void readMark( ObjectMark&) {}
virtual void readCharArray( char* s, unsigned int size ) { if ( size>0 ) _in->read( s, size ); }
virtual void readWrappedString( std::string& str ) { readString(str); }
@@ -388,7 +388,7 @@ bool ClassInterface::copyPropertyDataToObject(osg::Object* object, const std::st
}
}
bool ClassInterface::copyPropertyObjectFromObject(const osg::Object* object, const std::string& propertyName, void* valuePtr, unsigned int valueSize, osgDB::BaseSerializer::Type valueType)
bool ClassInterface::copyPropertyObjectFromObject(const osg::Object* object, const std::string& propertyName, void* valuePtr, unsigned int /*valueSize*/, osgDB::BaseSerializer::Type valueType)
{
osgDB::BaseSerializer::Type sourceType;
osgDB::BaseSerializer* serializer = getSerializer(object, propertyName, sourceType);
@@ -411,7 +411,7 @@ bool ClassInterface::copyPropertyObjectFromObject(const osg::Object* object, con
}
}
bool ClassInterface::copyPropertyObjectToObject(osg::Object* object, const std::string& propertyName, const void* valuePtr, unsigned int valueSize, osgDB::BaseSerializer::Type valueType)
bool ClassInterface::copyPropertyObjectToObject(osg::Object* object, const std::string& propertyName, const void* valuePtr, unsigned int /*valueSize*/, osgDB::BaseSerializer::Type valueType)
{
osgDB::BaseSerializer::Type destinationType;
osgDB::BaseSerializer* serializer = getSerializer(object, propertyName, destinationType);

View File

@@ -21,7 +21,9 @@ CameraManipulator::CameraManipulator()
CameraManipulator::CameraManipulator(const CameraManipulator& mm, const CopyOp& copyOp)
: inherited(mm, copyOp),
: osg::Object(mm, copyOp),
osg::Callback(mm, copyOp),
inherited(mm, copyOp),
_intersectTraversalMask(mm._intersectTraversalMask),
_autoComputeHomePosition(mm._autoComputeHomePosition),
_homeEye(mm._homeEye),

View File

@@ -45,7 +45,7 @@ void EventHandler::event(osg::NodeVisitor* nv, osg::Drawable* drawable)
}
}
bool EventHandler::handle(osgGA::Event* event, osg::Object* object, osg::NodeVisitor* nv)
bool EventHandler::handle(osgGA::Event* event, osg::Object* /*object*/, osg::NodeVisitor* /*nv*/)
{
OSG_NOTICE<<"Handle event "<<event<<std::endl;
return false;

View File

@@ -44,7 +44,8 @@ FirstPersonManipulator::FirstPersonManipulator( int flags )
/// Constructor.
FirstPersonManipulator::FirstPersonManipulator( const FirstPersonManipulator& fpm, const CopyOp& copyOp )
: osg::Callback(fpm, copyOp),
: osg::Object(fpm, copyOp),
osg::Callback(fpm, copyOp),
inherited( fpm, copyOp ),
_eye( fpm._eye ),
_rotation( fpm._rotation ),

View File

@@ -28,7 +28,8 @@ FlightManipulator::FlightManipulator( int flags )
/// Constructor.
FlightManipulator::FlightManipulator( const FlightManipulator& fm, const CopyOp& copyOp )
: osg::Callback(fm, copyOp),
: osg::Object(fm, copyOp),
osg::Callback(fm, copyOp),
inherited( fm, copyOp ),
_yawMode( fm._yawMode )
{

View File

@@ -30,7 +30,7 @@ MultiTouchTrackballManipulator::MultiTouchTrackballManipulator( int flags )
/// Constructor.
MultiTouchTrackballManipulator::MultiTouchTrackballManipulator( const MultiTouchTrackballManipulator& tm, const CopyOp& copyOp )
: osg::Callback(tm, copyOp), inherited( tm, copyOp )
: osg::Object(tm, copyOp), osg::Callback(tm, copyOp), inherited( tm, copyOp )
{
}

View File

@@ -30,7 +30,8 @@ NodeTrackerManipulator::NodeTrackerManipulator( int flags )
NodeTrackerManipulator::NodeTrackerManipulator( const NodeTrackerManipulator& m, const CopyOp& copyOp )
: osg::Callback(m, copyOp),
: osg::Object(m, copyOp),
osg::Callback(m, copyOp),
inherited( m, copyOp ),
_trackNodePath( m._trackNodePath ),
_trackerMode( m._trackerMode )

View File

@@ -43,7 +43,8 @@ OrbitManipulator::OrbitManipulator( int flags )
/// Constructor.
OrbitManipulator::OrbitManipulator( const OrbitManipulator& om, const CopyOp& copyOp )
: osg::Callback(om, copyOp),
: osg::Object(om, copyOp),
osg::Callback(om, copyOp),
inherited( om, copyOp ),
_center( om._center ),
_rotation( om._rotation ),

View File

@@ -48,7 +48,9 @@ StandardManipulator::StandardManipulator( int flags )
/// Constructor.
StandardManipulator::StandardManipulator( const StandardManipulator& uim, const CopyOp& copyOp )
: inherited( uim, copyOp ),
: osg::Object(uim, copyOp),
osg::Callback(uim, copyOp),
inherited( uim, copyOp ),
_thrown( uim._thrown ),
_allowThrow( uim._allowThrow ),
_mouseCenterX(0.0f), _mouseCenterY(0.0f),

View File

@@ -29,7 +29,8 @@ TerrainManipulator::TerrainManipulator( int flags )
/// Constructor.
TerrainManipulator::TerrainManipulator( const TerrainManipulator& tm, const CopyOp& copyOp )
: osg::Callback(tm, copyOp),
: osg::Object(tm, copyOp),
osg::Callback(tm, copyOp),
inherited( tm, copyOp ),
_previousUp( tm._previousUp )
{

View File

@@ -28,7 +28,8 @@ TrackballManipulator::TrackballManipulator( int flags )
/// Constructor.
TrackballManipulator::TrackballManipulator( const TrackballManipulator& tm, const CopyOp& copyOp )
: osg::Callback(tm, copyOp),
: osg::Object(tm, copyOp),
osg::Callback(tm, copyOp),
inherited( tm, copyOp )
{
}

View File

@@ -35,7 +35,7 @@ Widget::Widget():
}
Widget::Widget(const Widget& widget, const osg::CopyOp& copyop):
osg::Group(),
osg::Group(widget, copyop),
_focusBehaviour(widget._focusBehaviour),
_hasEventFocus(false),
_graphicsInitialized(false)
@@ -277,7 +277,7 @@ bool Widget::handle(osgGA::EventVisitor* ev, osgGA::Event* event)
}
}
bool Widget::handleImplementation(osgGA::EventVisitor* ev, osgGA::Event* event)
bool Widget::handleImplementation(osgGA::EventVisitor* /*ev*/, osgGA::Event* /*event*/)
{
return false;
}

View File

@@ -49,7 +49,7 @@ AntiSquish::~AntiSquish()
}
bool AntiSquish::computeLocalToWorldMatrix(osg::Matrix& matrix,osg::NodeVisitor* nv) const
bool AntiSquish::computeLocalToWorldMatrix(osg::Matrix& matrix,osg::NodeVisitor* /*nv*/) const
{
osg::Matrix unsquishedMatrix;
if ( !computeUnSquishedMatrix( unsquishedMatrix ) )

View File

@@ -185,7 +185,7 @@ class ReaderWriter3DC : public osgDB::ReaderWriter
}
virtual WriteResult writeNode(const osg::Node& node,const std::string& fileName,const Options* options =NULL) const
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;

View File

@@ -693,7 +693,7 @@ static size_t fileo_write_func(void *self, const void *buffer, size_t size)
return f->fail() ? 0 : size;
}
static void fileio_log_func(void *self, Lib3dsLogLevel level, int indent, const char *msg)
static void fileio_log_func(void* /*self*/, Lib3dsLogLevel level, int /*indent*/, const char *msg)
{
osg::NotifySeverity l = osg::INFO;
// Intentionally NOT mapping 3DS levels with OSG levels

View File

@@ -145,14 +145,14 @@ public:
virtual void setVertexArray(unsigned int,const osg::Vec2*) {}
virtual void setVertexArray(unsigned int count,const osg::Vec3* vecs) {}
virtual void setVertexArray(unsigned int,const osg::Vec3*) {}
virtual void setVertexArray(unsigned int,const osg::Vec4* ) {}
virtual void setVertexArray(unsigned int,const osg::Vec4*) {}
virtual void setVertexArray(unsigned int,const osg::Vec2d*) {}
virtual void setVertexArray(unsigned int ,const osg::Vec3d* ) {}
virtual void setVertexArray(unsigned int,const osg::Vec4d* ) {}
virtual void setVertexArray(unsigned int ,const osg::Vec3d*) {}
virtual void setVertexArray(unsigned int,const osg::Vec4d*) {}
// operator for triangles

View File

@@ -447,7 +447,7 @@ protected:
virtual ~LightPointSystem() {}
virtual void readRecord(RecordInputStream& in, Document& document)
virtual void readRecord(RecordInputStream& in, Document& /*document*/)
{
std::string id = in.readString(8);
@@ -483,7 +483,7 @@ protected:
_parent->addChild(*((osg::Group*)_switch.get()));
}
virtual void dispose(Document& document)
virtual void dispose(Document& /*document*/)
{
if (!_switch.valid()) return;

View File

@@ -767,7 +767,7 @@ public:
protected:
virtual ~InstanceDefinition() {}
virtual void readRecord(RecordInputStream& in, Document& document)
virtual void readRecord(RecordInputStream& in, Document& /*document*/)
{
in.forward(2);
_number = (int)in.readUInt16();

View File

@@ -185,7 +185,7 @@ ReaderWriter::ReadResult ReaderWriterATTR::readObject(const std::string& file, c
ReaderWriter::WriteResult
ReaderWriterATTR::writeObject(const osg::Object& object, const std::string& fileName, const Options* options) const
ReaderWriterATTR::writeObject(const osg::Object& object, const std::string& fileName, const Options* /*options*/) const
{
using std::ios;

View File

@@ -172,7 +172,7 @@ VertexPaletteManager::write( DataOutputStream& dos ) const
VertexPaletteManager::PaletteRecordType
VertexPaletteManager::recordType( const osg::Array* v, const osg::Array* c,
VertexPaletteManager::recordType( const osg::Array* /*v*/, const osg::Array* /*c*/,
const osg::Array* n, const osg::Array* t )
{
if (t)

View File

@@ -50,7 +50,7 @@ static unsigned int LAYER_7( 0x80000000 >> 6 );
bool
FltExportVisitor::isLit( const osg::Geometry& geom ) const
FltExportVisitor::isLit( const osg::Geometry& /*geom*/ ) const
{
const osg::StateSet* ss = getCurrentStateSet();
if ( ss->getMode( GL_LIGHTING ) & osg::StateAttribute::ON )

View File

@@ -659,7 +659,7 @@ void Geode::OutputPolygonDelsUInt(const int iCurrentMaterial, const unsigned int
}
const int Geode::ProcessMaterial(ostream& fout, const unsigned int igeode)
int Geode::ProcessMaterial(ostream& fout, const unsigned int igeode)
{
// outputs materials from one geode
// extended for multiple geode models, GWM 2003.

View File

@@ -9,7 +9,7 @@ namespace ac3d
class Geode : public osg::Geode
{
public:
const int ProcessMaterial(std::ostream& fout, const unsigned int igeode);
int ProcessMaterial(std::ostream& fout, const unsigned int igeode);
void ProcessGeometry(std::ostream& fout, const unsigned int igeode);
private:
void OutputTriangle(const int iCurrentMaterial,const unsigned int surfaceFlags,

View File

@@ -768,7 +768,7 @@ class LineBin : public PrimitiveBin
return true;
}
virtual osg::Geode* finalize(const MaterialData& material, const TextureData& textureData)
virtual osg::Geode* finalize(const MaterialData& material, const TextureData& /*textureData*/)
{
_geode->addDrawable(_geometry.get());
material.toStateSet(_geode->getOrCreateStateSet());

View File

@@ -1118,6 +1118,7 @@ yydestruct (yytype, yyvaluep)
#endif
{
/* Pacify ``unused variable'' warnings. */
(void) yytype;
(void) yyvaluep;
}

View File

@@ -91,7 +91,7 @@ static osg::GraphicsContext::Traits* buildTrait(RenderSurface& rs)
return traits;
}
static osgViewer::View* load(const std::string& file, const osgDB::ReaderWriter::Options* option)
static osgViewer::View* load(const std::string& file, const osgDB::ReaderWriter::Options* /*option*/)
{
osg::ref_ptr<CameraConfig> config = new CameraConfig;
//std::cout << "Parse file " << file << std::endl;

View File

@@ -258,7 +258,7 @@ int RenderSurface::getScreenNum( void ) const
return _screen;
}
void RenderSurface::setWindowRectangle( int x, int y, unsigned int width, unsigned int height, bool resize)
void RenderSurface::setWindowRectangle( int x, int y, unsigned int width, unsigned int height, bool /*resize*/)
{
if( _useCustomFullScreen )
{

View File

@@ -378,7 +378,7 @@ ReaderWriterCURL::ReaderWriterCURL()
supportsProtocol("https","Read from https port using libcurl.");
supportsProtocol("ftp","Read from ftp port using libcurl.");
supportsProtocol("ftps","Read from ftps port using libcurl.");
supportsExtension("curl","Pseudo file extension, used to select curl plugin.");
supportsExtension("*","Passes all read files to other plugins to handle actual model loading.");
supportsOption("OSG_CURL_PROXY","Specify the http proxy.");
@@ -706,8 +706,7 @@ bool ReaderWriterCURL::read(std::istream& fin, std::string& destination) const
}
#endif
size_t empty_write_data(const char *buffer, size_t size, size_t nmemb, char
*userp)
size_t empty_write_data(const char* /*buffer*/, size_t size, size_t nmemb, char* /*userp*/)
{
return size*nmemb;
}
@@ -726,12 +725,12 @@ bool ReaderWriterCURL::fileExists(const std::string& filename, const osgDB::Opti
curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, &empty_write_data);
int result = curl_easy_perform(curl_handle);
long http_return_code(0);
curl_easy_getinfo(curl_handle, CURLINFO_RESPONSE_CODE, &http_return_code);
curl_easy_cleanup(curl_handle);
return ((result == 0) && ((http_return_code == 200) || (http_return_code == 0)));
}
else

View File

@@ -79,7 +79,7 @@ class EasyCurl : public osg::Referenced
virtual ~EasyCurl();
// disallow copying
EasyCurl(const EasyCurl& rhs):_curl(rhs._curl) {}
EasyCurl(const EasyCurl& rhs) : osg::Referenced(rhs), _curl(rhs._curl) {}
EasyCurl& operator = (const EasyCurl&) { return *this; }
void setOptions(const std::string& proxyAddress, const std::string& fileName, StreamObject& sp, const osgDB::ReaderWriter::Options *options);

View File

@@ -1,5 +1,15 @@
INCLUDE_DIRECTORIES( ${COLLADA_INCLUDE_DIR} ${COLLADA_INCLUDE_DIR}/1.4)
################################################################################
## Quieten warnings that a due to dae headers
IF(CMAKE_COMPILER_IS_GNUCXX)
# Remove -Wextra flag as it barfs on ffmoeg headers
STRING(REGEX REPLACE "-Wextra" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
ENDIF()
SET(TARGET_SRC
daeReader.cpp
daeRAnimations.cpp

View File

@@ -255,7 +255,7 @@ class ReaderWriterDICOM : public osgDB::ReaderWriter
}
virtual ReadResult readImage(std::istream& fin,const osgDB::ReaderWriter::Options*) const
virtual ReadResult readImage(std::istream&,const osgDB::ReaderWriter::Options*) const
{
return 0;
}

View File

@@ -140,17 +140,13 @@ namespace osgDot {
}
void BaseDotVisitor::handle(osg::Node& node, int id) {
}
void BaseDotVisitor::handle(osg::Node&, int) {}
void BaseDotVisitor::handle(osg::Geode& node, int id) {
}
void BaseDotVisitor::handle(osg::Geode&, int) {}
void BaseDotVisitor::handle(osg::Group& node, int id) {
}
void BaseDotVisitor::handle(osg::Group&, int) {}
void BaseDotVisitor::handle(osg::Group& parent, osg::Node& child, int parentID, int childID ) {
}
void BaseDotVisitor::handle(osg::Group&, osg::Node&, int, int) {}
void BaseDotVisitor::handleNodeAndTraverse(osg::Node& node, int id) {
osg::StateSet* ss = node.getStateSet();
@@ -164,20 +160,15 @@ namespace osgDot {
traverse(node);
}
void BaseDotVisitor::handle(osg::StateSet& stateset, int id) {
}
void BaseDotVisitor::handle(osg::StateSet&, int) {}
void BaseDotVisitor::handle(osg::Node& node, osg::StateSet& stateset, int parentID, int childID) {
}
void BaseDotVisitor::handle(osg::Node&, osg::StateSet&, int, int) {}
void BaseDotVisitor::handle(osg::Drawable& drawable, int id) {
}
void BaseDotVisitor::handle(osg::Drawable&, int) {}
void BaseDotVisitor::handle(osg::Drawable& drawable, osg::StateSet& stateset, int parentID, int childID ) {
}
void BaseDotVisitor::handle(osg::Drawable&, osg::StateSet&, int, int) {}
void BaseDotVisitor::handle(osg::Geode& geode, osg::Drawable& drawable, int parentID, int childID ) {
}
void BaseDotVisitor::handle(osg::Geode&, osg::Drawable&, int, int) {}
bool BaseDotVisitor::getOrCreateId( osg::Object* object, int &id ) {
assert( object );

View File

@@ -42,7 +42,7 @@ namespace osgDot {
drawNode( id, "record", "solid", label.str(), "black", "white" );
}
void SimpleDotVisitor::handle(osg::Group& parent, osg::Node& child, int parentID, int childID ) {
void SimpleDotVisitor::handle(osg::Group&, osg::Node&, int parentID, int childID ) {
drawEdge( parentID, childID, "setlinewidth(2)" );
}
@@ -53,7 +53,7 @@ namespace osgDot {
drawNode( id, "Mrecord", "solid", label.str(), "green", "white" );
}
void SimpleDotVisitor::handle(osg::Node& node, osg::StateSet& stateset, int parentID, int childID ) {
void SimpleDotVisitor::handle(osg::Node&, osg::StateSet&, int parentID, int childID ) {
drawEdge( parentID, childID, "dashed" );
}
@@ -64,11 +64,11 @@ namespace osgDot {
drawNode( id, "record", "solid", label.str(), "blue", "white" );
}
void SimpleDotVisitor::handle(osg::Geode& geode, osg::Drawable& drawable, int parentID, int childID ) {
void SimpleDotVisitor::handle(osg::Geode&, osg::Drawable&, int parentID, int childID ) {
drawEdge( parentID, childID, "dashed" );
}
void SimpleDotVisitor::handle(osg::Drawable& drawable, osg::StateSet& stateset, int parentID, int childID ) {
void SimpleDotVisitor::handle(osg::Drawable&, osg::StateSet&, int parentID, int childID ) {
drawEdge( parentID, childID, "dashed" );
}

Some files were not shown because too many files have changed in this diff Show More