Commit a7bb1852 authored by Mike Kremer's avatar Mike Kremer

Updated core such that rotation center only is calculated after a file has...

Updated core such that rotation center only is calculated after a file has been loaded. Especially not when switching from some picking mode back to examiner mode. This leads to beeing forced to calculate rotation center after having moved an object via the move manipulator since its rotation center stays on the previous position unless its not updated explicitly.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@6139 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 8df84588
......@@ -482,6 +482,8 @@ void MovePlugin::manipulatorMoved( QtTranslationManipulatorNode* _node , QMouseE
}
}
PluginFunctions::setSceneCenter(_node->center(), PluginFunctions::ALL_VIEWERS );
lastActiveManipulator_ = objectId;
updateManipulatorDialog();
}
......@@ -747,15 +749,6 @@ void MovePlugin::slotSetDirection() {
return;
}
// // Apply to All Target Objects
// if ( pW->targetObjects->isChecked() ) {
// for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::TARGET_OBJECTS) ;
// o_it PluginFunctions::objectsEnd(); ++o_it){
//
// o_it->manipulatorNode()->set_direction( dirX, dirY );
// }
// }
BaseObjectData* object = pW->getBaseObjectData();
if ( object != 0 ) {
if ( object->manipulatorNode()->visible() ){
......@@ -790,37 +783,6 @@ void MovePlugin::slotTranslation() {
translation[2] = (pW->translationZ->text()).toDouble(&ok);
if ( !ok ) { emit log(LOGERR,"Wrong Format for Z Coordinate"); return; }
// // Apply to All Target Objects
// if ( pW->targetObjects->isChecked() ) {
//
// int manipcount = 0; // Check how many of the target meshes have an visible manipulator
// int targets = 0; // Count the number of target meshes
// for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::TARGET_OBJECTS); o_it != PluginFunctions::objectsEnd(); ++o_it) {
// ++targets;
// if ( ! o_it->manipulatorNode()->hidden() ) {
// ++ manipcount;
// }
// }
//
// if (manipcount == 0 ) // No manipulator -> no translation
// return;
//
// for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::TARGET_OBJECTS,DataType( DATA_TRIANGLE_MESH | DATA_POLY_MESH ));
// o_it != PluginFunctions::objectsEnd(); ++o_it) {
// if ( manipcount > 1 ) { // Use manipulator direction for each target mesh
// if ( o_it->manipulatorNode()->hidden() )
// continue;
// }
//
// translate( o_it->id() , translation );
//
// o_it->manipulatorNode()->set_center( o_it->manipulatorNode()->center() + translation );
// emit createBackup(o_it->id(),"Translation");
// emit updatedObject(o_it->id());
// }
//
// }
BaseObjectData* object = pW->getBaseObjectData();
if (object != 0) {
if (object->manipulatorNode()->visible()) {
......@@ -836,7 +798,6 @@ void MovePlugin::slotTranslation() {
return;
}
updateManipulatorDialog();
emit scriptInfo(QString("slotTranslation()"));
emit updateView();
......@@ -876,22 +837,6 @@ void MovePlugin::slotMoveManipToCOG() {
movePropsWidget* pW = getDialogFromButton(but);
if(pW == 0) return;
// if ( pW->targetObjects->isChecked() ) {
// for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::TARGET_OBJECTS) ; o_it != PluginFunctions::objectsEnd(); ++o_it) {
// if ( o_it->manipulatorNode()->hidden() )
// continue;
//
// if ( o_it->dataType( DATA_TRIANGLE_MESH ) )
// o_it->manipulatorNode()->set_center( MeshInfo::cog(*PluginFunctions::triMesh(*o_it) ) );
// else if ( o_it->dataType( DATA_POLY_MESH ) )
// o_it->manipulatorNode()->set_center( MeshInfo::cog(*PluginFunctions::polyMesh(*o_it)) );
//
// updateManipulatorDialog();
// o_it->manipulatorNode()->loadIdentity();
// }
// } else {
BaseObjectData* object = pW->getBaseObjectData();
if ( object != 0 ) {
if ( object->manipulatorNode()->visible() ){
......@@ -935,27 +880,6 @@ void MovePlugin::slotRotate() {
angle = (pW->rotAngle->text()).toDouble(&ok);
if ( !ok ) { emit log(LOGERR,"Wrong Format for Angle"); return; }
// if ( pW->targetObjects->isChecked() ) {
// for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::TARGET_OBJECTS) ; o_it != PluginFunctions::objectsEnd(); ++o_it) {
// if ( o_it->manipulatorNode()->hidden() )
// continue;
// o_it->manipulatorNode()->rotate( angle,axis);
//
// if (o_it->dataType( DATA_TRIANGLE_MESH ) )
// transformMesh( o_it->manipulatorNode()->matrix() , (*PluginFunctions::triMesh(*o_it)) );
//
// if (o_it->dataType( DATA_POLY_MESH ) )
// transformMesh( o_it->manipulatorNode()->matrix() , (*PluginFunctions::polyMesh(*o_it)) );
//
// o_it->manipulatorNode()->loadIdentity();
// updateManipulatorDialog();
//
// emit createBackup(o_it->id(),"Rotation");
// emit updatedObject(o_it->id());
// }
// } else {
BaseObjectData* object = pW->getBaseObjectData();
if (object != 0) {
if (object->manipulatorNode()->visible() && (object->target()
......@@ -1005,27 +929,6 @@ void MovePlugin::slotScale() {
scale[2] = (pW->scalez->text()).toDouble(&ok);
if ( !ok ) { emit log(LOGERR,"Wrong Format for factor 3"); return; }
// if ( pW->targetObjects->isChecked() ) {
// for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::TARGET_OBJECTS) ; o_it != PluginFunctions::objectsEnd(); ++o_it) {
// if ( o_it->manipulatorNode()->hidden() )
// continue;
// o_it->manipulatorNode()->scale( scale);
//
// if (o_it->dataType( DATA_TRIANGLE_MESH ) )
// transformMesh( o_it->manipulatorNode()->matrix() , (*PluginFunctions::triMesh(*o_it)) );
//
// if (o_it->dataType( DATA_POLY_MESH ) )
// transformMesh( o_it->manipulatorNode()->matrix() , (*PluginFunctions::polyMesh(*o_it)) );
//
// o_it->manipulatorNode()->loadIdentity();
// updateManipulatorDialog();
//
// emit createBackup(o_it->id(),"Scaling");
// emit updatedObject(o_it->id());
// }
// } else {
BaseObjectData* object = pW->getBaseObjectData();
if (object != 0) {
if (object->manipulatorNode()->visible() && (object->target()
......
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