Assimp  v4.1. (December 2018)
BlenderCustomData.cpp File Reference

Classes

struct  Assimp::Blender::CustomDataTypeDescription
 describes the size of data and the read function to be used for single CustomerData.type More...
 

Namespaces

 Assimp
 MACHINE-GENERATED by scripts/ICFImporter/CppGenerator.py.
 
 Assimp::Blender
 

Macros

#define DECL_STRUCT_CUSTOMDATATYPEDESCRIPTION(ty)   CustomDataTypeDescription{&read##ty, &create##ty, &destroy##ty}
 helper macro to define Structure type specific CustomDataTypeDescription More...
 
#define DECL_UNSUPPORTED_CUSTOMDATATYPEDESCRIPTION   CustomDataTypeDescription{nullptr, nullptr, nullptr}
 helper macro to define CustomDataTypeDescription for UNSUPPORTED type More...
 
#define IMPL_STRUCT(ty)
 helper macro to define Structure functions More...
 
#define IMPL_STRUCT_CREATE(ty)
 
#define IMPL_STRUCT_DESTROY(ty)
 
#define IMPL_STRUCT_READ(ty)
 

Typedefs

typedef ElemBase *(* Assimp::Blender::PCreate) (const size_t cnt)
 
typedef void(* Assimp::Blender::PDestroy) (ElemBase *)
 
typedef bool(* Assimp::Blender::PRead) (ElemBase *pOut, const size_t cnt, const FileDatabase &db)
 pointer to function read memory for n CustomData types More...
 

Functions

std::shared_ptr< CustomDataLayer > Assimp::Blender::getCustomDataLayer (const CustomData &customdata, CustomDataType cdtype, const std::string &name)
 returns CustomDataLayer ptr for given cdtype and name More...
 
const ElemBase * Assimp::Blender::getCustomDataLayerData (const CustomData &customdata, CustomDataType cdtype, const std::string &name)
 returns CustomDataLayer data ptr for given cdtype and name More...
 
bool Assimp::Blender::isValidCustomDataType (const int cdtype)
 check if given cdtype is valid (ie >= 0 and < CD_NUMTYPES) More...
 
template<typename T >
bool Assimp::Blender::read (const Structure &s, T *p, const size_t cnt, const FileDatabase &db)
 read/convert of Structure array to memory More...
 
bool Assimp::Blender::readCustomData (std::shared_ptr< ElemBase > &out, int cdtype, size_t cnt, const FileDatabase &db)
 read CustomData's data to ptr to mem More...
 

Variables

std::array< CustomDataTypeDescription, CD_NUMTYPES > Assimp::Blender::customDataTypeDescriptions
 descriptors for data pointed to from CustomDataLayer.data More...
 

Macro Definition Documentation

◆ DECL_STRUCT_CUSTOMDATATYPEDESCRIPTION

#define DECL_STRUCT_CUSTOMDATATYPEDESCRIPTION (   ty)    CustomDataTypeDescription{&read##ty, &create##ty, &destroy##ty}

helper macro to define Structure type specific CustomDataTypeDescription

Note
IMPL_STRUCT_READ for same ty must be used earlier to implement the typespecific read function

◆ DECL_UNSUPPORTED_CUSTOMDATATYPEDESCRIPTION

#define DECL_UNSUPPORTED_CUSTOMDATATYPEDESCRIPTION   CustomDataTypeDescription{nullptr, nullptr, nullptr}

helper macro to define CustomDataTypeDescription for UNSUPPORTED type

◆ IMPL_STRUCT

#define IMPL_STRUCT (   ty)
Value:
IMPL_STRUCT_CREATE(ty) \
IMPL_STRUCT_DESTROY(ty)
#define IMPL_STRUCT_READ(ty)
Definition: BlenderCustomData.cpp:29

helper macro to define Structure functions

◆ IMPL_STRUCT_CREATE

#define IMPL_STRUCT_CREATE (   ty)
Value:
ElemBase *create##ty(const size_t cnt) { \
return new ty[cnt]; \
}

◆ IMPL_STRUCT_DESTROY

#define IMPL_STRUCT_DESTROY (   ty)
Value:
void destroy##ty(ElemBase *pE) { \
ty *p = dynamic_cast<ty *>(pE); \
delete[]p; \
}
IfcVector3 p[3]
Definition: IFCCurve.cpp:98

◆ IMPL_STRUCT_READ

#define IMPL_STRUCT_READ (   ty)
Value:
bool read##ty(ElemBase *v, const size_t cnt, const FileDatabase &db) { \
ty *ptr = dynamic_cast<ty*>(v); \
if (nullptr == ptr) { \
return false; \
} \
return read<ty>(db.dna[#ty], ptr, cnt, db); \
}
bool read(const Structure &s, T *p, const size_t cnt, const FileDatabase &db)
read/convert of Structure array to memory
Definition: BlenderCustomData.cpp:12