- Timestamp:
- 01/16/08 16:07:40 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/Carsten_PtrWork2/Source/System/FileIO/Base/OSGSceneFileHandler.cpp
r908 r1039 162 162 163 163 164 Node Ptr SceneFileHandlerBase::read( std::istream &is,165 const Char8 *fileNameOrExtension,166 GraphOpSeq *graphOpSeq )164 NodeTransitPtr SceneFileHandlerBase::read( std::istream &is, 165 const Char8 *fileNameOrExtension, 166 GraphOpSeq *graphOpSeq ) 167 167 { 168 168 SceneFileType *type = getFileType(fileNameOrExtension); 169 Node Ptr scene = NullFC;169 NodeRefPtr scene; 170 170 171 171 if(!fileNameOrExtension) 172 172 { 173 173 SWARNING << "cannot read NULL extension" << std::endl; 174 return scene;174 return NodeTransitPtr(scene); 175 175 } 176 176 … … 247 247 } 248 248 249 return scene;249 return NodeTransitPtr(scene); 250 250 } 251 251 … … 256 256 GraphOpSeq *graphOpSeq ) 257 257 { 258 std::vector<FieldContainerPtr>nodeVec;259 Node Ptr scene = read(is, fileNameOrExtension);258 FCPtrStore nodeVec; 259 NodeRefPtr scene(read(is, fileNameOrExtension)); 260 260 261 261 if(scene == NullFC) … … 264 264 while(scene->getNChildren() > 0) 265 265 { 266 Node Ptr child = scene->getChild(0);267 Node Ptr newChild = Node::create();266 NodeRefPtr child (scene->getChild(0)); 267 NodeRefPtr newChild(Node::create() ); 268 268 269 269 while(child->getNChildren() > 0) … … 277 277 graphOpSeq->run(newChild); 278 278 279 nodeVec.push_back( newChild);279 nodeVec.push_back(FieldContainerRefPtr(newChild)); 280 280 281 281 scene->subChild(child); … … 285 285 } 286 286 287 Node Ptr SceneFileHandlerBase::read(const Char8 *fileName,288 GraphOpSeq *graphOpSeq)287 NodeTransitPtr SceneFileHandlerBase::read(const Char8 *fileName, 288 GraphOpSeq *graphOpSeq) 289 289 { 290 290 if(fileName == NULL) 291 291 { 292 292 SWARNING << "cannot read NULL file" << std::endl; 293 return N ullFC;293 return NodeTransitPtr(); 294 294 } 295 295 … … 313 313 { 314 314 SWARNING << "Couldn't open file " << fileName << std::endl; 315 return N ullFC;315 return NodeTransitPtr(); 316 316 } 317 317 } … … 319 319 { 320 320 SWARNING << "Couldn't open file " << fileName << std::endl; 321 return N ullFC;321 return NodeTransitPtr(); 322 322 } 323 323 } 324 324 325 325 SceneFileType *type = getFileType(fullFilePath.c_str()); 326 Node Ptr scene = NullFC;326 NodeRefPtr scene; 327 327 328 328 if(type != NULL) … … 378 378 } 379 379 380 return scene;380 return NodeTransitPtr(scene); 381 381 } 382 382 … … 385 385 GraphOpSeq *graphOpSeq) 386 386 { 387 std::vector<FieldContainerPtr>nodeVec;387 FCPtrStore nodeVec; 388 388 389 389 if(fileName == NULL) … … 419 419 if(nodeVec.empty() == true) 420 420 { 421 Node Ptr scene = read(fullFilePath.c_str());421 NodeRefPtr scene(read(fullFilePath.c_str())); 422 422 423 423 if(scene == NullFC) … … 426 426 while(scene->getNChildren() > 0) 427 427 { 428 Node Ptr child = scene->getChild(0);429 Node Ptr newChild = Node::create();428 NodeRefPtr child (scene->getChild(0)); 429 NodeRefPtr newChild(Node::create() ); 430 430 431 431 while(child->getNChildren() > 0) … … 439 439 graphOpSeq->run(newChild); 440 440 441 nodeVec.push_back( newChild);441 nodeVec.push_back(FieldContainerRefPtr(newChild)); 442 442 443 443 scene->subChild(child);
