Assimp  v3.1.1 (June 2014)
Assimp::Blender::DNA Class Reference

Represents the full data structure information for a single BLEND file. More...

Public Types

typedef std::shared_ptr< ElemBase >(Structure::* AllocProcPtr) () const
 
typedef void(Structure::* ConvertProcPtr) (std::shared_ptr< ElemBase > in, const FileDatabase &) const
 
typedef std::pair< AllocProcPtr, ConvertProcPtrFactoryPair
 

Public Member Functions

void AddPrimitiveStructures ()
 Add structure definitions for all the primitive types, i.e. More...
 
std::shared_ptr< ElemBaseConvertBlobToStructure (const Structure &structure, const FileDatabase &db) const
 Take an input blob from the stream, interpret it according to a its structure name and convert it to the intermediate representation. More...
 
const StructureGet (const std::string &ss) const
 
FactoryPair GetBlobToStructureConverter (const Structure &structure, const FileDatabase &db) const
 Find a suitable conversion function for a given Structure. More...
 
const Structureoperator[] (const std::string &ss) const
 Access a structure by its canonical name, the pointer version returns NULL on failure while the reference version raises an error. More...
 
const Structureoperator[] (const size_t i) const
 Access a structure by its index. More...
 
void RegisterConverters ()
 Fill the converters member with converters for all known data types. More...
 

Static Public Member Functions

static void ExtractArraySize (const std::string &out, size_t array_sizes[2])
 Extract array dimensions from a C array declaration, such as ...[4][6]. More...
 

Public Attributes

std::map< std::string, FactoryPairconverters
 
std::map< std::string, size_t > indices
 
vector< Structurestructures
 

Detailed Description

Represents the full data structure information for a single BLEND file.

This data is extracted from the DNA1 chunk in the file. #DNAParser does the reading and represents currently the only place where DNA is altered.

Member Typedef Documentation

◆ AllocProcPtr

typedef std::shared_ptr<ElemBase>( Structure::* Assimp::Blender::DNA::AllocProcPtr) () const

◆ ConvertProcPtr

typedef void(Structure::* Assimp::Blender::DNA::ConvertProcPtr) (std::shared_ptr< ElemBase > in, const FileDatabase &) const

◆ FactoryPair

Member Function Documentation

◆ AddPrimitiveStructures()

void DNA::AddPrimitiveStructures ( )

Add structure definitions for all the primitive types, i.e.

integer, short, char, float

◆ ConvertBlobToStructure()

std::shared_ptr< ElemBase > DNA::ConvertBlobToStructure ( const Structure structure,
const FileDatabase db 
) const

Take an input blob from the stream, interpret it according to a its structure name and convert it to the intermediate representation.

Parameters
structureDestination structure definition
dbFile database.
Returns
A null pointer if no appropriate converter is available.

◆ ExtractArraySize()

void DNA::ExtractArraySize ( const std::string &  out,
size_t  array_sizes[2] 
)
static

Extract array dimensions from a C array declaration, such as ...[4][6].

Returned string would be ...[][].

Parameters
out
array_sizesReceive maximally two array dimensions, the second element is set to 1 if the array is flat. Both are set to 1 if the input is not an array.
Exceptions
DeadlyImportErrorif more than 2 dimensions are encountered.

◆ Get()

const Structure * Assimp::Blender::DNA::Get ( const std::string &  ss) const
inline

◆ GetBlobToStructureConverter()

DNA::FactoryPair DNA::GetBlobToStructureConverter ( const Structure structure,
const FileDatabase db 
) const

Find a suitable conversion function for a given Structure.

Such a converter function takes a blob from the input stream, reads as much as it needs, and builds up a complete object in intermediate representation.

Parameters
structureDestination structure definition
dbFile database.
Returns
A null pointer in .first if no appropriate converter is available.

◆ operator[]() [1/2]

const Structure & Assimp::Blender::DNA::operator[] ( const std::string &  ss) const
inline

Access a structure by its canonical name, the pointer version returns NULL on failure while the reference version raises an error.

◆ operator[]() [2/2]

const Structure & Assimp::Blender::DNA::operator[] ( const size_t  i) const
inline

Access a structure by its index.

◆ RegisterConverters()

void DNA::RegisterConverters ( )

Fill the converters member with converters for all known data types.

The implementation of this method is in BlenderScene.cpp and is machine-generated. Converters are used to quickly handle objects whose exact data type is a runtime-property and not yet known at compile time (consier Object::data).

Member Data Documentation

◆ converters

std::map<std::string, FactoryPair > Assimp::Blender::DNA::converters

◆ indices

std::map<std::string, size_t> Assimp::Blender::DNA::indices

◆ structures

vector<Structure > Assimp::Blender::DNA::structures

The documentation for this class was generated from the following files: