Commit c15f0f60 authored by Isaak Lim's avatar Isaak Lim

- fixed writing face indices in different configurations regarding vertex...

- fixed writing face indices in different configurations regarding vertex texture coordinates and vertex normals
- adjusted the intial patch provided by Robert Luo

refs #1560

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@824 fdac6126-5c0c-442c-9429-916003d36597
parent 83722b8e
......@@ -270,6 +270,10 @@ write(std::ostream& _out, BaseExporter& _be, Options _opt, std::streamsize _prec
int lastMat = -1;
// we do not want to write seperators if we only write vertex indices
bool onlyVertices = !_opt.check(Options::VertexTexCoord)
&& !_opt.check(Options::VertexNormal);
// faces (indices starting at 1 not 0)
for (i=0, nF=_be.n_faces(); i<nF; ++i)
{
......@@ -305,19 +309,21 @@ write(std::ostream& _out, BaseExporter& _be, Options _opt, std::streamsize _prec
idx = vhandles[j].idx() + 1;
_out << " " << idx;
// write separator
_out << "/" ;
// write vertex texture coordinate index
if (_opt.check(Options::VertexTexCoord))
_out << idx;
if (!onlyVertices) {
// write separator
_out << "/" ;
// write separator
_out << "/" ;
// write vertex texture coordinate index
if (_opt.check(Options::VertexTexCoord))
_out << idx;
// write vertex normal index
if ( _opt.check(Options::VertexNormal) )
_out << idx;
// write vertex normal index
if ( _opt.check(Options::VertexNormal) ) {
// write separator
_out << "/" ;
_out << idx;
}
}
}
_out << std::endl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment