| 685 | } |
| 686 | |
| 687 | Expected<void> Node::loadTexture2dGroup_( ThreeMFLoader& loader, const tinyxml2::XMLElement* xmlNode ) |
| 688 | { |
| 689 | if ( tinyxml2::XML_SUCCESS != xmlNode->QueryIntAttribute( "texid", &texId_ ) ) |
| 690 | return unexpected( std::string( "3DF model texture2d group node does not have 'texid' attribute" ) ); |
| 691 | |
| 692 | auto nodeRes = loader.getNodeById_( texId_ ); |
| 693 | if ( !nodeRes.has_value() ) |
| 694 | return unexpected( std::string( "3DF model has incorrect 'texid' attribute" ) ); |
| 695 | |
| 696 | #if TINYXML2_MAJOR_VERSION > 10 |
| 697 | uvGroup_.reserve( xmlNode->ChildElementCount( "m:tex2coord" ) ); |
| 698 | #endif |
| 699 | for ( auto coordNode = xmlNode->FirstChildElement( "m:tex2coord" ); coordNode; coordNode = coordNode->NextSiblingElement( "m:tex2coord" ) ) |
| 700 | { |
| 701 | auto& uv = uvGroup_.emplace_back(); |
| 702 | if ( tinyxml2::XML_SUCCESS != coordNode->QueryFloatAttribute( "u", &uv.x ) ) |
| 703 | return unexpected( std::string( "3DF model tex2coord node does not have 'u' attribute" ) ); |
| 704 | if ( tinyxml2::XML_SUCCESS != coordNode->QueryFloatAttribute( "v", &uv.y ) ) |
| 705 | return unexpected( std::string( "3DF model tex2coord node does not have 'v' attribute" ) ); |
| 706 | } |
| 707 | return {}; |
| 708 | } |
| 709 | |
| 710 | Expected<void> Node::loadMesh_( ThreeMFLoader& loader, const tinyxml2::XMLElement* meshNode, const ProgressCallback& callback ) |
| 711 | { |
nothing calls this directly
no test coverage detected