- Timestamp:
- 01/16/08 16:07:40 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/Carsten_PtrWork2/Source/System/FileIO/OSB/OSGNFIOGeometry.cpp
r1023 r1039 119 119 } 120 120 121 FieldContainer Ptr NFIOGeometry::readFC(const std::string &/*typeName*/)121 FieldContainerTransitPtr NFIOGeometry::readFC(const std::string &/*typeName*/) 122 122 { 123 123 FDEBUG(("NFIOGeometry::readFC\n")); 124 124 125 Geometry Ptr geo = Geometry::create();125 GeometryRefPtr geo = Geometry::create(); 126 126 127 127 UInt16 version; … … 363 363 364 364 if(fieldName.empty()) 365 return geo;365 return FieldContainerTransitPtr(geo); 366 366 367 367 // qpositions … … 371 371 _in->getValue(fieldName); 372 372 if(fieldName.empty()) 373 return geo;373 return FieldContainerTransitPtr(geo); 374 374 } 375 375 … … 380 380 _in->getValue(fieldName); 381 381 if(fieldName.empty()) 382 return geo;382 return FieldContainerTransitPtr(geo); 383 383 } 384 384 … … 389 389 _in->getValue(fieldName); 390 390 if(fieldName.empty()) 391 return geo;391 return FieldContainerTransitPtr(geo); 392 392 } 393 393 … … 398 398 _in->getValue(fieldName); 399 399 if(fieldName.empty()) 400 return geo;401 } 402 } 403 404 return geo;405 } 406 407 void NFIOGeometry::readQuantizedPositions(GeometryPtr &geo)400 return FieldContainerTransitPtr(geo); 401 } 402 } 403 404 return FieldContainerTransitPtr(geo); 405 } 406 407 void NFIOGeometry::readQuantizedPositions(GeometryPtr geo) 408 408 { 409 409 // read quantized normals. … … 412 412 _in->getValue(fieldType); 413 413 414 GeoPnt3fProperty Ptr positions = GeoPnt3fProperty::create();414 GeoPnt3fPropertyRefPtr positions = GeoPnt3fProperty::create(); 415 415 readQuantizedVectors<Pnt3f>(positions); 416 416 … … 418 418 } 419 419 420 void NFIOGeometry::readQuantizedNormals(GeometryPtr &geo)420 void NFIOGeometry::readQuantizedNormals(GeometryPtr geo) 421 421 { 422 422 // read quantized normals. … … 425 425 _in->getValue(fieldType); 426 426 427 GeoVec3fProperty Ptr normals = GeoVec3fProperty::create();427 GeoVec3fPropertyRefPtr normals = GeoVec3fProperty::create(); 428 428 readQuantizedVectors<Vec3f>(normals); 429 429 … … 431 431 } 432 432 433 void NFIOGeometry::readQuantizedTexCoords(GeometryPtr &geo)433 void NFIOGeometry::readQuantizedTexCoords(GeometryPtr geo) 434 434 { 435 435 // read quantized texcoords. … … 438 438 _in->getValue(fieldType); 439 439 440 GeoVec2fProperty Ptr texcoords = GeoVec2fProperty::create();440 GeoVec2fPropertyRefPtr texcoords = GeoVec2fProperty::create(); 441 441 readQuantizedVectors<Vec2f>(texcoords); 442 442 … … 444 444 } 445 445 446 void NFIOGeometry::readPackedIndices(GeometryPtr &geo, UInt32 size)446 void NFIOGeometry::readPackedIndices(GeometryPtr geo, UInt32 size) 447 447 { 448 448 // read packed indices. … … 466 466 _in->getValue(noe); 467 467 468 GeoIntegralProperty Ptr indices = NullFC;468 GeoIntegralPropertyRefPtr indices; 469 469 bool using_16bit = false; 470 470 if(getOptions().unpack16BitIndices()) … … 497 497 if(using_16bit) 498 498 { 499 MFUInt16 *ind = dynamic_cast<GeoUInt16PropertyPtr>(indices)->editFieldPtr(); 499 MFUInt16 *ind = 500 boost::dynamic_pointer_cast<GeoUInt16Property>(indices)->editFieldPtr(); 500 501 ind->reserve(indices_size); 501 502 BitUnpacker unpacker(buffer, max); … … 505 506 else 506 507 { 507 MFUInt32 *ind = dynamic_cast<GeoUInt32PropertyPtr>(indices)->editFieldPtr(); 508 MFUInt32 *ind = 509 boost::dynamic_pointer_cast<GeoUInt32Property>(indices)->editFieldPtr(); 508 510 ind->reserve(indices_size); 509 511 BitUnpacker unpacker(buffer, max); … … 621 623 } 622 624 623 void NFIOGeometry::writeQuantizedPositions(const GeometryPtr &geo, UInt8 res)625 void NFIOGeometry::writeQuantizedPositions(const GeometryPtr geo, UInt8 res) 624 626 { 625 627 GeoPnt3fPropertyPtr positions = dynamic_cast<GeoPnt3fPropertyPtr>(geo->getPositions()); … … 632 634 633 635 634 void NFIOGeometry::writeQuantizedNormals(const GeometryPtr &geo, UInt8 res)636 void NFIOGeometry::writeQuantizedNormals(const GeometryPtr geo, UInt8 res) 635 637 { 636 638 GeoVec3fPropertyPtr normals = dynamic_cast<GeoVec3fPropertyPtr>(geo->getNormals()); … … 642 644 } 643 645 644 void NFIOGeometry::writeQuantizedTexCoords(const GeometryPtr &geo, UInt8 res)646 void NFIOGeometry::writeQuantizedTexCoords(const GeometryPtr geo, UInt8 res) 645 647 { 646 648 GeoVec2fPropertyPtr texcoords = dynamic_cast<GeoVec2fPropertyPtr>(geo->getTexCoords()); … … 652 654 } 653 655 654 void NFIOGeometry::writePackedIndices(const GeometryPtr &geo)656 void NFIOGeometry::writePackedIndices(const GeometryPtr geo) 655 657 { 656 658 // write packed indices. … … 835 837 for(UInt32 i=0;i<size;++i) 836 838 { 837 GeoUInt32Property Ptr indices = GeoUInt32Property::create();839 GeoUInt32PropertyRefPtr indices = GeoUInt32Property::create(); 838 840 GeoUInt32Property::StoredFieldType *indicesp = indices->editFieldPtr(); 839 841 indices_list.push_back(indices);
