Changeset 13041 for OpenSceneGraph/trunk/src/osgPlugins/dae/daeWriter.cpp
- Timestamp:
- 03/21/12 18:36:20 (15 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgPlugins/dae/daeWriter.cpp
r12416 r13041 2 2 * Copyright 2006 Sony Computer Entertainment Inc. 3 3 * 4 * Licensed under the SCEA Shared Source License, Version 1.0 (the "License"); you may not use this 4 * Licensed under the SCEA Shared Source License, Version 1.0 (the "License"); you may not use this 5 5 * file except in compliance with the License. You may obtain a copy of the License at: 6 6 * http://research.scea.com/scea_shared_source_license.html 7 7 * 8 * Unless required by applicable law or agreed to in writing, software distributed under the License 9 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 10 * implied. See the License for the specific language governing permissions and limitations under the 11 * License. 8 * Unless required by applicable law or agreed to in writing, software distributed under the License 9 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 10 * implied. See the License for the specific language governing permissions and limitations under the 11 * License. 12 12 */ 13 13 … … 240 240 c->setValue( "2006-07-25T00:00:00Z" ); 241 241 m->setValue( "2006-07-25T00:00:00Z" ); 242 242 243 243 u->setName( "meter" ); 244 244 u->setMeter( 1 ); … … 278 278 279 279 280 // get description info as name value pairs 280 // get description info as name value pairs 281 281 if (node.getDescriptions().size()%2 == 0) 282 282 { … … 287 287 std::string attrName( *ditr ); ++ditr; 288 288 std::string attrValue( *ditr ); 289 289 290 290 if (attrName=="collada_created" && !attrValue.empty()) 291 291 { 292 292 c->setValue( attrValue.c_str() ); 293 } 293 } 294 294 else if (attrName=="collada_modified" && !attrValue.empty()) 295 295 { 296 296 m->setValue( attrValue.c_str() ); 297 } 297 } 298 298 else if (attrName=="collada_keywords" && !attrValue.empty()) 299 299 { … … 352 352 else if (attrName=="collada_contributor{0}.author" && !attrValue.empty()) 353 353 { 354 domAsset::domContributor::domAuthor *author = 354 domAsset::domContributor::domAuthor *author = 355 355 daeSafeCast< domAsset::domContributor::domAuthor >(contributor->add("author" )); 356 356 author->setValue( attrValue.c_str() ); … … 358 358 else if (attrName=="collada_contributor{0}.authoring_tool" && !attrValue.empty()) 359 359 { 360 domAsset::domContributor::domAuthoring_tool *authoring_tool = 360 domAsset::domContributor::domAuthoring_tool *authoring_tool = 361 361 daeSafeCast< domAsset::domContributor::domAuthoring_tool >(contributor->add("authoring_tool" )); 362 362 authoring_tool->setValue( attrValue.c_str() ); … … 364 364 else if (attrName=="collada_contributor{0}.comments" && !attrValue.empty()) 365 365 { 366 domAsset::domContributor::domComments *comments = 366 domAsset::domContributor::domComments *comments = 367 367 daeSafeCast< domAsset::domContributor::domComments >(contributor->add("comments" )); 368 368 comments->setValue( attrValue.c_str() ); … … 370 370 else if (attrName=="collada_contributor{0}.source_data" && !attrValue.empty()) 371 371 { 372 domAsset::domContributor::domSource_data *source_data = 372 domAsset::domContributor::domSource_data *source_data = 373 373 daeSafeCast< domAsset::domContributor::domSource_data >(contributor->add("source_data" )); 374 374 source_data->setValue( attrValue.c_str() ); … … 376 376 else if (attrName=="collada_contributor{0}.copyright" && !attrValue.empty()) 377 377 { 378 domAsset::domContributor::domCopyright *copyright = 378 domAsset::domContributor::domCopyright *copyright = 379 379 daeSafeCast< domAsset::domContributor::domCopyright >(contributor->add("copyright" )); 380 380 copyright->setValue( attrValue.c_str() ); 381 381 } 382 382 383 383 // TODO: handle array of contributor data rather that just the first. 384 384 // also there is probably a better way to pass attribute data as DescriptionList is a bit fragile … … 402 402 // Save our current stateset 403 403 stateSetStack.push(currentStateSet.get()); 404 404 405 405 // merge with node stateset 406 406 currentStateSet = static_cast<osg::StateSet*>(currentStateSet->clone(osg::CopyOp::SHALLOW_COPY)); 407 currentStateSet->merge(*ss); 407 currentStateSet->merge(*ss); 408 408 } 409 409 }
