Assimp  v3.1.1 (June 2014)
Assimp::Discreet3DSImporter Class Reference

Importer class for 3D Studio r3 and r4 3DS files. More...

Inherits Assimp::BaseImporter.

Public Member Functions

bool CanRead (const std::string &pFile, IOSystem *pIOHandler, bool checkSig) const
 Returns whether the class can handle the format of the given file. More...
 
 Discreet3DSImporter ()
 
void SetupProperties (const Importer *pImp)
 Called prior to ReadFile(). More...
 
 ~Discreet3DSImporter ()
 
- Public Member Functions inherited from Assimp::BaseImporter
 BaseImporter ()
 Constructor to be privately used by Importer. More...
 
const std::string & GetErrorText () const
 Returns the error description of the last error that occurred. More...
 
void GetExtensionList (std::set< std::string > &extensions)
 Called by #Importer::GetExtensionList for each loaded importer. More...
 
aiSceneReadFile (const Importer *pImp, const std::string &pFile, IOSystem *pIOHandler)
 Imports the given file and returns the imported data. More...
 
virtual ~BaseImporter ()
 Destructor, private as well. More...
 

Protected Member Functions

void AddNodeToGraph (aiScene *pcSOut, aiNode *pcOut, D3DS::Node *pcIn, aiMatrix4x4 &absTrafo)
 Add a node to the node graph. More...
 
void ApplyMasterScale (aiScene *pScene)
 Apply the master scaling factor to the mesh. More...
 
void CheckIndices (D3DS::Mesh &sMesh)
 Clamp all indices in the file to a valid range. More...
 
void ConvertMaterial (D3DS::Material &p_cMat, aiMaterial &p_pcOut)
 Converts a temporary material to the outer representation. More...
 
void ConvertMeshes (aiScene *pcOut)
 Convert the meshes in the file. More...
 
void ConvertScene (aiScene *pcOut)
 Convert the whole scene. More...
 
void GenerateNodeGraph (aiScene *pcOut)
 Generate the nodegraph. More...
 
const aiImporterDescGetInfo () const
 Return importer meta information. More...
 
void InternReadFile (const std::string &pFile, aiScene *pScene, IOSystem *pIOHandler)
 Imports the given file into the given scene structure. More...
 
void InverseNodeSearch (D3DS::Node *pcNode, D3DS::Node *pcCurrent)
 Search for a node in the graph. More...
 
void MakeUnique (D3DS::Mesh &sMesh)
 generate unique vertices for a mesh More...
 
void ParseCameraChunk ()
 Parse a camera chunk in the file. More...
 
void ParseChunk (const char *name, unsigned int num)
 Parse a top-level chunk in the file. More...
 
void ParseColorChunk (aiColor3D *p_pcOut, bool p_bAcceptPercent=true)
 Parse a color chunk. More...
 
void ParseEditorChunk ()
 Parse a top-level editor chunk in the file. More...
 
void ParseFaceChunk ()
 Parse a face list chunk in the file. More...
 
void ParseHierarchyChunk (uint16_t parent)
 Parse a hierarchy chunk in the file. More...
 
void ParseKeyframeChunk ()
 Parse a keyframe chunk in the file. More...
 
void ParseLightChunk ()
 Parse a light chunk in the file. More...
 
void ParseMainChunk ()
 Parse a main top-level chunk in the file. More...
 
void ParseMaterialChunk ()
 Parse a material chunk in the file. More...
 
void ParseMeshChunk ()
 Parse a mesh chunk in the file. More...
 
void ParseObjectChunk ()
 Parse a top-level object chunk in the file. More...
 
float ParsePercentageChunk ()
 Parse a percentage chunk. More...
 
void ParseTextureChunk (D3DS::Texture *pcOut)
 Parse a texture chunk in the file. More...
 
void ReadChunk (Discreet3DS::Chunk *pcOut)
 Read a chunk. More...
 
void ReplaceDefaultMaterial ()
 Replace the default material in the scene. More...
 
void SkipChunk ()
 Skip a chunk in the file. More...
 
void SkipTCBInfo ()
 Skip the TCB info in a track key. More...
 

Protected Attributes

bool bHasBG
 
bool bIsPrj
 true if PRJ file More...
 
std::string mBackgroundImage
 Path to the background image of the scene. More...
 
aiColor3D mClrAmbient
 Ambient base color of the scene. More...
 
D3DS::NodemCurrentNode
 Current node, root node. More...
 
short mLastNodeIndex
 Last touched node index. More...
 
float mMasterScale
 Master scaling factor of the scene. More...
 
D3DS::NodemRootNode
 
D3DS::ScenemScene
 Scene under construction. More...
 
StreamReaderLEstream
 Stream to read from. More...
 
- Protected Attributes inherited from Assimp::BaseImporter
std::string m_ErrorText
 Error description in case there was one. More...
 
ProgressHandlerm_progress
 Currently set progress handler. More...
 

Additional Inherited Members

- Public Types inherited from Assimp::BaseImporter
enum  TextFileMode { ALLOW_EMPTY, FORBID_EMPTY }
 
- Static Public Member Functions inherited from Assimp::BaseImporter
static bool CheckMagicToken (IOSystem *pIOHandler, const std::string &pFile, const void *magic, unsigned int num, unsigned int offset=0, unsigned int size=4)
 Check whether a file starts with one or more magic tokens. More...
 
static void ConvertToUTF8 (std::vector< char > &data)
 An utility for all text file loaders. More...
 
static void ConvertUTF8toISO8859_1 (std::string &data)
 An utility for all text file loaders. More...
 
template<typename T >
static AI_FORCE_INLINE void CopyVector (std::vector< T > &vec, T *&out, unsigned int &outLength)
 Utility function to move a std::vector into a aiScene array. More...
 
static std::string GetExtension (const std::string &pFile)
 Extract file extension from a string. More...
 
static bool SearchFileHeaderForToken (IOSystem *pIOSystem, const std::string &file, const char **tokens, unsigned int numTokens, unsigned int searchBytes=200, bool tokensSol=false)
 A utility for CanRead(). More...
 
static bool SimpleExtensionCheck (const std::string &pFile, const char *ext0, const char *ext1=NULL, const char *ext2=NULL)
 Check whether a file has a specific file extension. More...
 
static void TextFileToBuffer (IOStream *stream, std::vector< char > &data, TextFileMode mode=FORBID_EMPTY)
 Utility for text file loaders which copies the contents of the file into a memory buffer and converts it to our UTF8 representation. More...
 

Detailed Description

Importer class for 3D Studio r3 and r4 3DS files.

Constructor & Destructor Documentation

◆ Discreet3DSImporter()

Discreet3DSImporter::Discreet3DSImporter ( )

◆ ~Discreet3DSImporter()

Discreet3DSImporter::~Discreet3DSImporter ( )

Member Function Documentation

◆ AddNodeToGraph()

void Discreet3DSImporter::AddNodeToGraph ( aiScene pcSOut,
aiNode pcOut,
D3DS::Node pcIn,
aiMatrix4x4 absTrafo 
)
protected

Add a node to the node graph.

◆ ApplyMasterScale()

void Discreet3DSImporter::ApplyMasterScale ( aiScene pScene)
protected

Apply the master scaling factor to the mesh.

◆ CanRead()

bool Discreet3DSImporter::CanRead ( const std::string &  pFile,
IOSystem pIOHandler,
bool  checkSig 
) const
virtual

Returns whether the class can handle the format of the given file.

See BaseImporter::CanRead() for details.

Implements Assimp::BaseImporter.

◆ CheckIndices()

void Discreet3DSImporter::CheckIndices ( D3DS::Mesh sMesh)
protected

Clamp all indices in the file to a valid range.

◆ ConvertMaterial()

void Discreet3DSImporter::ConvertMaterial ( D3DS::Material p_cMat,
aiMaterial p_pcOut 
)
protected

Converts a temporary material to the outer representation.

◆ ConvertMeshes()

void Discreet3DSImporter::ConvertMeshes ( aiScene pcOut)
protected

Convert the meshes in the file.

◆ ConvertScene()

void Discreet3DSImporter::ConvertScene ( aiScene pcOut)
protected

Convert the whole scene.

◆ GenerateNodeGraph()

void Discreet3DSImporter::GenerateNodeGraph ( aiScene pcOut)
protected

Generate the nodegraph.

◆ GetInfo()

const aiImporterDesc * Discreet3DSImporter::GetInfo ( ) const
protectedvirtual

Return importer meta information.

See #BaseImporter::GetInfo for the details

Implements Assimp::BaseImporter.

◆ InternReadFile()

void Discreet3DSImporter::InternReadFile ( const std::string &  pFile,
aiScene pScene,
IOSystem pIOHandler 
)
protectedvirtual

Imports the given file into the given scene structure.

See BaseImporter::InternReadFile() for details

Implements Assimp::BaseImporter.

◆ InverseNodeSearch()

void Discreet3DSImporter::InverseNodeSearch ( D3DS::Node pcNode,
D3DS::Node pcCurrent 
)
protected

Search for a node in the graph.

Called recursively

◆ MakeUnique()

