Commit 08de85bf authored by Mike Kremer's avatar Mike Kremer

Added scripting function for the transformation of handle vertices.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@15599 383ad7c9-94d9-4d36-a494-682f7c89f535
parent a3ff699c
......@@ -489,6 +489,9 @@ public slots :
/// transform current selection of an Object by a given matrix
void transformEdgeSelection( int _objectId , Matrix4x4 _matrix );
/// Transform handle region using the given transformation matrix
void transformHandleRegion(int _objectId, Matrix4x4 _matrix);
/// Set the position of the manipulator
void setManipulatorPosition( int _objectId , Vector _position );
......
......@@ -73,6 +73,9 @@ void MovePlugin::setDescriptions(){
emit setSlotDescription("translateEdgeSelection(int,Vector)",tr("Translate current edge selection of an object by given vector."),
QString(tr("objectId,Vector")).split(","), QString(tr("ID of an object, translation vector")).split(","));
emit setSlotDescription("transformHandleRegion(int,Matrix4x4)",tr("Transform handle region using the specified matrix."),
QString(tr("objectId,Matrix")).split(","), QString(tr("ID of an object, transformation matrix")).split(","));
emit setSlotDescription("transform(int,Matrix4x4)",tr("transform object by given matrix."),
QString(tr("objectId,Matrix")).split(","), QString(tr("ID of an object, transformation matrix")).split(","));
......@@ -543,6 +546,32 @@ void MovePlugin::translateEdgeSelection( int _objectId , Vector _vector) {
}
//------------------------------------------------------------------------------
void MovePlugin::transformHandleRegion(int _objectId, Matrix4x4 _matrix) {
BaseObjectData* object = NULL;
if (!PluginFunctions::getObject(_objectId, object)) {
emit log(LOGERR, tr("transformHandleRegion: Unable to get object!"));
return;
}
if(object->dataType(DATA_TRIANGLE_MESH)) {
TriMesh& mesh = (*PluginFunctions::triMesh(object));
MeshFunctions::transformHandleVertices(_matrix, mesh);
} else if(object->dataType(DATA_POLY_MESH)) {
PolyMesh& mesh = (*PluginFunctions::polyMesh(object));
MeshFunctions::transformHandleVertices(_matrix, mesh);
}
emit updatedObject(_objectId, UPDATE_GEOMETRY);
}
//------------------------------------------------------------------------------
/** \brief tranform an object
*
* @param _objectId object id
......
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