1 #include "Core/Geometry/StandardAttribNames.hpp"
2 #include <Core/Asset/GeometryData.hpp>
4 #include <Core/Utils/Log.hpp>
10 GeometryData::GeometryData(
const std::string& name,
const GeometryType& type ) :
12 m_frame( Transform::Identity() ),
17 GeometryData::~GeometryData() {}
19 void GeometryData::displayInfo()
const {
20 using namespace Core::Utils;
30 type =
"TRIANGLE MESH";
50 auto attribSize = [
this]( Geometry::MeshAttrib a ) ->
size_t {
51 const auto& name = getAttribName( a );
52 return getGeometry().hasAttrib( name ) ? getGeometry().getAttribBase( name )->getSize() : 0;
55 auto hasAttrib = [
this]( Geometry::MeshAttrib a ) -> std::string {
56 return getGeometry().hasAttrib( getAttribName( a ) ) ?
"YES" :
"NO";
59 using namespace Geometry;
60 LOG( logINFO ) <<
"======== MESH INFO ========";
61 LOG( logINFO ) <<
" Name : " << m_name;
62 LOG( logINFO ) <<
" Type : " << type;
63 LOG( logINFO ) <<
" Edge # : " << ( hasEdges() ? getPrimitiveCount() : 0 );
64 LOG( logINFO ) <<
" Face # : " << ( hasFaces() ? getPrimitiveCount() : 0 );
65 LOG( logINFO ) <<
" Vertex # : " << attribSize( MeshAttrib::VERTEX_POSITION );
66 LOG( logINFO ) <<
" Normal ? : " << hasAttrib( MeshAttrib::VERTEX_NORMAL );
67 LOG( logINFO ) <<
" Tangent ? : " << hasAttrib( MeshAttrib::VERTEX_TANGENT );
68 LOG( logINFO ) <<
" Bitangent ? : " << hasAttrib( MeshAttrib::VERTEX_BITANGENT );
69 LOG( logINFO ) <<
" Tex.Coord. ? : " << hasAttrib( MeshAttrib::VERTEX_TEXCOORD );
70 LOG( logINFO ) <<
" Color ? : " << hasAttrib( MeshAttrib::VERTEX_COLOR );
71 LOG( logINFO ) <<
" Material ? : " << ( ( !hasMaterial() ) ?
"NO" :
"YES" );
73 if ( hasMaterial() ) { m_material->displayInfo(); }