From 2e92e7d242dcafd1d757d56c49a7edf2c86ccc7f Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 10 Oct 2002 09:39:09 +0000 Subject: [PATCH] Made the warning about a mis-matching in the number of children in a switch a INFO level notify message rather than a WARN. --- src/osgPlugins/flt/flt2osg.cpp | 49 ++++++---------------------------- 1 file changed, 8 insertions(+), 41 deletions(-) diff --git a/src/osgPlugins/flt/flt2osg.cpp b/src/osgPlugins/flt/flt2osg.cpp index c9b593295..599e5a4b7 100644 --- a/src/osgPlugins/flt/flt2osg.cpp +++ b/src/osgPlugins/flt/flt2osg.cpp @@ -890,7 +890,6 @@ osg::Group* ConvertFromFLT::visitDOF(osg::Group& osgParent, DofRecord* rec) osg::Group* ConvertFromFLT::visitSwitch(osg::Group& osgParent, SwitchRecord* rec) { -#if 1 SSwitch *pSSwitch = (SSwitch*)rec->getData(); osg::Switch* osgSwitch = new osg::Switch; @@ -902,12 +901,15 @@ osg::Group* ConvertFromFLT::visitSwitch(osg::Group& osgParent, SwitchRecord* rec unsigned int totalNumChildren = (unsigned int)rec->getNumChildren(); if (totalNumChildren!=osgSwitch->getNumChildren()) { - // only convert the children we agree on. + // only convert the children we agree on, + // however, there could be a chance that ordering of children might + // be different if there a children that hanvn't mapped across... if (totalNumChildren>osgSwitch->getNumChildren()) totalNumChildren=osgSwitch->getNumChildren(); - - osg::notify(osg::WARN)<<"Warning::OpenFlight loader has come across an incorrectly handled switch."<getNumChildren()<<") "<getNumChildren()<<")"<getNumChildren()<<") "<getNumChildren()<<")"<getData(); - osg::Group* group = new osg::Group; - - group->setName(pSSwitch->szIdent); - visitAncillary(osgParent, *group, rec)->addChild( group ); - visitPrimaryNode(*group, (PrimNodeRecord*)rec); - - for(unsigned int nChild=0; nChild<(unsigned int)rec->getNumChildren(); nChild++) - { - unsigned int nMaskBit = nChild % 32; - unsigned int nMaskWord = pSSwitch->nCurrentMask * pSSwitch->nWordsInMask + nChild / 32; - - if (!(pSSwitch->aMask[nMaskWord] & (uint32(1) << nMaskBit))) - { - if (nChildgetNumChildren()) - { - osg::Node* node = group->getChild(nChild); - if (node) - node->setNodeMask(0); - } - else - { - osg::notify(osg::WARN)<<"Warning::OpenFlight loader has come across an incorrectly handled switch."<getNumChildren()<<") "<getNumChildren()<<")"<