void Discreet3DSImporter::MakeUnique ( D3DS::Mesh sMesh)
protected

generate unique vertices for a mesh

◆ ParseCameraChunk()

void Discreet3DSImporter::ParseCameraChunk ( )
protected

Parse a camera chunk in the file.

◆ ParseChunk()

void Discreet3DSImporter::ParseChunk ( const char *  name,
unsigned int  num 
)
protected

Parse a top-level chunk in the file.

◆ ParseColorChunk()

void Discreet3DSImporter::ParseColorChunk ( aiColor3D p_pcOut,
bool  p_bAcceptPercent = true 
)
protected

Parse a color chunk.

mCurrent will point to the next chunk behind afterwards. If no color chunk is found QNAN is returned in all members.

◆ ParseEditorChunk()

void Discreet3DSImporter::ParseEditorChunk ( )
protected

Parse a top-level editor chunk in the file.

◆ ParseFaceChunk()

void Discreet3DSImporter::ParseFaceChunk ( )
protected

Parse a face list chunk in the file.

◆ ParseHierarchyChunk()

void Discreet3DSImporter::ParseHierarchyChunk ( uint16_t  parent)
protected

Parse a hierarchy chunk in the file.

◆ ParseKeyframeChunk()

void Discreet3DSImporter::ParseKeyframeChunk ( )
protected

Parse a keyframe chunk in the file.

◆ ParseLightChunk()

void Discreet3DSImporter::ParseLightChunk ( )
protected

Parse a light chunk in the file.

◆ ParseMainChunk()

void Discreet3DSImporter::ParseMainChunk ( )
protected

Parse a main top-level chunk in the file.

◆ ParseMaterialChunk()

void Discreet3DSImporter::ParseMaterialChunk ( )
protected

Parse a material chunk in the file.

◆ ParseMeshChunk()

void Discreet3DSImporter::ParseMeshChunk ( )
protected

Parse a mesh chunk in the file.

◆ ParseObjectChunk()

void Discreet3DSImporter::ParseObjectChunk ( )
protected

Parse a top-level object chunk in the file.

◆ ParsePercentageChunk()

float Discreet3DSImporter::ParsePercentageChunk ( )
protected

Parse a percentage chunk.

mCurrent will point to the next chunk behind afterwards. If no percentage chunk is found QNAN is returned.

◆ ParseTextureChunk()

void Discreet3DSImporter::ParseTextureChunk ( D3DS::Texture pcOut)
protected

Parse a texture chunk in the file.

◆ ReadChunk()

void Discreet3DSImporter::ReadChunk ( Discreet3DS::Chunk pcOut)
protected

Read a chunk.

Parameters
pcOutReceives the current chunk

◆ ReplaceDefaultMaterial()

void Discreet3DSImporter::ReplaceDefaultMaterial ( )
protected

Replace the default material in the scene.

◆ SetupProperties()

void Discreet3DSImporter::SetupProperties ( const Importer pImp)
virtual

Called prior to ReadFile().

The function is a request to the importer to update its configuration basing on the Importer's configuration property list.

Reimplemented from Assimp::BaseImporter.

◆ SkipChunk()

void Discreet3DSImporter::SkipChunk ( )
protected

Skip a chunk in the file.

◆ SkipTCBInfo()

void Discreet3DSImporter::SkipTCBInfo ( )
protected

Skip the TCB info in a track key.

Member Data Documentation

◆ bHasBG

bool Assimp::Discreet3DSImporter::bHasBG
protected

◆ bIsPrj

bool Assimp::Discreet3DSImporter::bIsPrj
protected

true if PRJ file

◆ mBackgroundImage

std::string Assimp::Discreet3DSImporter::mBackgroundImage
protected

Path to the background image of the scene.

◆ mClrAmbient

aiColor3D Assimp::Discreet3DSImporter::mClrAmbient
protected

Ambient base color of the scene.

◆ mCurrentNode

D3DS::Node* Assimp::Discreet3DSImporter::mCurrentNode
protected

Current node, root node.

◆ mLastNodeIndex

short Assimp::Discreet3DSImporter::mLastNodeIndex
protected

Last touched node index.

◆ mMasterScale

float Assimp::Discreet3DSImporter::mMasterScale
protected

Master scaling factor of the scene.

◆ mRootNode

D3DS::Node * Assimp::Discreet3DSImporter::mRootNode
protected

◆ mScene

D3DS::Scene* Assimp::Discreet3DSImporter::mScene
protected

Scene under construction.

◆ stream

StreamReaderLE* Assimp::Discreet3DSImporter::stream
protected

Stream to read from.


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