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

Importer class to load the stanford PLY file format. 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...
 
void LoadFace (const PLY::Element *pcElement, const PLY::ElementInstance *instElement, unsigned int pos)
 Extract a face from the DOM. More...
 
void LoadVertex (const PLY::Element *pcElement, const PLY::ElementInstance *instElement, unsigned int pos)
 Extract a vertex from the DOM. More...
 
 PLYImporter ()
 
 ~PLYImporter ()
 
- 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 void SetupProperties (const Importer *pImp)
 Called prior to ReadFile(). More...
 
virtual ~BaseImporter ()
 Destructor, private as well. More...
 

Protected Member Functions

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 LoadMaterial (std::vector< aiMaterial *> *pvOut, std::string &defaultTexture, const bool pointsOnly)
 Extract a material list from the DOM. More...
 

Static Protected Member Functions

static void GetMaterialColor (const std::vector< PLY::PropertyInstance > &avList, unsigned int aiPositions[4], PLY::EDataType aiTypes[4], aiColor4D *clrOut)
 Static helper to parse a color from four single channels in. More...
 
static ai_real NormalizeColorValue (PLY::PropertyInstance::ValueUnion val, PLY::EDataType eType)
 Static helper to parse a color channel value. More...
 

Protected Attributes

unsigned char * mBuffer
 Buffer to hold the loaded file. More...
 
aiMeshmGeneratedMesh
 Mesh generated by loader. More...
 
PLY::DOMpcDOM
 Document object model representation extracted from the file. 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 }
 Enum to define, if empty files are ok or not. More...
 
- 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 to load the stanford PLY file format.

Constructor & Destructor Documentation

◆ PLYImporter()

PLYImporter::PLYImporter ( )

◆ ~PLYImporter()

PLYImporter::~PLYImporter ( )

Member Function Documentation

◆ CanRead()

bool PLYImporter::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.

◆ GetInfo()

const aiImporterDesc * PLYImporter::GetInfo ( ) const
protectedvirtual

Return importer meta information.

See #BaseImporter::GetInfo for the details

Implements Assimp::BaseImporter.

◆ GetMaterialColor()

void PLYImporter::GetMaterialColor ( const std::vector< PLY::PropertyInstance > &  avList,
unsigned int  aiPositions[4],
PLY::EDataType  aiTypes[4],
aiColor4D clrOut 
)
staticprotected

Static helper to parse a color from four single channels in.

◆ InternReadFile()

void PLYImporter::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.

◆ LoadFace()

void PLYImporter::LoadFace ( const PLY::Element pcElement,
const PLY::ElementInstance instElement,
unsigned int  pos 
)

Extract a face from the DOM.

◆ LoadMaterial()

void PLYImporter::LoadMaterial ( std::vector< aiMaterial *> *  pvOut,
std::string &  defaultTexture,
const bool  pointsOnly 
)
protected

Extract a material list from the DOM.

◆ LoadVertex()

void PLYImporter::LoadVertex ( const PLY::Element pcElement,
const PLY::ElementInstance instElement,
unsigned int  pos 
)

Extract a vertex from the DOM.

◆ NormalizeColorValue()

ai_real PLYImporter::NormalizeColorValue ( PLY::PropertyInstance::ValueUnion  val,
PLY::EDataType  eType 
)
staticprotected

Static helper to parse a color channel value.

The input value is normalized to 0-1.

Member Data Documentation

◆ mBuffer

unsigned char* Assimp::PLYImporter::mBuffer
protected

Buffer to hold the loaded file.

◆ mGeneratedMesh

aiMesh* Assimp::PLYImporter::mGeneratedMesh
protected

Mesh generated by loader.

◆ pcDOM

PLY::DOM* Assimp::PLYImporter::pcDOM
protected

Document object model representation extracted from the file.


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