dneg/open-gto

writer.endComponent(); lines missing in open-gto/bin/ggto/Poly.cpp

Opened this issue · 1 comments

Hi,

There are a couple of these lines missing in open-gto/bin/ggto/Poly.cpp:

writer.endComponent();

The writeHeader method should look like:

############################

void Poly::writeHeader( Gto::Writer &writer )
{
    if( m_indicesVertex.size() == 0 ) return; // Nothing to write...

    writer.beginObject( m_name.c_str(), m_protocol.c_str(), m_protoVersion );

    Object::writeHeader( writer );

    writer.beginComponent( GTO_COMPONENT_POINTS );
    writer.property( GTO_PROPERTY_POSITION, Gto::Float,
m_pointsPositions.size(), 3 );
    writer.endComponent();

    writer.beginComponent( GTO_COMPONENT_ELEMENTS);
    writer.property( GTO_PROPERTY_TYPE, Gto::Byte, m_elementsType.size(), 1 );
    writer.property( GTO_PROPERTY_SIZE, Gto::Short, m_elementsSize.size(), 1 );
    writer.endComponent();

    writer.beginComponent( GTO_COMPONENT_INDICES );
    writer.property( GTO_PROPERTY_VERTEX, Gto::Int, m_indicesVertex.size(),
1 );
    writer.endComponent();

    writer.beginComponent( GTO_COMPONENT_SMOOTHING );
    writer.property( GTO_PROPERTY_METHOD, Gto::Int, 1, 1 );
    writer.endComponent();

    writer.endObject();
}


############################

I've attached my modified and tested file.

Thanks!

Original issue reported on code.google.com by tstext...@gmail.com on 24 Mar 2010 at 5:49

Attachments:


Also, had to #include <algorithm> in Poly.cpp to get sort()

#include <algorithm>

Original comment by tstext...@gmail.com on 24 Mar 2010 at 5:56