Commit of the debugged version of Alex' improvement to OpenMesh. File i/o is now done via istream/ostream instances such that direct buffer writing to files (serialization) will also be possible in future releases.

Code is tested.

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@221 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
Mike Kremer
2009-11-17 13:54:16 +00:00
parent 86b53bf930
commit efa67fbcfc
24 changed files with 512 additions and 242 deletions

View File

@@ -4,10 +4,10 @@
* Copyright (C) 2001-2009 by Computer Graphics Group, RWTH Aachen *
* www.openmesh.org *
* *
*---------------------------------------------------------------------------*
*---------------------------------------------------------------------------*
* This file is part of OpenMesh. *
* *
* OpenMesh is free software: you can redistribute it and/or modify *
* OpenMesh is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of *
* the License, or (at your option) any later version with the *
@@ -30,10 +30,10 @@
* License along with OpenMesh. If not, *
* see <http://www.gnu.org/licenses/>. *
* *
\*===========================================================================*/
\*===========================================================================*/
/*===========================================================================*\
* *
* *
* $Revision$ *
* $Date$ *
* *
@@ -112,7 +112,7 @@ read(const std::string& _filename, BaseImporter& _bi, Options& _opt)
{
std::fstream in( _filename.c_str(), std::ios_base::in );
if (!in)
if (!in.is_open() || !in.good())
{
omerr() << "[OBJReader] : cannot not open file "
<< _filename
@@ -137,7 +137,6 @@ read(const std::string& _filename, BaseImporter& _bi, Options& _opt)
return result;
}
//-----------------------------------------------------------------------------
bool
@@ -264,7 +263,7 @@ read_material(std::fstream& _in)
bool
_OBJReader_::
read(std::fstream& _in, BaseImporter& _bi, Options& _opt)
read(std::istream& _in, BaseImporter& _bi, Options& _opt)
{
omlog() << "[OBJReader] : read file\n";