bugfix: add correct handling for metric line end for example file.
Signed-off-by: Kim Kulling <kim.kulling@googlemail.com>pull/502/head
parent
1a5695ff48
commit
dbf9536213
|
@ -47,3 +47,4 @@ test/gtest/src/gtest-stamp/gtest-build.cmake
|
|||
test/gtest/src/gtest-stamp/Debug/gtest-patch
|
||||
*.cache
|
||||
test/gtest/src/gtest-stamp/Debug/gtest-build
|
||||
*.lib
|
||||
|
|
|
@ -189,6 +189,17 @@ bool OpenGEXParser::skipComments() {
|
|||
return skipped;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
void OpenGEXParser::readUntilEndOfLine() {
|
||||
while( !IsLineEnd( m_buffer[ m_index ] ) ) {
|
||||
++m_index;
|
||||
}
|
||||
++m_index;
|
||||
if( IsLineEnd( m_buffer[ m_index ] ) ) {
|
||||
++m_index;
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
bool OpenGEXParser::parseNextNode() {
|
||||
std::string token( getNextToken() );
|
||||
|
@ -203,7 +214,10 @@ bool OpenGEXParser::parseNextNode() {
|
|||
return false;
|
||||
}
|
||||
|
||||
readUntilEndOfLine();
|
||||
|
||||
m_nodeTypeStack.pop_back();
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -329,21 +343,19 @@ bool OpenGEXParser::getMetricAttributeKey( std::string &attribName ) {
|
|||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
bool OpenGEXParser::onMetricNode( const std::string &attribName ) {
|
||||
float value( 0.0f );
|
||||
bool success( true );
|
||||
if( "distance" == attribName ) {
|
||||
float distance( 0.0f );
|
||||
if( getFloatData( 1, &distance ) ) {
|
||||
m_model.m_metrics.m_distance = distance;
|
||||
if( getFloatData( 1, &value ) ) {
|
||||
m_model.m_metrics.m_distance = value;
|
||||
}
|
||||
} else if( "angle" == attribName ) {
|
||||
float angle( 0.0f );
|
||||
if( getFloatData( 1, &angle ) ) {
|
||||
m_model.m_metrics.m_angle = angle;
|
||||
if( getFloatData( 1, &value ) ) {
|
||||
m_model.m_metrics.m_angle = value;
|
||||
}
|
||||
} else if( "time" == attribName ) {
|
||||
float time( 0.0f );
|
||||
if( getFloatData( 1, &time ) ) {
|
||||
m_model.m_metrics.m_time = time;
|
||||
if( getFloatData( 1, &value ) ) {
|
||||
m_model.m_metrics.m_time = value;
|
||||
}
|
||||
} else if( "up" == attribName ) {
|
||||
std::string up;
|
||||
|
|
|
@ -87,6 +87,7 @@ public:
|
|||
protected:
|
||||
std::string getNextToken();
|
||||
bool skipComments();
|
||||
void readUntilEndOfLine();
|
||||
bool parseNextNode();
|
||||
bool getNodeHeader( std::string &name );
|
||||
bool getBracketOpen();
|
||||
|
|
Loading…
Reference in New Issue