2014-07-30 09:01:25 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2014 Mario Luzeiro <mrluzeiro@gmail.com>
|
|
|
|
* Copyright (C) 2013 Tuomas Vaherkoski <tuomasvaherkoski@gmail.com>
|
|
|
|
* Copyright (C) 2012 Jean-Pierre Charras, jp.charras@wanadoo.fr
|
|
|
|
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
|
|
|
|
* Copyright (C) 1992-2014 KiCad Developers, see AUTHORS.txt for contributors.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file vrml_v2_modelparser.cpp
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <fctsys.h>
|
|
|
|
#include <vector>
|
|
|
|
#include <macros.h>
|
|
|
|
#include <kicad_string.h>
|
|
|
|
#include <info3d_visu.h>
|
|
|
|
|
|
|
|
#include "3d_struct.h"
|
|
|
|
#include "modelparsers.h"
|
|
|
|
#include "vrml_aux.h"
|
|
|
|
|
|
|
|
VRML2_MODEL_PARSER::VRML2_MODEL_PARSER( S3D_MASTER* aMaster ) :
|
|
|
|
S3D_MODEL_PARSER( aMaster )
|
|
|
|
{
|
|
|
|
m_model = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
VRML2_MODEL_PARSER::~VRML2_MODEL_PARSER()
|
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
for( unsigned int idx = 0; idx < childs.size(); idx++ )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
delete childs[idx];
|
2014-07-30 09:01:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-08-21 11:59:57 +00:00
|
|
|
void VRML2_MODEL_PARSER::Load( const wxString& aFilename, double aVrmlunits_to_3Dunits )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
char text[128];
|
2014-07-30 09:01:25 +00:00
|
|
|
|
2014-08-21 11:59:57 +00:00
|
|
|
// DBG( printf( "Load %s\n", GetChars(aFilename) ) );
|
2014-07-30 09:01:25 +00:00
|
|
|
m_file = wxFopen( aFilename, wxT( "rt" ) );
|
|
|
|
|
|
|
|
if( m_file == NULL )
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-08-21 11:59:57 +00:00
|
|
|
float vrmlunits_to_3Dunits = aVrmlunits_to_3Dunits;
|
2014-07-31 07:01:30 +00:00
|
|
|
glScalef( vrmlunits_to_3Dunits, vrmlunits_to_3Dunits, vrmlunits_to_3Dunits );
|
|
|
|
|
2014-08-09 18:18:04 +00:00
|
|
|
glm::vec3 matScale( GetMaster()->m_MatScale.x, GetMaster()->m_MatScale.y,
|
2014-08-16 18:01:00 +00:00
|
|
|
GetMaster()->m_MatScale.z );
|
2014-08-09 18:18:04 +00:00
|
|
|
glm::vec3 matRot( GetMaster()->m_MatRotation.x, GetMaster()->m_MatRotation.y,
|
2014-08-16 18:01:00 +00:00
|
|
|
GetMaster()->m_MatRotation.z );
|
2014-08-09 18:18:04 +00:00
|
|
|
glm::vec3 matPos( GetMaster()->m_MatPosition.x, GetMaster()->m_MatPosition.y,
|
2014-08-16 18:01:00 +00:00
|
|
|
GetMaster()->m_MatPosition.z );
|
2014-08-05 06:39:04 +00:00
|
|
|
|
2014-07-30 09:01:25 +00:00
|
|
|
|
2014-08-16 18:01:00 +00:00
|
|
|
#define SCALE_3D_CONV ( (IU_PER_MILS * 1000.0f) / UNITS3D_TO_UNITSPCB )
|
2014-07-30 09:01:25 +00:00
|
|
|
|
|
|
|
glTranslatef( matPos.x * SCALE_3D_CONV, matPos.y * SCALE_3D_CONV, matPos.z * SCALE_3D_CONV );
|
|
|
|
|
2014-08-16 18:01:00 +00:00
|
|
|
glRotatef( -matRot.z, 0.0f, 0.0f, 1.0f );
|
|
|
|
glRotatef( -matRot.y, 0.0f, 1.0f, 0.0f );
|
|
|
|
glRotatef( -matRot.x, 1.0f, 0.0f, 0.0f );
|
2014-08-05 06:39:04 +00:00
|
|
|
|
2014-07-30 09:01:25 +00:00
|
|
|
glScalef( matScale.x, matScale.y, matScale.z );
|
|
|
|
|
2015-01-23 11:24:32 +00:00
|
|
|
LOCALE_IO toggle; // Temporary switch the locale to standard C to r/w floats
|
2014-07-30 09:01:25 +00:00
|
|
|
|
|
|
|
childs.clear();
|
|
|
|
|
|
|
|
while( GetNextTag( m_file, text ) )
|
|
|
|
{
|
2015-01-18 11:49:32 +00:00
|
|
|
if( ( *text == '}' ) || ( *text == ']' ) )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( strcmp( text, "Transform" ) == 0 )
|
|
|
|
{
|
|
|
|
m_model = new S3D_MESH();
|
|
|
|
childs.push_back( m_model );
|
|
|
|
|
|
|
|
read_Transform();
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else if( strcmp( text, "DEF" ) == 0 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
m_model = new S3D_MESH();
|
|
|
|
childs.push_back( m_model );
|
|
|
|
|
|
|
|
read_DEF();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fclose( m_file );
|
|
|
|
|
|
|
|
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( "chils size:%lu\n", childs.size() ) );
|
2014-07-30 09:01:25 +00:00
|
|
|
|
|
|
|
if( GetMaster()->IsOpenGlAllowed() )
|
|
|
|
{
|
|
|
|
for( unsigned int idx = 0; idx < childs.size(); idx++ )
|
|
|
|
{
|
|
|
|
childs[idx]->openGL_RenderAllChilds();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int VRML2_MODEL_PARSER::read_Transform()
|
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
char text[128];
|
2014-07-30 09:01:25 +00:00
|
|
|
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( "Transform\n" ) );
|
2014-07-30 09:01:25 +00:00
|
|
|
|
|
|
|
while( GetNextTag( m_file, text ) )
|
|
|
|
{
|
2015-01-18 11:49:32 +00:00
|
|
|
if( *text == ']' )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
2014-08-16 18:01:00 +00:00
|
|
|
|
2014-11-15 13:43:23 +00:00
|
|
|
if( *text == '}' )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " } Exit Transform\n" ) );
|
2014-07-30 09:01:25 +00:00
|
|
|
break;
|
|
|
|
}
|
2014-08-16 18:01:00 +00:00
|
|
|
|
2014-07-30 09:01:25 +00:00
|
|
|
if( strcmp( text, "translation" ) == 0 )
|
|
|
|
{
|
|
|
|
parseVertex( m_file, m_model->m_translation );
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else if( strcmp( text, "rotation" ) == 0 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
2014-08-05 06:39:04 +00:00
|
|
|
if( fscanf( m_file, "%f %f %f %f", &m_model->m_rotation[0],
|
2014-08-16 18:01:00 +00:00
|
|
|
&m_model->m_rotation[1],
|
|
|
|
&m_model->m_rotation[2],
|
|
|
|
&m_model->m_rotation[3] ) != 4 )
|
2014-08-05 06:39:04 +00:00
|
|
|
{
|
|
|
|
// !TODO: log errors
|
2014-08-16 18:01:00 +00:00
|
|
|
m_model->m_rotation[0] = 0.0f;
|
|
|
|
m_model->m_rotation[1] = 0.0f;
|
|
|
|
m_model->m_rotation[2] = 0.0f;
|
|
|
|
m_model->m_rotation[3] = 0.0f;
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
m_model->m_rotation[3] = m_model->m_rotation[3] * 180.0f / 3.14f; // !TODO: use constants or functions
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if( strcmp( text, "scale" ) == 0 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
parseVertex( m_file, m_model->m_scale );
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else if( strcmp( text, "scaleOrientation" ) == 0 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
2014-08-05 06:39:04 +00:00
|
|
|
// this m_scaleOrientation is not implemented, but it will be parsed
|
|
|
|
if( fscanf( m_file, "%f %f %f %f", &m_model->m_scaleOrientation[0],
|
2014-08-16 18:01:00 +00:00
|
|
|
&m_model->m_scaleOrientation[1],
|
|
|
|
&m_model->m_scaleOrientation[2],
|
|
|
|
&m_model->m_scaleOrientation[3] ) != 4 )
|
2014-08-05 06:39:04 +00:00
|
|
|
{
|
|
|
|
// !TODO: log errors
|
2014-08-16 18:01:00 +00:00
|
|
|
m_model->m_scaleOrientation[0] = 0.0f;
|
|
|
|
m_model->m_scaleOrientation[1] = 0.0f;
|
|
|
|
m_model->m_scaleOrientation[2] = 0.0f;
|
|
|
|
m_model->m_scaleOrientation[3] = 0.0f;
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if( strcmp( text, "center" ) == 0 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
parseVertex( m_file, m_model->m_center );
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else if( strcmp( text, "children" ) == 0 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
// skip
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else if( strcmp( text, "Switch" ) == 0 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
// skip
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else if( strcmp( text, "whichChoice" ) == 0 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
int dummy;
|
2014-08-16 18:01:00 +00:00
|
|
|
|
2014-08-05 06:39:04 +00:00
|
|
|
if( fscanf( m_file, "%d", &dummy ) != 1 )
|
|
|
|
{
|
|
|
|
// !TODO: log errors
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if( strcmp( text, "choice" ) == 0 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
// skip
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else if( strcmp( text, "Group" ) == 0 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
// skip
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else if( strcmp( text, "Shape" ) == 0 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
S3D_MESH* parent = m_model;
|
2014-07-30 09:01:25 +00:00
|
|
|
|
2014-08-16 18:01:00 +00:00
|
|
|
S3D_MESH* new_mesh_model = new S3D_MESH();
|
2014-07-30 09:01:25 +00:00
|
|
|
|
|
|
|
m_model->childs.push_back( new_mesh_model );
|
|
|
|
|
|
|
|
m_model = new_mesh_model;
|
|
|
|
|
|
|
|
read_Shape();
|
|
|
|
|
|
|
|
m_model = parent;
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else if( strcmp( text, "DEF" ) == 0 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
read_DEF();
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " %s NotImplemented\n", text ) );
|
2014-07-30 09:01:25 +00:00
|
|
|
read_NotImplemented( m_file, '}' );
|
|
|
|
}
|
|
|
|
}
|
2014-08-16 18:01:00 +00:00
|
|
|
|
2014-07-30 09:01:25 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int VRML2_MODEL_PARSER::read_DEF()
|
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
char text[128];
|
2014-07-30 09:01:25 +00:00
|
|
|
|
2014-08-16 18:01:00 +00:00
|
|
|
GetNextTag( m_file, text );
|
|
|
|
// DBG( printf( "DEF %s ", text ) );
|
2014-07-30 09:01:25 +00:00
|
|
|
|
|
|
|
while( GetNextTag( m_file, text ) )
|
|
|
|
{
|
2015-01-18 11:49:32 +00:00
|
|
|
if( *text == ']' )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " skiping %c\n", *text) );
|
2014-07-30 09:01:25 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2014-11-15 13:43:23 +00:00
|
|
|
if( *text == '}' )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " } Exit DEF\n") );
|
2014-07-30 09:01:25 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( strcmp( text, "Transform" ) == 0 )
|
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
return read_Transform();
|
|
|
|
}
|
|
|
|
else if( strcmp( text, "children" ) == 0 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
// skip
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else if( strcmp( text, "Switch" ) == 0 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
// skip
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else if( strcmp( text, "whichChoice" ) == 0 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
// skip
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else if( strcmp( text, "choice" ) == 0 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
// skip
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else if( strcmp( text, "Shape" ) == 0 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
S3D_MESH* parent = m_model;
|
|
|
|
S3D_MESH* new_mesh_model = new S3D_MESH();
|
2014-07-30 09:01:25 +00:00
|
|
|
m_model->childs.push_back( new_mesh_model );
|
|
|
|
|
|
|
|
m_model = new_mesh_model;
|
|
|
|
read_Shape();
|
|
|
|
m_model = parent;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " DEF failed\n" ) );
|
2014-07-30 09:01:25 +00:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int VRML2_MODEL_PARSER::read_Shape()
|
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
char text[128];
|
2014-07-30 09:01:25 +00:00
|
|
|
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " Shape\n") );
|
2014-07-30 09:01:25 +00:00
|
|
|
|
|
|
|
while( GetNextTag( m_file, text ) )
|
|
|
|
{
|
2015-01-18 11:49:32 +00:00
|
|
|
if( *text == ']' )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2014-11-15 13:43:23 +00:00
|
|
|
if( *text == '}' )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " } Exit Shape\n") );
|
2014-07-30 09:01:25 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( strcmp( text, "appearance" ) == 0 )
|
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
// skip
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else if( strcmp( text, "Appearance" ) == 0 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
read_Appearance();
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else if( strcmp( text, "geometry" ) == 0 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
// skip
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else if( strcmp( text, "IndexedFaceSet" ) == 0 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
read_IndexedFaceSet();
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " %s NotImplemented\n", text ) );
|
2014-07-30 09:01:25 +00:00
|
|
|
read_NotImplemented( m_file, '}' );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " Shape failed\n" ) );
|
2014-07-30 09:01:25 +00:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int VRML2_MODEL_PARSER::read_Appearance()
|
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
char text[128];
|
2014-07-30 09:01:25 +00:00
|
|
|
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " Appearance\n") );
|
2014-07-30 09:01:25 +00:00
|
|
|
|
|
|
|
while( GetNextTag( m_file, text ) )
|
|
|
|
{
|
2015-01-18 11:49:32 +00:00
|
|
|
if( *text == ']' )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2014-11-15 13:43:23 +00:00
|
|
|
if( *text == '}' )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( strcmp( text, "material" ) == 0 )
|
|
|
|
{
|
|
|
|
read_material();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " Appearance failed\n" ) );
|
2014-07-30 09:01:25 +00:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int VRML2_MODEL_PARSER::read_material()
|
|
|
|
{
|
|
|
|
S3D_MATERIAL* material = NULL;
|
2014-08-16 18:01:00 +00:00
|
|
|
char text[128];
|
2014-08-05 06:39:04 +00:00
|
|
|
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " material ") );
|
2014-07-30 09:01:25 +00:00
|
|
|
|
|
|
|
if( GetNextTag( m_file, text ) )
|
2014-08-05 06:39:04 +00:00
|
|
|
{
|
2014-07-30 09:01:25 +00:00
|
|
|
if( strcmp( text, "Material" ) == 0 )
|
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
wxString mat_name;
|
2014-07-30 09:01:25 +00:00
|
|
|
material = new S3D_MATERIAL( GetMaster(), mat_name );
|
|
|
|
GetMaster()->Insert( material );
|
|
|
|
m_model->m_Materials = material;
|
|
|
|
|
|
|
|
if( strcmp( text, "Material" ) == 0 )
|
|
|
|
{
|
|
|
|
return read_Material();
|
|
|
|
}
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else if( strcmp( text, "DEF" ) == 0 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( "DEF") );
|
2014-07-30 09:01:25 +00:00
|
|
|
|
|
|
|
if( GetNextTag( m_file, text ) )
|
2014-08-05 06:39:04 +00:00
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( "%s", text ) );
|
2014-07-30 09:01:25 +00:00
|
|
|
|
2014-08-16 18:01:00 +00:00
|
|
|
wxString mat_name;
|
2014-07-30 09:01:25 +00:00
|
|
|
mat_name = FROM_UTF8( text );
|
|
|
|
|
|
|
|
material = new S3D_MATERIAL( GetMaster(), mat_name );
|
|
|
|
GetMaster()->Insert( material );
|
|
|
|
m_model->m_Materials = material;
|
|
|
|
|
|
|
|
if( GetNextTag( m_file, text ) )
|
|
|
|
{
|
|
|
|
if( strcmp( text, "Material" ) == 0 )
|
|
|
|
{
|
|
|
|
return read_Material();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else if( strcmp( text, "USE" ) == 0 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( "USE") );
|
2014-07-30 09:01:25 +00:00
|
|
|
|
|
|
|
if( GetNextTag( m_file, text ) )
|
2014-08-05 06:39:04 +00:00
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( "%s\n", text ) );
|
2014-07-30 09:01:25 +00:00
|
|
|
|
2014-08-16 18:01:00 +00:00
|
|
|
wxString mat_name;
|
2014-07-30 09:01:25 +00:00
|
|
|
mat_name = FROM_UTF8( text );
|
|
|
|
|
|
|
|
for( material = GetMaster()->m_Materials; material; material = material->Next() )
|
|
|
|
{
|
|
|
|
if( material->m_Name == mat_name )
|
|
|
|
{
|
|
|
|
m_model->m_Materials = material;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
2014-08-16 18:01:00 +00:00
|
|
|
|
2014-08-02 07:46:47 +00:00
|
|
|
DBG( printf( " read_material error: material not found\n" ) );
|
2014-07-30 09:01:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " failed material\n" ) );
|
2014-07-30 09:01:25 +00:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int VRML2_MODEL_PARSER::read_Material()
|
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
char text[128];
|
2014-07-30 09:01:25 +00:00
|
|
|
glm::vec3 vertex;
|
|
|
|
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " Material\n") );
|
2014-07-30 09:01:25 +00:00
|
|
|
|
|
|
|
while( GetNextTag( m_file, text ) )
|
|
|
|
{
|
2015-01-18 11:49:32 +00:00
|
|
|
if( *text == ']' )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2014-11-15 13:43:23 +00:00
|
|
|
if( *text == '}' )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( strcmp( text, "diffuseColor" ) == 0 )
|
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " diffuseColor") );
|
|
|
|
parseVertex( m_file, vertex );
|
|
|
|
// DBG( printf( "\n") );
|
2014-07-30 09:01:25 +00:00
|
|
|
m_model->m_Materials->m_DiffuseColor.push_back( vertex );
|
2014-08-16 18:01:00 +00:00
|
|
|
}
|
|
|
|
else if( strcmp( text, "emissiveColor" ) == 0 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " emissiveColor") );
|
|
|
|
parseVertex( m_file, vertex );
|
|
|
|
|
|
|
|
// DBG( printf( "\n") );
|
2014-07-30 09:01:25 +00:00
|
|
|
if( GetMaster()->m_use_modelfile_emissiveColor == true )
|
|
|
|
{
|
|
|
|
m_model->m_Materials->m_EmissiveColor.push_back( vertex );
|
|
|
|
}
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else if( strcmp( text, "specularColor" ) == 0 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " specularColor") );
|
|
|
|
parseVertex( m_file, vertex );
|
|
|
|
// DBG( printf( "\n") );
|
2014-08-09 18:18:04 +00:00
|
|
|
|
2014-07-30 09:01:25 +00:00
|
|
|
if( GetMaster()->m_use_modelfile_specularColor == true )
|
|
|
|
{
|
|
|
|
m_model->m_Materials->m_SpecularColor.push_back( vertex );
|
|
|
|
}
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else if( strcmp( text, "ambientIntensity" ) == 0 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
float ambientIntensity;
|
|
|
|
parseFloat( m_file, &ambientIntensity );
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " ambientIntensity %f\n", ambientIntensity) );
|
2014-08-09 18:18:04 +00:00
|
|
|
|
2014-07-30 09:01:25 +00:00
|
|
|
if( GetMaster()->m_use_modelfile_ambientIntensity == true )
|
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
m_model->m_Materials->m_AmbientColor.push_back( glm::vec3( ambientIntensity,
|
|
|
|
ambientIntensity, ambientIntensity ) );
|
2014-07-30 09:01:25 +00:00
|
|
|
}
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else if( strcmp( text, "transparency" ) == 0 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
float transparency;
|
|
|
|
parseFloat( m_file, &transparency );
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " transparency %f\n", transparency) );
|
2014-08-09 18:18:04 +00:00
|
|
|
|
2014-07-30 09:01:25 +00:00
|
|
|
if( GetMaster()->m_use_modelfile_transparency == true )
|
|
|
|
{
|
|
|
|
m_model->m_Materials->m_Transparency.push_back( transparency );
|
|
|
|
}
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else if( strcmp( text, "shininess" ) == 0 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
float shininess;
|
|
|
|
parseFloat( m_file, &shininess );
|
2014-08-09 18:18:04 +00:00
|
|
|
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " shininess %f\n", shininess) );
|
2014-07-30 09:01:25 +00:00
|
|
|
// VRML value is normalized and openGL expects a value 0 - 128
|
|
|
|
if( GetMaster()->m_use_modelfile_shininess == true )
|
|
|
|
{
|
|
|
|
shininess = shininess * 128.0f;
|
|
|
|
m_model->m_Materials->m_Shininess.push_back( shininess );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " Material failed\n" ) );
|
2014-07-30 09:01:25 +00:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int VRML2_MODEL_PARSER::read_IndexedFaceSet()
|
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
char text[128];
|
2014-07-30 09:01:25 +00:00
|
|
|
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " IndexedFaceSet\n") );
|
2014-07-30 09:01:25 +00:00
|
|
|
|
|
|
|
m_normalPerVertex = false;
|
|
|
|
colorPerVertex = false;
|
|
|
|
|
|
|
|
while( GetNextTag( m_file, text ) )
|
|
|
|
{
|
2015-01-18 11:49:32 +00:00
|
|
|
if( *text == ']' )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2014-11-15 13:43:23 +00:00
|
|
|
if( *text == '}' )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " } Exit IndexedFaceSet\n") );
|
2014-07-30 09:01:25 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( strcmp( text, "normalPerVertex" ) == 0 )
|
|
|
|
{
|
|
|
|
if( GetNextTag( m_file, text ) )
|
|
|
|
{
|
|
|
|
if( strcmp( text, "TRUE" ) == 0 )
|
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " m_normalPerVertex TRUE\n") );
|
2014-07-30 09:01:25 +00:00
|
|
|
m_normalPerVertex = true;
|
|
|
|
}
|
|
|
|
}
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else if( strcmp( text, "colorPerVertex" ) == 0 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
GetNextTag( m_file, text );
|
2014-08-16 18:01:00 +00:00
|
|
|
|
2014-07-30 09:01:25 +00:00
|
|
|
if( strcmp( text, "TRUE" ) )
|
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " colorPerVertex = true\n") );
|
2014-07-30 09:01:25 +00:00
|
|
|
colorPerVertex = true;
|
2014-08-09 18:18:04 +00:00
|
|
|
}
|
|
|
|
else
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
colorPerVertex = false;
|
|
|
|
}
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
2014-08-16 18:01:00 +00:00
|
|
|
else if( strcmp( text, "Coordinate" ) == 0 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
read_Coordinate();
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else if( strcmp( text, "Normal" ) == 0 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
2014-07-31 07:01:30 +00:00
|
|
|
read_Normal();
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else if( strcmp( text, "normalIndex" ) == 0 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
2014-07-31 07:01:30 +00:00
|
|
|
read_NormalIndex();
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else if( strcmp( text, "Color" ) == 0 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
read_Color();
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else if( strcmp( text, "coordIndex" ) == 0 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
read_coordIndex();
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else if( strcmp( text, "colorIndex" ) == 0 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
read_colorIndex();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " IndexedFaceSet failed %s\n", text ) );
|
2014-07-30 09:01:25 +00:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int VRML2_MODEL_PARSER::read_colorIndex()
|
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " read_colorIndex\n" ) );
|
2014-07-30 09:01:25 +00:00
|
|
|
|
|
|
|
m_model->m_MaterialIndex.clear();
|
|
|
|
|
|
|
|
if( colorPerVertex == true )
|
|
|
|
{
|
|
|
|
int index;
|
|
|
|
int first_index;
|
2014-08-16 18:01:00 +00:00
|
|
|
|
2014-07-30 09:01:25 +00:00
|
|
|
while( fscanf( m_file, "%d, ", &index ) )
|
|
|
|
{
|
|
|
|
if( index == -1 )
|
|
|
|
{
|
|
|
|
// it only implemented color per face, so it will store as the first in the list
|
|
|
|
m_model->m_MaterialIndex.push_back( first_index );
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
first_index = index;
|
|
|
|
}
|
|
|
|
}
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
int index;
|
2014-08-05 06:39:04 +00:00
|
|
|
|
2014-07-30 09:01:25 +00:00
|
|
|
while( fscanf( m_file, "%d,", &index ) )
|
|
|
|
{
|
|
|
|
m_model->m_MaterialIndex.push_back( index );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " m_MaterialIndex.size: %ld\n", m_model->m_MaterialIndex.size() ) );
|
2014-07-30 09:01:25 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-07-31 07:01:30 +00:00
|
|
|
int VRML2_MODEL_PARSER::read_NormalIndex()
|
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " read_NormalIndex\n" ) );
|
2014-07-31 07:01:30 +00:00
|
|
|
|
|
|
|
m_model->m_NormalIndex.clear();
|
|
|
|
|
|
|
|
glm::ivec3 coord;
|
|
|
|
|
2014-08-16 18:01:00 +00:00
|
|
|
int dummy; // should be -1
|
2014-07-31 07:01:30 +00:00
|
|
|
|
|
|
|
std::vector<int> coord_list;
|
|
|
|
coord_list.clear();
|
2014-08-16 18:01:00 +00:00
|
|
|
|
|
|
|
while( fscanf( m_file, "%d, ", &dummy ) == 1 )
|
2014-07-31 07:01:30 +00:00
|
|
|
{
|
|
|
|
if( dummy == -1 )
|
|
|
|
{
|
|
|
|
m_model->m_NormalIndex.push_back( coord_list );
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " size: %lu ", coord_list.size()) );
|
2014-07-31 07:01:30 +00:00
|
|
|
coord_list.clear();
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else
|
2014-07-31 07:01:30 +00:00
|
|
|
{
|
|
|
|
coord_list.push_back( dummy );
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( "%d ", dummy) );
|
2014-07-31 07:01:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " m_NormalIndex.size: %ld\n", m_model->m_NormalIndex.size() ) );
|
2014-07-31 07:01:30 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-07-30 09:01:25 +00:00
|
|
|
int VRML2_MODEL_PARSER::read_coordIndex()
|
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " read_coordIndex\n" ) );
|
2014-07-30 09:01:25 +00:00
|
|
|
|
|
|
|
m_model->m_CoordIndex.clear();
|
|
|
|
|
|
|
|
glm::ivec3 coord;
|
|
|
|
|
2014-08-16 18:01:00 +00:00
|
|
|
int dummy; // should be -1
|
2014-07-30 09:01:25 +00:00
|
|
|
|
|
|
|
std::vector<int> coord_list;
|
|
|
|
coord_list.clear();
|
2014-08-16 18:01:00 +00:00
|
|
|
|
|
|
|
while( fscanf( m_file, "%d, ", &dummy ) == 1 )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
if( dummy == -1 )
|
|
|
|
{
|
|
|
|
m_model->m_CoordIndex.push_back( coord_list );
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " size: %lu ", coord_list.size()) );
|
2014-07-30 09:01:25 +00:00
|
|
|
coord_list.clear();
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
coord_list.push_back( dummy );
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( "%d ", dummy) );
|
2014-07-30 09:01:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " m_CoordIndex.size: %ld\n", m_model->m_CoordIndex.size() ) );
|
2014-07-30 09:01:25 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int VRML2_MODEL_PARSER::read_Color()
|
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
char text[128];
|
2014-07-30 09:01:25 +00:00
|
|
|
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " read_Color\n") );
|
2014-07-30 09:01:25 +00:00
|
|
|
|
|
|
|
while( GetNextTag( m_file, text ) )
|
|
|
|
{
|
2015-01-18 11:49:32 +00:00
|
|
|
if( *text == ']' )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2014-11-15 13:43:23 +00:00
|
|
|
if( *text == '}' )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " m_DiffuseColor.size: %ld\n", m_model->m_Materials->m_DiffuseColor.size() ) );
|
2014-07-30 09:01:25 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( strcmp( text, "color" ) == 0 )
|
|
|
|
{
|
|
|
|
parseVertexList( m_file, m_model->m_Materials->m_DiffuseColor );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " read_Color failed\n") );
|
2014-08-05 06:39:04 +00:00
|
|
|
return -1;
|
2014-07-30 09:01:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int VRML2_MODEL_PARSER::read_Normal()
|
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
char text[128];
|
2014-07-30 09:01:25 +00:00
|
|
|
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " Normal\n") );
|
2014-07-30 09:01:25 +00:00
|
|
|
|
|
|
|
while( GetNextTag( m_file, text ) )
|
|
|
|
{
|
2015-01-18 11:49:32 +00:00
|
|
|
if( *text == ']' )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2014-11-15 13:43:23 +00:00
|
|
|
if( *text == '}' )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " m_PerFaceNormalsNormalized.size: %lu\n", m_model->m_PerFaceNormalsNormalized.size() ) );
|
2014-07-30 09:01:25 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( strcmp( text, "vector" ) == 0 )
|
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
if( m_normalPerVertex == false )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
parseVertexList( m_file, m_model->m_PerFaceNormalsNormalized );
|
2014-08-05 06:39:04 +00:00
|
|
|
}
|
|
|
|
else
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
parseVertexList( m_file, m_model->m_PerVertexNormalsNormalized );
|
|
|
|
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " m_PerVertexNormalsNormalized.size: %lu\n", m_model->m_PerVertexNormalsNormalized.size() ) );
|
2014-07-30 09:01:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-08-05 06:39:04 +00:00
|
|
|
return -1;
|
2014-07-30 09:01:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int VRML2_MODEL_PARSER::read_Coordinate()
|
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
char text[128];
|
2014-07-30 09:01:25 +00:00
|
|
|
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " Coordinate\n") );
|
2014-07-30 09:01:25 +00:00
|
|
|
|
|
|
|
while( GetNextTag( m_file, text ) )
|
|
|
|
{
|
2015-01-18 11:49:32 +00:00
|
|
|
if( *text == ']' )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2014-11-15 13:43:23 +00:00
|
|
|
if( *text == '}' )
|
2014-07-30 09:01:25 +00:00
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
// DBG( printf( " m_Point.size: %lu\n", m_model->m_Point.size() ) );
|
2014-07-30 09:01:25 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( strcmp( text, "point" ) == 0 )
|
|
|
|
{
|
2014-08-16 18:01:00 +00:00
|
|
|
parseVertexList( m_file, m_model->m_Point );
|
2014-07-30 09:01:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-08-05 06:39:04 +00:00
|
|
|
return -1;
|
2014-07-30 09:01:25 +00:00
|
|
|
}
|