update parser.

Signed-off-by: Kim Kulling <kim.kulling@googlemail.com>
pull/502/head
Kim Kulling 2014-11-29 11:33:49 +01:00
parent dbf9536213
commit 9f80a2a2a9
2 changed files with 37 additions and 2 deletions

View File

@ -226,10 +226,19 @@ bool OpenGEXParser::parseNextNode() {
//------------------------------------------------------------------------------------------------
bool OpenGEXParser::getNodeHeader( std::string &name ) {
bool success( false );
if( m_nodeTypeStack.back() == MetricNode ) {
TokenType tokenType( m_nodeTypeStack.back() );
if( tokenType == MetricNode ) {
if( getMetricAttributeKey( name ) ) {
success = true;
}
} else if( tokenType == GeometryNode ) {
} else if( tokenType == GeometryObject ) {
} else if( tokenType == Material ) {
} else {
DefaultLogger::get()->warn( "Unknown token type in file." );
}
return success;
@ -307,9 +316,17 @@ bool OpenGEXParser::getNodeData( const std::string &nodeType ) {
return false;
}
TokenType type( m_nodeTypeStack.back() );
const TokenType type( m_nodeTypeStack.back() );
if( type == MetricNode ) {
success = onMetricNode( nodeType );
} else if( type == GeometryNode ) {
success = onGeometryNode();
} else if( type == GeometryObject ) {
success = onGeometryObject();
} else if( type == Material ) {
success = onMaterial();
} else {
DefaultLogger::get()->warn( "Unknown token type in file." );
}
if( !getBracketClose() ) {
@ -369,6 +386,21 @@ bool OpenGEXParser::onMetricNode( const std::string &attribName ) {
return success;
}
//------------------------------------------------------------------------------------------------
bool OpenGEXParser::onGeometryNode() {
return true;
}
//------------------------------------------------------------------------------------------------
bool OpenGEXParser::onGeometryObject() {
return true;
}
//------------------------------------------------------------------------------------------------
bool OpenGEXParser::onMaterial() {
return true;
}
//------------------------------------------------------------------------------------------------
} // Namespace OpenGEX

View File

@ -97,6 +97,9 @@ protected:
bool getNodeData( const std::string &nodeType );
bool getMetricAttributeKey( std::string &attribName );
bool onMetricNode( const std::string &attribName );
bool onGeometryNode();
bool onGeometryObject();
bool onMaterial();
private:
OpenGEXParser( const OpenGEXParser & );