| 168 | | try |
| 169 | | { |
| 170 | | // write ac file. |
| 171 | | if(dynamic_cast<const osg::Group*>(&node)) { |
| 172 | | const osg::Group *gp=dynamic_cast<const osg::Group*>(&node); |
| 173 | | const unsigned int nch=gp->getNumChildren(); |
| 174 | | for (unsigned int i=0; i<nch; i++) { |
| 175 | | writeNode(*(gp->getChild(i)), fout, opts); |
| 176 | | } |
| 177 | | } |
| 178 | | else |
| 179 | | osg::notify(osg::WARN)<<"File must start with a geode "<<std::endl; |
| 180 | | fout.flush(); |
| 181 | | return WriteResult::FILE_SAVED; |
| 182 | | } |
| 183 | | catch(ac3d::Exception e) |
| 184 | | { |
| 185 | | osg::notify(osg::WARN)<<"Error parsing OSG tree: "<< e.getError() << std::endl; |
| 186 | | } |
| 187 | | return WriteResult::FILE_NOT_HANDLED; |
| 188 | | |
| | 168 | // write ac file. |
| | 169 | if(dynamic_cast<const osg::Group*>(&node)) |
| | 170 | { |
| | 171 | const osg::Group *gp=dynamic_cast<const osg::Group*>(&node); |
| | 172 | const unsigned int nch=gp->getNumChildren(); |
| | 173 | for (unsigned int i=0; i<nch; i++) |
| | 174 | { |
| | 175 | writeNode(*(gp->getChild(i)), fout, opts); |
| | 176 | } |
| | 177 | } |
| | 178 | else |
| | 179 | osg::notify(osg::WARN)<<"File must start with a geode "<<std::endl; |
| | 180 | |
| | 181 | fout.flush(); |
| | 182 | return WriteResult::FILE_SAVED; |