Commit f70cf5d2 authored by Hans-Christian Ebke's avatar Hans-Christian Ebke

Migrated comment functionality into BaseObject.


git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@16144 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 786e7432
......@@ -1251,7 +1251,7 @@ bool FileOFFPlugin::saveObject(int _id, QString _filename)
PolyMeshObject* polyObj = dynamic_cast<PolyMeshObject* >( object );
if (writeMesh(ofs, *polyObj->mesh())){
if (writeMesh(ofs, *polyObj->mesh(), *polyObj)){
emit log(LOGINFO, tr("Saved object to ") + _filename );
ofs.close();
return true;
......@@ -1267,7 +1267,7 @@ bool FileOFFPlugin::saveObject(int _id, QString _filename)
TriMeshObject* triObj = dynamic_cast<TriMeshObject* >( object );
if (writeMesh(ofs, *triObj->mesh())) {
if (writeMesh(ofs, *triObj->mesh(), *triObj)) {
emit log(LOGINFO, tr("Saved object to ") + _filename );
ofs.close();
return true;
......
......@@ -213,7 +213,7 @@ class FileOFFPlugin : public QObject, BaseInterface, FileInterface, LoadSaveInte
/// Writer function
template< class MeshT >
bool writeMesh(std::ostream& _out, MeshT& _mesh );
bool writeMesh(std::ostream& _out, MeshT& _mesh, BaseObject &_baseObj);
/// Write binary mesh data to file
template< class MeshT >
......
......@@ -50,7 +50,7 @@
template< class MeshT >
bool FileOFFPlugin::writeMesh(std::ostream& _out, MeshT& _mesh ){
bool FileOFFPlugin::writeMesh(std::ostream& _out, MeshT& _mesh, BaseObject &_baseObj){
/*****************
* HEADER
......@@ -86,9 +86,10 @@ bool FileOFFPlugin::writeMesh(std::ostream& _out, MeshT& _mesh ){
* Comment
*/
OpenMesh::MPropHandleT<std::string> mp_comment;
if (_mesh.get_property_handle(mp_comment, "COMMENT")) {
if (_baseObj.hasComments()) {
_out << "# %% BEGIN OPENFLIPPER_COMMENT %%" << std::endl;
std::istringstream comment(_mesh.property(mp_comment));
std::istringstream comment(_baseObj.getAllCommentsFlat().toStdString());
std::string commentLine;
while (std::getline(comment, commentLine)) {
_out << "# " << commentLine << 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