- Timestamp:
- 01/16/08 16:07:40 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/Carsten_PtrWork2/Source/System/FileIO/OBJ/OSGOBJSceneFileType.cpp
r1023 r1039 134 134 // 135 135 //------------------------------ 136 Node Ptr OBJSceneFileType::read(std::istream &is, const Char8 *) const136 NodeTransitPtr OBJSceneFileType::read(std::istream &is, const Char8 *) const 137 137 { 138 Node Ptr rootPtr, nodePtr;138 NodeRefPtr rootPtr, nodePtr; 139 139 std::string elem; 140 140 std::map<std::string, DataElem>::const_iterator elemI; … … 143 143 Vec2r vec2r; 144 144 Real32 x,y,z; 145 GeoPnt3rProperty Ptr coordPtr = GeoPnt3rProperty::create();146 GeoVec2rProperty Ptr texCoordPtr = GeoVec2rProperty::create();147 GeoVec3rProperty Ptr normalPtr = GeoVec3rProperty::create();148 Geometry Ptr geoPtr;149 GeoIntegralProperty Ptr posIndexPtr, texIndexPtr, normalIndexPtr;150 GeoIntegralProperty Ptr lensPtr;151 GeoIntegralProperty Ptr typePtr;145 GeoPnt3rProperty::ObjRefPtr coordPtr = GeoPnt3rProperty::create(); 146 GeoVec2rProperty::ObjRefPtr texCoordPtr = GeoVec2rProperty::create(); 147 GeoVec3rProperty::ObjRefPtr normalPtr = GeoVec3rProperty::create(); 148 Geometry::ObjRefPtr geoPtr; 149 GeoIntegralProperty::ObjRefPtr posIndexPtr, texIndexPtr, normalIndexPtr; 150 GeoIntegralProperty::ObjRefPtr lensPtr; 151 GeoIntegralProperty::ObjRefPtr typePtr; 152 152 DataElem dataElem; 153 153 Char8 strBuf[8192], *token, *nextToken; … … 156 156 Int32 i,j,n,primCount[3]; 157 157 std::list<Mesh> meshList; 158 std::map<std::string, SimpleTexturedMaterial Ptr> mtlMap;159 std::map<std::string, SimpleTexturedMaterial Ptr>::iterator mtlI;158 std::map<std::string, SimpleTexturedMaterialRefPtr> mtlMap; 159 std::map<std::string, SimpleTexturedMaterialRefPtr>::iterator mtlI; 160 160 Mesh emptyMesh; 161 161 Face emptyFace; … … 291 291 for (meshI = meshList.begin(); meshI != meshList.end(); meshI++) 292 292 { 293 geoPtr = Geometry::create();294 posIndexPtr = NullFC;295 texIndexPtr = NullFC;293 geoPtr = Geometry::create(); 294 posIndexPtr = NullFC; 295 texIndexPtr = NullFC; 296 296 normalIndexPtr = NullFC; 297 lensPtr = GeoUIntProperty::create();298 typePtr = GeoUInt8Property::create();297 lensPtr = GeoUIntProperty::create(); 298 typePtr = GeoUInt8Property::create(); 299 299 300 300 // create and check mesh index mask … … 461 461 { 462 462 rootPtr = Node::create(); 463 rootPtr->setCore ( Group::create());463 rootPtr->setCore (GroupRefPtr(Group::create())); 464 464 rootPtr->addChild(nodePtr); 465 465 } … … 480 480 SceneFileHandler::the()->updateReadProgress(100); 481 481 #endif 482 return rootPtr;482 return NodeTransitPtr(rootPtr); 483 483 } 484 484 … … 761 761 762 762 Int32 OBJSceneFileType::readMTL ( const Char8 *fileName, 763 std::map<std::string, SimpleTexturedMaterial Ptr> & mtlMap )763 std::map<std::string, SimpleTexturedMaterialRefPtr> & mtlMap ) 764 764 const 765 765 { … … 787 787 788 788 std::ifstream in(fullFilePath.c_str()); 789 SimpleTexturedMaterial Ptr mtlPtr = NullFC;789 SimpleTexturedMaterialRefPtr mtlPtr; 790 790 Real32 a,b,c; 791 791 std::string elem; 792 792 std::map<std::string, MaterialElem>::const_iterator elemI; 793 793 MaterialElem mtlElem; 794 std::map<std::string, OSG::Image Ptr> imageMap;795 std::map<std::string, OSG::Image Ptr>::iterator iI;796 Image Ptr image = NullFC;794 std::map<std::string, OSG::ImageRefPtr> imageMap; 795 std::map<std::string, OSG::ImageRefPtr>::iterator iI; 796 ImageRefPtr image; 797 797 bool constDiffuse = false, constAmbient = false, constSpecular = false; 798 798 … … 935 935 } 936 936 } 937 937 938 return mtlCount; 938 939 }
