7#include <Core/Asset/AnimationData.hpp>
8#include <Core/Asset/Camera.hpp>
9#include <Core/Asset/GeometryData.hpp>
10#include <Core/Asset/HandleData.hpp>
11#include <Core/Asset/LightData.hpp>
12#include <Core/Asset/VolumeData.hpp>
13#include <Core/RaCore.hpp>
14#include <Core/Utils/Log.hpp>
20class RA_CORE_API FileData final
24 FileData(
const std::string& filename =
"",
const bool VERBOSE_MODE =
false );
26 FileData( FileData&& data ) =
default;
34 inline void setFileName(
const std::string& filename );
37 inline Scalar getLoadingTime()
const;
47 inline void setVerbose(
const bool VERBOSE_MODE );
50 inline bool isInitialized()
const;
51 inline bool isProcessed()
const;
52 inline bool hasGeometry()
const;
53 inline bool hasHandle()
const;
54 inline bool hasAnimation()
const;
55 inline bool hasLight()
const;
56 inline bool hasCamera()
const;
57 inline bool isVerbose()
const;
62 inline void displayInfo()
const;
84inline void FileData::setFileName(
const std::string& filename ) {
85 m_filename = filename;
89inline Scalar FileData::getLoadingTime()
const {
96 list.
reserve( m_geometryData.size() );
97 for (
const auto& item : m_geometryData ) {
105 list.
reserve( m_volumeData.size() );
106 for (
const auto& item : m_volumeData ) {
114 list.
reserve( m_handleData.size() );
115 for (
const auto& item : m_handleData ) {
123 list.
reserve( m_animationData.size() );
124 for (
const auto& item : m_animationData ) {
132 list.
reserve( m_lightData.size() );
133 for (
const auto& item : m_lightData ) {
141 list.
reserve( m_cameraData.size() );
142 for (
const auto& item : m_cameraData ) {
148inline void FileData::setVerbose(
const bool VERBOSE_MODE ) {
149 m_verbose = VERBOSE_MODE;
153inline bool FileData::isInitialized()
const {
154 return ( ( m_filename !=
"" ) && !m_processed );
157inline bool FileData::isProcessed()
const {
161inline bool FileData::hasGeometry()
const {
162 return ( !m_geometryData.empty() );
165inline bool FileData::hasHandle()
const {
166 return ( !m_handleData.empty() );
169inline bool FileData::hasAnimation()
const {
170 return ( !m_animationData.empty() );
173inline bool FileData::hasLight()
const {
174 return ( !m_lightData.empty() );
177inline bool FileData::isVerbose()
const {
182inline void FileData::reset() {
184 m_geometryData.
clear();
185 m_handleData.clear();
186 m_animationData.clear();
190inline void FileData::displayInfo()
const {
191 using namespace Core::Utils;
192 uint64_t vtxCount = 0;
193 for (
const auto& geom : m_geometryData ) {
194 vtxCount += geom->getGeometry().vertices().size();
196 LOG( logINFO ) <<
"======== LOADING SUMMARY ========";
197 LOG( logINFO ) <<
"Mesh loaded : " << m_geometryData.size();
198 LOG( logINFO ) <<
"Total vertex count : " << vtxCount;
199 LOG( logINFO ) <<
"Handle loaded : " << m_handleData.size();
200 LOG( logINFO ) <<
"Animation loaded : " << m_animationData.size();
201 LOG( logINFO ) <<
"Volume loaded : " << m_volumeData.size();
202 LOG( logINFO ) <<
"Loading Time (sec) : " << m_loadingTime;
hepler function to manage enum as underlying types in VariableSet