Commit 2cfe7158 authored by Dirk Wilden's avatar Dirk Wilden

createBackup

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@11267 383ad7c9-94d9-4d36-a494-682f7c89f535
parent bb628282
......@@ -441,6 +441,9 @@ void MovePlugin::moveObject(ACG::Matrix4x4d mat, int _id) {
if ( ! PluginFunctions::getObject(_id,object) )
return;
if ( mat.is_identity() )
return;
if ( object->dataType() == DATA_TRIANGLE_MESH ) {
transformMesh(mat , *PluginFunctions::triMesh(object) );
} else if ( object->dataType() == DATA_POLY_MESH ) {
......@@ -466,7 +469,7 @@ void MovePlugin::moveObject(ACG::Matrix4x4d mat, int _id) {
}
emit updatedObject(_id, UPDATE_GEOMETRY);
emit createBackup(_id,"Move");
emit createBackup(_id, "Move Object", UPDATE_GEOMETRY);
}
......@@ -481,17 +484,22 @@ void MovePlugin::moveObject(ACG::Matrix4x4d mat, int _id) {
* @param mat
* @param _id
*/
void MovePlugin::moveSelection(ACG::Matrix4x4d mat, int _id) {
void MovePlugin::moveSelection(ACG::Matrix4x4d mat, int _id, QEvent::Type _type) {
if (selectionType_ == VERTEX)
transformVertexSelection( _id , mat );
else if (selectionType_ == FACE)
transformFaceSelection( _id , mat );
else if (selectionType_ == EDGE)
transformEdgeSelection( _id , mat );
if ( !mat.is_identity() ){
if (selectionType_ == VERTEX)
transformVertexSelection( _id , mat );
else if (selectionType_ == FACE)
transformFaceSelection( _id , mat );
else if (selectionType_ == EDGE)
transformEdgeSelection( _id , mat );
emit updatedObject(_id, UPDATE_GEOMETRY);
// emit createBackup(_id,"MoveSelection");
emit updatedObject(_id, UPDATE_GEOMETRY);
}
//only create backups on mouseRelease
if ( _type == QEvent::MouseButtonRelease )
emit createBackup(_id,"Move Selection", UPDATE_GEOMETRY);
}
//------------------------------------------------------------------------------
......@@ -616,7 +624,7 @@ void MovePlugin::manipulatorMoved( QtTranslationManipulatorNode* _node , QMouseE
if (PluginFunctions::pickMode() == "Move")
moveObject( mat, objectId );
else if (PluginFunctions::pickMode() == "MoveSelection")
moveSelection( mat, objectId );
moveSelection( mat, objectId, _event->type() );
// move all other targets without manipulator
if(allTargets_) {
......@@ -628,7 +636,7 @@ void MovePlugin::manipulatorMoved( QtTranslationManipulatorNode* _node , QMouseE
if (PluginFunctions::pickMode() == "Move")
moveObject( mat, o_it->id() );
else if (PluginFunctions::pickMode() == "MoveSelection")
moveSelection( mat, o_it->id() );
moveSelection( mat, o_it->id(), _event->type() );
}
}
}
......@@ -638,7 +646,6 @@ void MovePlugin::manipulatorMoved( QtTranslationManipulatorNode* _node , QMouseE
}
OpenFlipper::Options::redrawDisabled( false );
}
......
......@@ -107,7 +107,7 @@ class MovePlugin : public QObject, BaseInterface, MouseInterface, KeyInterface,
void addContextMenuItem(QAction* _action , ContextMenuType _type);
// BackupInterface
void createBackup( int _id , QString _name );
void createBackup( int _objectid, QString _name, UpdateType _type = UPDATE_ALL);
// LoggingInterface
void log(Logtype _type, QString _message);
......@@ -370,7 +370,7 @@ class MovePlugin : public QObject, BaseInterface, MouseInterface, KeyInterface,
void moveObject(ACG::Matrix4x4d mat, int _id);
/// Move selection on an object with given id
void moveSelection(ACG::Matrix4x4d mat, int _id);
void moveSelection(ACG::Matrix4x4d mat, int _id, QEvent::Type _type);
/// Object marker to dimm Objects during manipulator transformation
MoveObjectMarker objectMarker_;
......
......@@ -573,9 +573,10 @@ void MovePlugin::transformVertexSelection( int _objectId , Matrix4x4 _matrix ){
matString = matString.right( matString.length()-3 );
emit scriptInfo( "transformVertexSelection( ObjectId , Matrix4x4(" + matString + " ) )" );
// Create backup if there was a change
if (!_matrix.is_identity())
// the backup is only created when the slot is called via scripting (sender == 0)
if ( !_matrix.is_identity() && (sender() == 0) )
emit createBackup(_objectId, "Transformation of Vertex Selection");
}
......@@ -683,7 +684,8 @@ void MovePlugin::transformFaceSelection( int _objectId , Matrix4x4 _matrix ){
emit scriptInfo( "transformFaceSelection( ObjectId , Matrix4x4(" + matString + " ) )" );
// Create backup if there was a change
if (!_matrix.is_identity())
// the backup is only created when the slot is called via scripting (sender == 0)
if ( !_matrix.is_identity() && (sender() == 0) )
emit createBackup(_objectId, "Transformation of Face Selection");
}
......@@ -807,7 +809,8 @@ void MovePlugin::transformEdgeSelection( int _objectId , Matrix4x4 _matrix ){
emit scriptInfo( "transformEdgeSelection( ObjectId , Matrix4x4(" + matString + " ) )" );
// Create backup if there was a change
if (!_matrix.is_identity())
// the backup is only created when the slot is called via scripting (sender == 0)
if ( !_matrix.is_identity() && (sender() == 0) )
emit createBackup(_objectId, "Transformation of Edge Selection");
}
......
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