3#include <Core/Asset/AssetData.hpp>
4#include <Core/Containers/AlignedStdVector.hpp>
5#include <Core/CoreMacros.hpp>
6#include <Core/RaCore.hpp>
8#include <Core/Utils/Log.hpp>
9#include <Eigen/Geometry>
33 Core::Transform m_frame { Core::Transform::Identity() };
51 enum HandleType { UNKNOWN = 1 << 0, POINT_CLOUD = 1 << 1, SKELETON = 1 << 2, CAGE = 1 << 3 };
70 inline HandleType getType()
const;
75 inline void setType(
const HandleType& type );
80 inline Core::Transform getFrame()
const;
85 inline void setFrame(
const Core::Transform& frame );
101 inline uint getVertexSize()
const;
106 inline void setVertexSize( uint size );
116 inline void recomputeAllIndices();
124 inline uint getComponentDataSize()
const;
184 inline void needEndNodes(
bool need );
193 inline bool isPointCloud()
const;
198 inline bool isSkeleton()
const;
203 inline bool isCage()
const;
208 inline bool hasComponents()
const;
213 inline bool hasEdges()
const;
218 inline bool hasFaces()
const;
223 inline bool needsEndNodes()
const;
229 inline int getIndexOf(
const std::string& name )
const;
235 inline void displayInfo()
const;
242 Core::Transform m_frame { Core::Transform::Identity() };
245 bool m_endNode {
false };
248 uint m_vertexSize { 0 };
257 Core::AlignedStdVector<HandleComponentData> m_component;
260 Core::AlignedStdVector<Core::Vector2ui> m_edge;
263 Core::AlignedStdVector<Core::VectorNui> m_face;
294 m_nameTable = nameTable;
298 return m_component.size();
311 const uint size = components.
size();
312 m_component.resize( size );
313#pragma omp parallel for
314 for (
int i = 0; i < int( size ); ++i ) {
315 m_component[i] = components[i];
320 CORE_ASSERT( ( i < m_component.size() ),
"Index i out of bound" );
321 return m_component[i];
325 CORE_ASSERT( ( i < m_component.size() ),
"Index i out of bound" );
326 return m_component[i];
338 const uint size = edgeList.
size();
339 m_edge.resize( size );
340#pragma omp parallel for
341 for (
int i = 0; i < int( size ); ++i ) {
342 m_edge[i] = edgeList[i];
355 const uint size = faceList.
size();
356 m_face.resize( size );
357#pragma omp parallel for
358 for (
int i = 0; i < int( size ); ++i ) {
359 m_face[i] = faceList[i];
366 m_nameTable[m_component[i].m_name] = i;
371 return ( m_type == POINT_CLOUD );
375 return ( m_type == SKELETON );
379 return ( m_type == CAGE );
383 return !m_component.empty();
387 return !m_edge.empty();
391 return !m_face.empty();
399 auto it = m_nameTable.
find( name );
400 if ( it == m_nameTable.
end() ) {
return -1; }
409 m_bindMeshes.
insert( name );
417 using namespace Core::Utils;
421 type =
"POINT CLOUD";
434 LOG( logINFO ) <<
"======== HANDLE INFO ========";
435 LOG( logINFO ) <<
" Name : " << m_name;
436 LOG( logINFO ) <<
" Type : " << type;
437 LOG( logINFO ) <<
" Element # : " << m_component.size();
438 LOG( logINFO ) <<
" Edge # : " << m_edge.size();
439 LOG( logINFO ) <<
" Face # : " << m_face.size();
440 LOG( logINFO ) <<
" Need EndNodes ? : " << ( ( m_endNode ) ?
"YES" :
"NO" );
void setNameTable(const std::map< std::string, uint > &nameTable)
uint getVertexSize() const
uint getComponentDataSize() const
const Core::AlignedStdVector< HandleComponentData > & getComponentData() const
bool needsEndNodes() const
int getIndexOf(const std::string &name) const
void recomputeAllIndices()
void setFrame(const Core::Transform &frame)
void setEdges(const Core::AlignedStdVector< Core::Vector2ui > &edgeList)
bool isPointCloud() const
const Core::AlignedStdVector< Core::VectorNui > & getFaceData() const
void setType(const HandleType &type)
const std::set< std::string > & getBindMeshes() const
const Core::AlignedStdVector< Core::Vector2ui > & getEdgeData() const
HandleType getType() const
void needEndNodes(bool need)
void addBindMesh(const std::string &name)
void setFaces(const Core::AlignedStdVector< Core::VectorNui > &faceList)
const HandleComponentData & getComponent(const uint i) const
Core::Transform getFrame() const
void setComponents(const Core::AlignedStdVector< HandleComponentData > &components)
bool hasComponents() const
void setVertexSize(uint size)
void setName(const std::string &name)
hepler function to manage enum as underlying types in VariableSet
std::map< std::string, Core::Transform > m_bindMatrices
Per skinned-mesh matrix from mesh space to bone space (local).
std::map< std::string, std::vector< std::pair< uint, Scalar > > > m_weights
Per skinned-mesh vertex weigths.
std::string m_name
Handle name.