From 87122ca369f83cf75fa4a0f12dad7ef8c1271a3b Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 13 Apr 2015 11:48:28 +0000 Subject: [PATCH] Fixed typo of SEPARATE enums git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14833 16af8721-9629-0410-8352-f15c8da7e697 --- examples/osgprerender/osgprerender.cpp | 2 +- .../osgprerendercubemap.cpp | 64 +++++++++---------- include/osg/Camera | 2 +- src/osgSim/ElevationSlice.cpp | 10 +-- src/osgUtil/RenderStage.cpp | 8 +-- .../deprecated-dotosg/osg/Camera.cpp | 8 +-- src/osgWrappers/serializers/osg/Camera.cpp | 2 +- 7 files changed, 48 insertions(+), 48 deletions(-) diff --git a/examples/osgprerender/osgprerender.cpp b/examples/osgprerender/osgprerender.cpp index d2794e3c0..85216b518 100644 --- a/examples/osgprerender/osgprerender.cpp +++ b/examples/osgprerender/osgprerender.cpp @@ -448,7 +448,7 @@ int main( int argc, char **argv ) while (arguments.read("--pbuffer")) { renderImplementation = osg::Camera::PIXEL_BUFFER; } while (arguments.read("--pbuffer-rtt")) { renderImplementation = osg::Camera::PIXEL_BUFFER_RTT; } while (arguments.read("--fb")) { renderImplementation = osg::Camera::FRAME_BUFFER; } - while (arguments.read("--window")) { renderImplementation = osg::Camera::SEPERATE_WINDOW; } + while (arguments.read("--window")) { renderImplementation = osg::Camera::SEPARATE_WINDOW; } while (arguments.read("--fbo-samples", samples)) {} while (arguments.read("--color-samples", colorSamples)) {} diff --git a/examples/osgprerendercubemap/osgprerendercubemap.cpp b/examples/osgprerendercubemap/osgprerendercubemap.cpp index f9fc2e91f..84f527005 100644 --- a/examples/osgprerendercubemap/osgprerendercubemap.cpp +++ b/examples/osgprerendercubemap/osgprerendercubemap.cpp @@ -110,7 +110,7 @@ osg::NodePath createReflector() osg::PositionAttitudeTransform* pat = new osg::PositionAttitudeTransform; pat->setPosition(osg::Vec3(0.0f,0.0f,0.0f)); pat->setAttitude(osg::Quat(osg::inDegrees(0.0f),osg::Vec3(0.0f,0.0f,1.0f))); - + Geode* geode_1 = new Geode; pat->addChild(geode_1); @@ -120,18 +120,18 @@ osg::NodePath createReflector() ShapeDrawable* shape = new ShapeDrawable(new Sphere(Vec3(0.0f, 0.0f, 0.0f), radius * 1.5f), hints.get()); shape->setColor(Vec4(0.8f, 0.8f, 0.8f, 1.0f)); geode_1->addDrawable(shape); - + osg::NodePath nodeList; nodeList.push_back(pat); nodeList.push_back(geode_1); - + return nodeList; } class UpdateCameraAndTexGenCallback : public osg::NodeCallback { public: - + typedef std::vector< osg::ref_ptr > CameraList; UpdateCameraAndTexGenCallback(osg::NodePath& reflectorNodePath, CameraList& Cameras): @@ -139,7 +139,7 @@ class UpdateCameraAndTexGenCallback : public osg::NodeCallback _Cameras(Cameras) { } - + virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) { // first update subgraph to make sure objects are all moved into position @@ -161,43 +161,43 @@ class UpdateCameraAndTexGenCallback : public osg::NodeCallback ImageData( osg::Vec3( 0, 0, -1), osg::Vec3( 0, -1, 0) ) // -Z }; - for(unsigned int i=0; + for(unsigned int i=0; i<6 && i<_Cameras.size(); ++i) { osg::Matrix localOffset; localOffset.makeLookAt(position,position+id[i].first,id[i].second); - + osg::Matrix viewMatrix = worldToLocal*localOffset; - + _Cameras[i]->setReferenceFrame(osg::Camera::ABSOLUTE_RF); _Cameras[i]->setProjectionMatrixAsFrustum(-1.0,1.0,-1.0,1.0,1.0,10000.0); _Cameras[i]->setViewMatrix(viewMatrix); } } - + protected: - + virtual ~UpdateCameraAndTexGenCallback() {} - - osg::NodePath _reflectorNodePath; + + osg::NodePath _reflectorNodePath; CameraList _Cameras; }; class TexMatCullCallback : public osg::NodeCallback { public: - + TexMatCullCallback(osg::TexMat* texmat): _texmat(texmat) { } - + virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) { // first update subgraph to make sure objects are all moved into position traverse(node,nv); - + osgUtil::CullVisitor* cv = dynamic_cast(nv); if (cv) { @@ -205,9 +205,9 @@ class TexMatCullCallback : public osg::NodeCallback _texmat->setMatrix(osg::Matrix::rotate(quat.inverse())); } } - + protected: - + osg::ref_ptr _texmat; }; @@ -216,7 +216,7 @@ osg::Group* createShadowedScene(osg::Node* reflectedSubgraph, osg::NodePath refl { osg::Group* group = new osg::Group; - + osg::TextureCubeMap* texture = new osg::TextureCubeMap; texture->setTextureSize(tex_width, tex_height); @@ -226,7 +226,7 @@ osg::Group* createShadowedScene(osg::Node* reflectedSubgraph, osg::NodePath refl texture->setWrap(osg::Texture::WRAP_R, osg::Texture::CLAMP_TO_EDGE); texture->setFilter(osg::TextureCubeMap::MIN_FILTER,osg::TextureCubeMap::LINEAR); texture->setFilter(osg::TextureCubeMap::MAG_FILTER,osg::TextureCubeMap::LINEAR); - + // set up the render to texture cameras. UpdateCameraAndTexGenCallback::CameraList Cameras; for(unsigned int i=0; i<6; ++i) @@ -251,23 +251,23 @@ osg::Group* createShadowedScene(osg::Node* reflectedSubgraph, osg::NodePath refl // add subgraph to render camera->addChild(reflectedSubgraph); - + group->addChild(camera); - + Cameras.push_back(camera); } - + // create the texgen node to project the tex coords onto the subgraph osg::TexGenNode* texgenNode = new osg::TexGenNode; texgenNode->getTexGen()->setMode(osg::TexGen::REFLECTION_MAP); texgenNode->setTextureUnit(unit); group->addChild(texgenNode); - // set the reflected subgraph so that it uses the texture and tex gen settings. + // set the reflected subgraph so that it uses the texture and tex gen settings. { osg::Node* reflectorNode = reflectorNodePath.front(); group->addChild(reflectorNode); - + osg::StateSet* stateset = reflectorNode->getOrCreateStateSet(); stateset->setTextureAttributeAndModes(unit,texture,osg::StateAttribute::ON); stateset->setTextureMode(unit,GL_TEXTURE_GEN_S,osg::StateAttribute::ON); @@ -277,13 +277,13 @@ osg::Group* createShadowedScene(osg::Node* reflectedSubgraph, osg::NodePath refl osg::TexMat* texmat = new osg::TexMat; stateset->setTextureAttributeAndModes(unit,texmat,osg::StateAttribute::ON); - + reflectorNode->setCullCallback(new TexMatCullCallback(texmat)); } - + // add the reflector scene to draw just as normal group->addChild(reflectedSubgraph); - + // set an update callback to keep moving the camera and tex gen in the right direction. group->setUpdateCallback(new UpdateCameraAndTexGenCallback(reflectorNodePath, Cameras)); @@ -316,19 +316,19 @@ int main(int argc, char** argv) arguments.getApplicationUsage()->write(std::cout); return 1; } - + unsigned tex_width = 256; unsigned tex_height = 256; while (arguments.read("--width", tex_width)) {} while (arguments.read("--height", tex_height)) {} osg::Camera::RenderTargetImplementation renderImplementation = osg::Camera::FRAME_BUFFER_OBJECT; - + while (arguments.read("--fbo")) { renderImplementation = osg::Camera::FRAME_BUFFER_OBJECT; } while (arguments.read("--pbuffer")) { renderImplementation = osg::Camera::PIXEL_BUFFER; } while (arguments.read("--fb")) { renderImplementation = osg::Camera::FRAME_BUFFER; } - while (arguments.read("--window")) { renderImplementation = osg::Camera::SEPERATE_WINDOW; } - + while (arguments.read("--window")) { renderImplementation = osg::Camera::SEPARATE_WINDOW; } + // any option left unread are converted into errors to write out later. arguments.reportRemainingOptionsAsUnrecognized(); @@ -343,7 +343,7 @@ int main(int argc, char** argv) ref_ptr scene = new MatrixTransform; scene->setMatrix(osg::Matrix::rotate(osg::DegreesToRadians(125.0),1.0,0.0,0.0)); - ref_ptr reflectedSubgraph = _create_scene(); + ref_ptr reflectedSubgraph = _create_scene(); if (!reflectedSubgraph.valid()) return 1; ref_ptr reflectedScene = createShadowedScene(reflectedSubgraph.get(), createReflector(), 0, viewer.getCamera()->getClearColor(), diff --git a/include/osg/Camera b/include/osg/Camera index 34ecbcb3e..ad615ec00 100644 --- a/include/osg/Camera +++ b/include/osg/Camera @@ -292,7 +292,7 @@ class OSG_EXPORT Camera : public Transform, public CullSettings PIXEL_BUFFER_RTT, PIXEL_BUFFER, FRAME_BUFFER, - SEPERATE_WINDOW + SEPARATE_WINDOW }; /** Set the render target.*/ diff --git a/src/osgSim/ElevationSlice.cpp b/src/osgSim/ElevationSlice.cpp index 3c6283426..59b780501 100644 --- a/src/osgSim/ElevationSlice.cpp +++ b/src/osgSim/ElevationSlice.cpp @@ -241,7 +241,7 @@ struct Segment { UNCLASSIFIED, IDENTICAL, - SEPERATE, + SEPARATE, JOINED, OVERLAPPING, ENCLOSING, @@ -262,10 +262,10 @@ struct Segment if (delta_distance==0.0) { - return SEPERATE; + return SEPARATE; } - if (rhs._p2->distance < _p1->distance || _p2->distance < rhs._p1->distance) return SEPERATE; + if (rhs._p2->distance < _p1->distance || _p2->distance < rhs._p1->distance) return SEPARATE; bool rhs_p1_inside = (_p1->distance <= rhs._p1->distance) && (rhs._p1->distance <= _p2->distance); bool rhs_p2_inside = (_p1->distance <= rhs._p2->distance) && (rhs._p2->distance <= _p2->distance); @@ -406,7 +406,7 @@ struct LineConstructor switch(classification) { case(Segment::IDENTICAL): OSG_NOTICE<<"i"; break; - case(Segment::SEPERATE): OSG_NOTICE<<"s"<compare(*nextItr); switch(classification) { - case(Segment::SEPERATE): + case(Segment::SEPARATE): { intersections.push_back( nextItr->_p1->position ); distanceHeightIntersections.push_back( ElevationSlice::DistanceHeight(nextItr->_p1->distance, nextItr->_p1->height) ); diff --git a/src/osgUtil/RenderStage.cpp b/src/osgUtil/RenderStage.cpp index c686bc89c..fc88c71b2 100644 --- a/src/osgUtil/RenderStage.cpp +++ b/src/osgUtil/RenderStage.cpp @@ -610,7 +610,7 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo) while (!getGraphicsContext() && (renderTargetImplementation==osg::Camera::PIXEL_BUFFER_RTT || renderTargetImplementation==osg::Camera::PIXEL_BUFFER || - renderTargetImplementation==osg::Camera::SEPERATE_WINDOW) ) + renderTargetImplementation==osg::Camera::SEPARATE_WINDOW) ) { osg::ref_ptr context = getGraphicsContext(); if (!context) @@ -625,8 +625,8 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo) // OSG_NOTICE<<"traits = "<width<<" "<height<pbuffer = (renderTargetImplementation==osg::Camera::PIXEL_BUFFER || renderTargetImplementation==osg::Camera::PIXEL_BUFFER_RTT); - traits->windowDecoration = (renderTargetImplementation==osg::Camera::SEPERATE_WINDOW); - traits->doubleBuffer = (renderTargetImplementation==osg::Camera::SEPERATE_WINDOW); + traits->windowDecoration = (renderTargetImplementation==osg::Camera::SEPARATE_WINDOW); + traits->doubleBuffer = (renderTargetImplementation==osg::Camera::SEPARATE_WINDOW); osg::Texture* pBufferTexture = 0; GLenum bufferFormat = GL_NONE; @@ -699,7 +699,7 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo) } default: { - if (renderTargetImplementation==osg::Camera::SEPERATE_WINDOW) + if (renderTargetImplementation==osg::Camera::SEPARATE_WINDOW) { OSG_NOTICE<<"Warning: RenderStage::runCameraSetUp(State&) Window "; } diff --git a/src/osgWrappers/deprecated-dotosg/osg/Camera.cpp b/src/osgWrappers/deprecated-dotosg/osg/Camera.cpp index 97d08af1a..63072d176 100644 --- a/src/osgWrappers/deprecated-dotosg/osg/Camera.cpp +++ b/src/osgWrappers/deprecated-dotosg/osg/Camera.cpp @@ -125,7 +125,7 @@ bool Camera_readLocalData(Object& obj, Input& fr) else if (fr[1].matchWord("PIXEL_BUFFER_RTT")) implementation = osg::Camera::PIXEL_BUFFER_RTT; else if (fr[1].matchWord("PIXEL_BUFFER")) implementation = osg::Camera::PIXEL_BUFFER; else if (fr[1].matchWord("FRAME_BUFFER")) implementation = osg::Camera::FRAME_BUFFER; - else if (fr[1].matchWord("SEPERATE_WINDOW")) implementation = osg::Camera::SEPERATE_WINDOW; + else if (fr[1].matchWord("SEPARATE_WINDOW")) implementation = osg::Camera::SEPARATE_WINDOW; camera.setRenderTargetImplementation(implementation); @@ -141,7 +141,7 @@ bool Camera_readLocalData(Object& obj, Input& fr) else if (fr[1].matchWord("PIXEL_BUFFER_RTT")) fallback = osg::Camera::PIXEL_BUFFER_RTT; else if (fr[1].matchWord("PIXEL_BUFFER")) fallback = osg::Camera::PIXEL_BUFFER; else if (fr[1].matchWord("FRAME_BUFFER")) fallback = osg::Camera::FRAME_BUFFER; - else if (fr[1].matchWord("SEPERATE_WINDOW")) fallback = osg::Camera::SEPERATE_WINDOW; + else if (fr[1].matchWord("SEPARATE_WINDOW")) fallback = osg::Camera::SEPARATE_WINDOW; camera.setRenderTargetImplementation(camera.getRenderTargetImplementation(), fallback); @@ -273,7 +273,7 @@ bool Camera_writeLocalData(const Object& obj, Output& fw) case(osg::Camera::PIXEL_BUFFER_RTT): fw <<"PIXEL_BUFFER_RTT"<