remove redundant code
refs #2525 git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@1328 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
@@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
//== INCLUDES =================================================================
|
//== INCLUDES =================================================================
|
||||||
|
|
||||||
|
#include <fstream>
|
||||||
#include <OpenMesh/Core/System/config.h>
|
#include <OpenMesh/Core/System/config.h>
|
||||||
#include <OpenMesh/Core/System/omstream.hh>
|
#include <OpenMesh/Core/System/omstream.hh>
|
||||||
#include <OpenMesh/Core/Utils/Endian.hh>
|
#include <OpenMesh/Core/Utils/Endian.hh>
|
||||||
@@ -87,47 +87,10 @@ bool
|
|||||||
_OFFWriter_::
|
_OFFWriter_::
|
||||||
write(const std::string& _filename, BaseExporter& _be, Options _opt, std::streamsize _precision) const
|
write(const std::string& _filename, BaseExporter& _be, Options _opt, std::streamsize _precision) const
|
||||||
{
|
{
|
||||||
// check exporter features
|
std::ofstream out(_filename.c_str(), (_opt.check(Options::Binary) ? std::ios_base::binary | std::ios_base::out
|
||||||
if ( !check( _be, _opt ) )
|
: std::ios_base::out) );
|
||||||
return false;
|
|
||||||
|
|
||||||
|
return write(out, _be, _opt, _precision);
|
||||||
// check writer features
|
|
||||||
if ( _opt.check(Options::FaceNormal) ) // not supported by format
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// open file
|
|
||||||
std::fstream out(_filename.c_str(), (_opt.check(Options::Binary) ? std::ios_base::binary | std::ios_base::out
|
|
||||||
: std::ios_base::out) );
|
|
||||||
if (!out)
|
|
||||||
{
|
|
||||||
omerr() << "[OFFWriter] : cannot open file "
|
|
||||||
<< _filename
|
|
||||||
<< std::endl;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// write header line
|
|
||||||
if (_opt.check(Options::VertexTexCoord)) out << "ST";
|
|
||||||
if (_opt.check(Options::VertexColor) || _opt.check(Options::FaceColor)) out << "C";
|
|
||||||
if (_opt.check(Options::VertexNormal)) out << "N";
|
|
||||||
out << "OFF";
|
|
||||||
if (_opt.check(Options::Binary)) out << " BINARY";
|
|
||||||
out << "\n";
|
|
||||||
|
|
||||||
|
|
||||||
if (!_opt.check(Options::Binary))
|
|
||||||
out.precision(_precision);
|
|
||||||
|
|
||||||
// write to file
|
|
||||||
bool result = (_opt.check(Options::Binary) ?
|
|
||||||
write_binary(out, _be, _opt) :
|
|
||||||
write_ascii(out, _be, _opt));
|
|
||||||
|
|
||||||
|
|
||||||
// return result
|
|
||||||
out.close();
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -63,7 +63,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <fstream>
|
#include <ostream>
|
||||||
|
|
||||||
#include <OpenMesh/Core/System/config.h>
|
#include <OpenMesh/Core/System/config.h>
|
||||||
#include <OpenMesh/Core/Utils/SingletonT.hh>
|
#include <OpenMesh/Core/Utils/SingletonT.hh>
|
||||||
|
|||||||
Reference in New Issue
Block a user