Changeset 1190
- Timestamp:
- 04/25/08 03:25:46 (2 weeks ago)
- Files:
-
- trunk/Source/System/FileIO/Collada/OSGColladaFileType.cpp (modified) (1 diff)
- trunk/Source/System/FileIO/Collada/OSGColladaFileType.h (modified) (1 diff)
- trunk/Source/System/FileIO/Collada/OSGColladaIntegration.cpp (modified) (31 diffs)
- trunk/Source/System/FileIO/Collada/OSGColladaIntegration.h (modified) (12 diffs)
- trunk/Source/System/FileIO/Collada/OSGColladaLoader.cpp (modified) (2 diffs)
- trunk/Source/System/FileIO/Collada/OSGColladaLoader.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Source/System/FileIO/Collada/OSGColladaFileType.cpp
r785 r1190 138 138 139 139 140 NodePtr ColladaFileType::read( std::istream &is, 141 const Char8 *fileNameOrExtension) const 140 NodeTransitPtr ColladaFileType::read( 141 std::istream &is, 142 const Char8 *fileNameOrExtension) const 142 143 { 143 Node Ptr returnValue = NullFC;144 NodeTransitPtr returnValue(NULL); 144 145 145 146 ColladaLoader *pLoader = new ColladaLoader; trunk/Source/System/FileIO/Collada/OSGColladaFileType.h
r785 r1190 183 183 /*------------------------- your_category -------------------------------*/ 184 184 185 virtual Node Ptr read( std::istream &is,186 const Char8 *fileNameOrExtension) const;185 virtual NodeTransitPtr read( std::istream &is, 186 const Char8 *fileNameOrExtension) const; 187 187 188 188 /*------------------------- your_category -------------------------------*/ trunk/Source/System/FileIO/Collada/OSGColladaIntegration.cpp
r887 r1190 188 188 VisualSceneIntegration::~VisualSceneIntegration(void) 189 189 { 190 OSG::subRef(_pScene);190 _pScene = NULL; 191 191 } 192 192 … … 322 322 _pTransform = Transform::create(); 323 323 324 OSG::addRef(_pTransform);325 326 324 _pNode->setCore(_pTransform); 327 325 } … … 354 352 { 355 353 _pTransform = Transform::create(); 356 357 OSG::addRef(_pTransform);358 354 359 355 _pNode->setCore(_pTransform); … … 392 388 _pTransform = Transform::create(); 393 389 394 OSG::addRef(_pTransform);395 396 390 _pNode->setCore(_pTransform); 397 391 } … … 453 447 NodeIntegration::~NodeIntegration(void) 454 448 { 455 OSG::subRef(_pNode );456 OSG::subRef(_pTransform);449 _pNode = NULL; 450 _pTransform = NULL; 457 451 } 458 452 … … 503 497 504 498 _pNode = Node::create(); 505 506 OSG::addRef(_pNode);507 499 508 500 daeMetaElement *pMeta = _pElement->getMeta(); … … 565 557 InstanceIntegration::~InstanceIntegration(void) 566 558 { 567 OSG::subRef(_pNode);568 } 569 570 Node Ptr InstanceIntegration::getInstance(void)559 _pNode = NULL; 560 } 561 562 NodeTransitPtr InstanceIntegration::getInstance(void) 571 563 { 572 564 if(_pNode == NullFC) 573 return N ullFC;565 return NodeTransitPtr(NullFC); 574 566 575 567 if(_uiCount == 0) … … 577 569 ++_uiCount; 578 570 579 return _pNode;571 return NodeTransitPtr(_pNode); 580 572 } 581 573 else … … 934 926 for(UInt32 i = 0; i < geoIt->second.size(); ++i) 935 927 { 936 MaterialGroup Ptr pMatGroup = MaterialGroup::create();937 Node Ptr pMatGroupNode = Node ::create();938 939 Node Ptr pGeoNode = Node ::create();928 MaterialGroupUnrecPtr pMatGroup = MaterialGroup::create(); 929 NodeUnrecPtr pMatGroupNode = Node ::create(); 930 931 NodeUnrecPtr pGeoNode = Node ::create(); 940 932 941 933 #ifdef OSG_DEBUG_PRINT … … 979 971 domInputLocal_Array &aVertexInput, 980 972 domInputLocalOffset_Array &aInput, 981 GeoUInt32Property Ptr&pLengthsOut,982 GeoUInt8Property Ptr&pTypesOut,973 GeoUInt32PropertyUnrecPtr &pLengthsOut, 974 GeoUInt8PropertyUnrecPtr &pTypesOut, 983 975 PropVec &vPropVecOut ) 984 976 { … … 1035 1027 SemanticToPropGeoIndex(aInput[i]->getSemantic()); 1036 1028 1037 GeoUInt32Property Ptr pProp = GeoUInt32Property::create();1038 GeoVectorProperty Ptr pVProp = NullFC;1029 GeoUInt32PropertyUnrecPtr pProp = GeoUInt32Property::create(); 1030 GeoVectorPropertyUnrecPtr pVProp = NullFC; 1039 1031 1040 1032 if(uiPropIdx == 0xFFFE) … … 1126 1118 else 1127 1119 { 1128 OSG::subRef(pProp);1120 pProp = NullFC; 1129 1121 } 1130 1122 } … … 1182 1174 { 1183 1175 vPropVecOut[aInput[i]->getOffset()] = 1184 static_ cast<GeoUInt32PropertyPtr>(1176 static_pointer_cast<GeoUInt32Property>( 1185 1177 propIt->second.first); 1186 1178 } … … 1201 1193 domInputLocalOffset_Array &aInput = pPoly->getInput_array(); 1202 1194 1203 GeoUInt32Property PtrpLengths = NullFC;1204 GeoUInt8Property PtrpTypes = NullFC;1195 GeoUInt32PropertyUnrecPtr pLengths = NullFC; 1196 GeoUInt8PropertyUnrecPtr pTypes = NullFC; 1205 1197 1206 1198 PropVec aProps; … … 1253 1245 domInputLocalOffset_Array &aInput = pPoly->getInput_array(); 1254 1246 1255 GeoUInt32Property PtrpLengths = NullFC;1256 GeoUInt8Property PtrpTypes = NullFC;1247 GeoUInt32PropertyUnrecPtr pLengths = NullFC; 1248 GeoUInt8PropertyUnrecPtr pTypes = NullFC; 1257 1249 1258 1250 PropVec aProps; … … 1298 1290 domInputLocalOffset_Array &aInput = pTriangles->getInput_array(); 1299 1291 1300 GeoUInt32Property PtrpLengths = NullFC;1301 GeoUInt8Property PtrpTypes = NullFC;1292 GeoUInt32PropertyUnrecPtr pLengths = NullFC; 1293 GeoUInt8PropertyUnrecPtr pTypes = NullFC; 1302 1294 1303 1295 PropVec aProps; … … 1610 1602 SourceIntegration::~SourceIntegration(void) 1611 1603 { 1612 OSG::subRef(_pVec3fProp);1613 OSG::subRef(_pPnt3fProp);1614 OSG::subRef(_pVec2fProp);1604 _pVec3fProp = NULL; 1605 _pPnt3fProp = NULL; 1606 _pVec2fProp = NULL; 1615 1607 } 1616 1608 … … 1672 1664 1673 1665 _pVec3fProp = GeoVec3fProperty::create(); 1674 1675 OSG::addRef(_pVec3fProp);1676 1666 1677 1667 UInt32 uiCurr = 0; … … 1709 1699 _pPnt3fProp = GeoPnt3fProperty::create(); 1710 1700 1711 OSG::addRef(_pPnt3fProp);1712 1713 1701 UInt32 uiCurr = 0; 1714 1702 Vec3f tmpVec; … … 1744 1732 1745 1733 _pVec2fProp = GeoVec2fProperty::create(); 1746 1747 OSG::addRef(_pVec2fProp);1748 1734 1749 1735 UInt32 uiCurr = 0; … … 1780 1766 Real32 fTransparency) 1781 1767 { 1782 MaterialChunk Ptr pMatChunk = MaterialChunk::create();1768 MaterialChunkUnrecPtr pMatChunk = MaterialChunk::create(); 1783 1769 1784 1770 Color4f colVal; … … 1937 1923 if(pTexObj != NULL) 1938 1924 { 1939 TextureEnvChunk Ptr pTexEnv = TextureEnvChunk::create();1925 TextureEnvChunkUnrecPtr pTexEnv = TextureEnvChunk::create(); 1940 1926 1941 1927 _pMaterial->addChunk(pTexObj); … … 1994 1980 if(pImage != NullFC) 1995 1981 { 1996 TextureObjChunk Ptr pTexObj = TextureObjChunk::create();1997 TextureEnvChunk Ptr pTexEnv = TextureEnvChunk::create();1982 TextureObjChunkUnrecPtr pTexObj = TextureObjChunk::create(); 1983 TextureEnvChunkUnrecPtr pTexEnv = TextureEnvChunk::create(); 1998 1984 1999 1985 pTexObj->setImage(pImage); … … 2043 2029 if(pTexObj != NULL) 2044 2030 { 2045 TextureEnvChunk Ptr pTexEnv = TextureEnvChunk::create();2031 TextureEnvChunkUnrecPtr pTexEnv = TextureEnvChunk::create(); 2046 2032 2047 2033 _pMaterial->addChunk(pTexObj); … … 2100 2086 if(pImage != NullFC) 2101 2087 { 2102 TextureObjChunk Ptr pTexObj = TextureObjChunk::create();2103 TextureEnvChunk Ptr pTexEnv = TextureEnvChunk::create();2088 TextureObjChunkUnrecPtr pTexObj = TextureObjChunk::create(); 2089 TextureEnvChunkUnrecPtr pTexEnv = TextureEnvChunk::create(); 2104 2090 2105 2091 pTexObj->setImage(pImage); … … 2276 2262 EffectIntegration::~EffectIntegration(void) 2277 2263 { 2278 OSG::subRef(_pMaterial);2264 _pMaterial = NULL; 2279 2265 } 2280 2266 … … 2436 2422 ImageIntegration::~ImageIntegration(void) 2437 2423 { 2438 OSG::subRef(_pImage);2424 _pImage = NULL; 2439 2425 } 2440 2426 … … 2510 2496 fprintf(stderr, "Image loaded\n"); 2511 2497 #endif 2512 OSG::addRef(_pImage);2513 2498 } 2514 2499 } … … 2535 2520 Sampler2DIntegration::~Sampler2DIntegration(void) 2536 2521 { 2537 OSG::subRef(_pTexObj);2522 _pTexObj = NULL; 2538 2523 } 2539 2524 … … 2639 2624 2640 2625 _pTexObj = pSurfaceInt->getTexObj(); 2641 2642 OSG::addRef(_pTexObj);2643 2626 } 2644 2627 … … 2664 2647 SurfaceIntegration::~SurfaceIntegration(void) 2665 2648 { 2666 OSG::subRef(_pTexObj);2649 _pTexObj = NULL; 2667 2650 } 2668 2651 trunk/Source/System/FileIO/Collada/OSGColladaIntegration.h
r829 r1190 156 156 static daeMetaElement *_pMeta; 157 157 158 Node Ptr _pScene;158 NodeUnrecPtr _pScene; 159 159 160 160 public: … … 188 188 static daeMetaElement *_pMeta; 189 189 190 Node Ptr _pNode;191 Transform Ptr _pTransform;190 NodeUnrecPtr _pNode; 191 TransformUnrecPtr _pTransform; 192 192 193 193 bool handleNode (daeElementRef pElem); … … 225 225 typedef ColladaIntegrationBase Inherited; 226 226 227 Node Ptr _pNode;228 UInt32 _uiCount;227 NodeUnrecPtr _pNode; 228 UInt32 _uiCount; 229 229 230 230 public: … … 233 233 ~InstanceIntegration(void); 234 234 235 Node Ptr getInstance(void);235 NodeTransitPtr getInstance(void); 236 236 }; 237 237 … … 252 252 253 253 254 typedef std::pair <GeoIntegralProperty Ptr,255 GeoVectorProperty Ptr> PropIndexPair;254 typedef std::pair <GeoIntegralPropertyUnrecPtr, 255 GeoVectorPropertyUnrecPtr > PropIndexPair; 256 256 257 257 typedef std::map <std::string, 258 PropIndexPair > PropIndexMap;258 PropIndexPair > PropIndexMap; 259 259 typedef std::map <std::string, 260 PropIndexPair >::iterator PropIndexMapIt;260 PropIndexPair >::iterator PropIndexMapIt; 261 261 262 262 … … 264 264 struct GeometryInfo 265 265 { 266 Geometry PtrpGeo;267 PropIndexMap _mPropIndexMap;266 GeometryUnrecPtr pGeo; 267 PropIndexMap _mPropIndexMap; 268 268 }; 269 269 … … 289 289 domInputLocal_Array &aVertexInput, 290 290 domInputLocalOffset_Array &aInput, 291 GeoUInt32Property Ptr&pLengthsOut,292 GeoUInt8Property Ptr&pTypesOut,291 GeoUInt32PropertyUnrecPtr &pLengthsOut, 292 GeoUInt8PropertyUnrecPtr &pTypesOut, 293 293 PropVec &pPropVecOut ); 294 294 … … 382 382 static daeMetaElement *_pMeta; 383 383 384 GeoVec3fProperty Ptr _pVec3fProp;385 GeoPnt3fProperty Ptr _pPnt3fProp;386 GeoVec2fProperty Ptr _pVec2fProp;384 GeoVec3fPropertyUnrecPtr _pVec3fProp; 385 GeoPnt3fPropertyUnrecPtr _pPnt3fProp; 386 GeoVec2fPropertyUnrecPtr _pVec2fProp; 387 387 388 388 public: … … 422 422 typedef ColladaIntegrationBase Inherited; 423 423 424 static daeMetaElement *_pMeta;425 ChunkMaterial Ptr _pMaterial;424 static daeMetaElement *_pMeta; 425 ChunkMaterialUnrecPtr _pMaterial; 426 426 427 427 std::vector<std::string> _vTexCoordMapping; … … 489 489 static daeMetaElement *_pMeta; 490 490 491 Image Ptr_pImage;491 ImageUnrecPtr _pImage; 492 492 493 493 public: … … 520 520 typedef ColladaIntegrationBase Inherited; 521 521 522 static daeMetaElement *_pMeta;523 524 static EffectIntegration *_pEffectInt;525 526 TextureObjChunk Ptr_pTexObj;522 static daeMetaElement *_pMeta; 523 524 static EffectIntegration *_pEffectInt; 525 526 TextureObjChunkUnrecPtr _pTexObj; 527 527 528 528 public: … … 557 557 typedef ColladaIntegrationBase Inherited; 558 558 559 static daeMetaElement *_pMeta;560 561 TextureObjChunk Ptr_pTexObj;559 static daeMetaElement *_pMeta; 560 561 TextureObjChunkUnrecPtr _pTexObj; 562 562 563 563 public: trunk/Source/System/FileIO/Collada/OSGColladaLoader.cpp
r829 r1190 122 122 } 123 123 124 Node Ptr ColladaLoader::read( std::istream &is,125 const Char8 *szFileName)124 NodeTransitPtr ColladaLoader::read( std::istream &is, 125 const Char8 *szFileName) 126 126 { 127 Node Ptr returnValue = NullFC;127 NodeTransitPtr returnValue(NullFC); 128 128 129 129 #ifdef OSG_WITH_COLLADA … … 229 229 #endif 230 230 231 pInput->clear(); 232 233 pInput->setDatabase(NULL); 234 235 delete pDataBase; 236 delete pInput; 237 238 daeMetaElement::releaseMetas(); 239 231 240 return returnValue; 232 241 } trunk/Source/System/FileIO/Collada/OSGColladaLoader.h
r785 r1190 187 187 /*------------------------- your_operators ------------------------------*/ 188 188 189 virtual Node Ptr read( std::istream &is,190 const Char8 *szFileName);189 virtual NodeTransitPtr read( std::istream &is, 190 const Char8 *szFileName); 191 191 192 192 /*------------------------- your_operators ------------------------------*/
