- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgPlugins/OpenFlight/ReaderWriterFLT.cpp
r12597 r13041 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 2 2 * 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 5 5 * (at your option) any later version. The full license is in LICENSE file 6 6 * included with this distribution, and on the openscenegraph.org website. 7 * 7 * 8 8 * This library is distributed in the hope that it will be useful, 9 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 11 * OpenSceneGraph Public License for more details. 12 12 */ … … 35 35 #include "ExportOptions.h" 36 36 37 #define SERIALIZER() OpenThreads::ScopedLock<OpenThreads::ReentrantMutex> lock(_serializerMutex) 37 #define SERIALIZER() OpenThreads::ScopedLock<OpenThreads::ReentrantMutex> lock(_serializerMutex) 38 38 39 39 using namespace flt; … … 227 227 { 228 228 supportsExtension("flt","OpenFlight format"); 229 229 230 230 supportsOption("clampToEdge","Import option"); 231 231 supportsOption("keepExternalReferences","Import option"); … … 263 263 return readNode(file, options); 264 264 } 265 265 266 266 virtual ReadResult readNode(const std::string& file, const Options* options) const 267 267 { … … 281 281 } 282 282 283 // setting up the database path so that internally referenced file are searched for on relative paths. 283 // setting up the database path so that internally referenced file are searched for on relative paths. 284 284 osg::ref_ptr<Options> local_opt = options ? static_cast<Options*>(options->clone(osg::CopyOp::SHALLOW_COPY)) : new Options; 285 285 local_opt->getDatabasePathList().push_front(osgDB::getFilePath(fileName)); … … 304 304 // add to local cache. 305 305 flt::Registry::instance()->addExternalToLocalCache(fileName,rr.getNode()); 306 306 307 307 bool keepExternalReferences = false; 308 308 if (options) … … 324 324 else 325 325 { 326 OSG_DEBUG << "keepExternalReferences found, so externals will be left as ProxyNodes"<<std::endl; 326 OSG_DEBUG << "keepExternalReferences found, so externals will be left as ProxyNodes"<<std::endl; 327 327 } 328 328 } … … 334 334 return rr; 335 335 } 336 336 337 337 virtual ReadResult readObject(std::istream& fin, const Options* options) const 338 338 { 339 339 return readNode(fin, options); 340 340 } 341 341 342 342 virtual ReadResult readNode(std::istream& fin, const Options* options) const 343 343 { … … 349 349 { 350 350 const char readerMsg[] = "flt reader option: "; 351 351 352 352 document.setReplaceClampWithClampToEdge((options->getOptionString().find("clampToEdge")!=std::string::npos)); 353 353 OSG_DEBUG << readerMsg << "clampToEdge=" << document.getReplaceClampWithClampToEdge() << std::endl; … … 429 429 size_type size = (size_type)dataStream.readUInt16(); 430 430 431 // If size == 0, an EOF has probably been reached, i.e. there is nothing 431 // If size == 0, an EOF has probably been reached, i.e. there is nothing 432 432 // more to read so we must return. 433 433 if (size==0) … … 515 515 optimizer.optimize(document.getHeaderNode(), 516 516 osgUtil::Optimizer::SHARE_DUPLICATE_STATE | 517 osgUtil::Optimizer::MERGE_GEOMETRY | 518 osgUtil::Optimizer::MERGE_GEODES | 517 osgUtil::Optimizer::MERGE_GEOMETRY | 518 osgUtil::Optimizer::MERGE_GEODES | 519 519 osgUtil::Optimizer::TESSELLATE_GEOMETRY | 520 520 osgUtil::Optimizer::STATIC_OBJECT_DETECTION);
