Commit 0db3e694 authored by Hans-Christian Ebke's avatar Hans-Christian Ebke

Store mesh comments as comment in OFF files.


git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@16127 383ad7c9-94d9-4d36-a494-682f7c89f535
parent cbf56a4e
......@@ -46,6 +46,7 @@
#include <OpenMesh/Core/Utils/color_cast.hh>
#include <OpenMesh/Core/Geometry/VectorT.hh>
#include <sstream>
template< class MeshT >
......@@ -80,6 +81,21 @@ bool FileOFFPlugin::writeMesh(std::ostream& _out, MeshT& _mesh ){
_out << "\n";
/*
* Comment
*/
OpenMesh::MPropHandleT<std::string> mp_comment;
if (_mesh.get_property_handle(mp_comment, "COMMENT")) {
_out << "# %% BEGIN OPENFLIPPER_COMMENT %%" << std::endl;
std::istringstream comment(_mesh.property(mp_comment));
std::string commentLine;
while (std::getline(comment, commentLine)) {
_out << "# " << commentLine << std::endl;
}
_out << "# %% END OPENFLIPPER_COMMENT %%" << std::endl;
}
/*****************
* DATA
******************/
......
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