Commit b5e8bef8 authored by Mike Kremer's avatar Mike Kremer

Added streaming operator for OpenVolumeMesh handles.

git-svn-id: http://www.openvolumemesh.org/svnrepo/OpenVolumeMesh/trunk@113 66977474-1d4b-4f09-8fe9-267525286df2
parent 6707088d
/*===========================================================================*\
* *
* OpenVolumeMesh *
* Copyright (C) 2011 by Computer Graphics Group, RWTH Aachen *
* www.openvolumemesh.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenVolumeMesh. *
* *
* OpenVolumeMesh 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 *
* following exceptions: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* OpenVolumeMesh is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU LesserGeneral Public *
* License along with OpenVolumeMesh. If not, *
* see <http://www.gnu.org/licenses/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision: 36 $ *
* $Date: 2012-01-10 18:00:06 +0100 (Di, 10 Jan 2012) $ *
* $LastChangedBy: kremer $ *
* *
\*===========================================================================*/
#include "OpenVolumeMeshHandle.hh"
namespace OpenVolumeMesh {
std::ostream& operator<<(std::ostream& _ostr, const OpenVolumeMeshHandle& _handle) {
_ostr << _handle.idx();
return _ostr;
}
std::istream& operator>>(std::istream& _istr, OpenVolumeMeshHandle& _handle) {
int val = 0;
_istr >> val;
_handle.idx(val);
return _istr;
}
} // Namespace OpenVolumeMesh
......@@ -88,6 +88,10 @@ class CellHandle : public OpenVolumeMeshHandle { public: CellHandle(int _idx
class HalfEdgeHandle : public OpenVolumeMeshHandle { public: HalfEdgeHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
class HalfFaceHandle : public OpenVolumeMeshHandle { public: HalfFaceHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
std::ostream& operator<<(std::ostream& _ostr, const OpenVolumeMeshHandle& _handle);
std::istream& operator>>(std::istream& _istr, OpenVolumeMeshHandle& _handle);
} // Namespace OpenVolumeMesh
#endif /* OPENVOLUMEMESHHANDLE_HH_ */
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