Loading [MathJax]/extensions/TeX/AMSmath.js
Radium Engine  1.5.26
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GeometryData.cpp
1#include <Core/Asset/GeometryData.hpp>
2#include <Core/Geometry/StandardAttribNames.hpp>
3#include <Core/Utils/Attribs.hpp>
4#include <Core/Utils/ContainerIntrospectionInterface.hpp>
5#include <Core/Utils/Log.hpp>
6#include <ostream>
7#include <stddef.h>
8
9namespace Ra {
10namespace Core {
11namespace Asset {
12
13GeometryData::GeometryData( const std::string& name, const GeometryType& type ) :
14 AssetData( name ),
15 m_frame( Transform::Identity() ),
16 m_type( type ),
17 m_geometry(),
18 m_material() {}
19
20GeometryData::~GeometryData() {}
21
22void GeometryData::displayInfo() const {
23 using namespace Core::Utils; // log
24 std::string type;
25 switch ( m_type ) {
26 case POINT_CLOUD:
27 type = "POINT CLOUD";
28 break;
29 case LINE_MESH:
30 type = "LINE MESH";
31 break;
32 case TRI_MESH:
33 type = "TRIANGLE MESH";
34 break;
35 case QUAD_MESH:
36 type = "QUAD MESH";
37 break;
38 case POLY_MESH:
39 type = "POLY MESH";
40 break;
41 case TETRA_MESH:
42 type = "TETRA MESH";
43 break;
44 case HEX_MESH:
45 type = "HEX MESH";
46 break;
47 case UNKNOWN:
48 default:
49 type = "UNKNOWN";
50 break;
51 }
52
53 auto attribSize = [this]( Geometry::MeshAttrib a ) -> size_t {
54 const auto& name = getAttribName( a );
55 return getGeometry().hasAttrib( name ) ? getGeometry().getAttribBase( name )->getSize() : 0;
56 };
57
58 auto hasAttrib = [this]( Geometry::MeshAttrib a ) -> std::string {
59 return getGeometry().hasAttrib( getAttribName( a ) ) ? "YES" : "NO";
60 };
61
62 using namespace Geometry;
63 LOG( logINFO ) << "======== MESH INFO ========";
64 LOG( logINFO ) << " Name : " << m_name;
65 LOG( logINFO ) << " Type : " << type;
66 LOG( logINFO ) << " Edge # : " << ( hasEdges() ? getPrimitiveCount() : 0 );
67 LOG( logINFO ) << " Face # : " << ( hasFaces() ? getPrimitiveCount() : 0 );
68 LOG( logINFO ) << " Vertex # : " << attribSize( MeshAttrib::VERTEX_POSITION );
69 LOG( logINFO ) << " Normal ? : " << hasAttrib( MeshAttrib::VERTEX_NORMAL );
70 LOG( logINFO ) << " Tangent ? : " << hasAttrib( MeshAttrib::VERTEX_TANGENT );
71 LOG( logINFO ) << " Bitangent ? : " << hasAttrib( MeshAttrib::VERTEX_BITANGENT );
72 LOG( logINFO ) << " Tex.Coord. ? : " << hasAttrib( MeshAttrib::VERTEX_TEXCOORD );
73 LOG( logINFO ) << " Color ? : " << hasAttrib( MeshAttrib::VERTEX_COLOR );
74 LOG( logINFO ) << " Material ? : " << ( ( !hasMaterial() ) ? "NO" : "YES" );
75
76 if ( hasMaterial() ) { m_material->displayInfo(); }
77}
78} // namespace Asset
79} // namespace Core
80} // namespace Ra
@ Geometry
"Geometry" render objects are those loaded using Radium::IO and generated by GeometrySystem
hepler function to manage enum as underlying types in VariableSet
Definition Cage.cpp:4