Added NFF loader. No standard shapes yet (sphere, cone), but a class for them (StandardShapes) has been declared.

Fixed a small bug in the DXF loader, a few test models, however, are still corrupted.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@121 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
aramis_acg
2008-09-07 16:51:05 +00:00
parent 56563016b0
commit f69446937b
13 changed files with 784 additions and 44 deletions

View File

@@ -92,21 +92,21 @@ bool DXFImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler) const
// ------------------------------------------------------------------------------------------------
bool DXFImporter::GetNextLine()
{
if(!SkipLine(buffer,&buffer))return false;
if(!SkipSpaces(buffer,&buffer))return GetNextLine();
if(!SkipLine(&buffer))return false;
if(!SkipSpaces(&buffer))return GetNextLine();
return true;
}
// ------------------------------------------------------------------------------------------------
bool DXFImporter::GetNextToken()
{
SkipSpaces(buffer,&buffer);
SkipSpaces(&buffer);
groupCode = strtol10s(buffer,&buffer);
if(!GetNextLine())return false;
// copy the data line to a separate buffer
char* m = cursor;
while (!IsLineEnd ( *buffer ) && m < (cursor+sizeof(cursor)/sizeof(char)))
char* m = cursor, *end = &cursor[4096];
while (!IsLineEnd ( *buffer ) && m < end)
*m++ = *buffer++;
*m = '\0';
@@ -143,10 +143,6 @@ void DXFImporter::InternReadFile( const std::string& pFile,
if (!::strcmp(cursor,"ENTITIES"))
if (!ParseEntities())break;
// HEADER section - just to print the file format version
else if (!::strcmp(cursor,"HEADER"))
if (!ParseHeader())break;
// other sections such as BLOCK - skip them to make
// sure there will be no name conflicts
else
@@ -273,27 +269,6 @@ bool DXFImporter::ParseEntities()
return false;
}
// ------------------------------------------------------------------------------------------------
bool DXFImporter::ParseHeader()
{
// --- at the moment we don't need any information from the header
while (GetNextToken())
{
if (!groupCode)
{
if (!::strcmp(cursor,"ENDSEC"))
return true;
}
// print comment strings
else if (999 == groupCode)
{
DefaultLogger::get()->info(std::string( cursor ));
}
}
return false;
}
// ------------------------------------------------------------------------------------------------
bool DXFImporter::Parse3DFace()
{