Commit c4a2740a authored by Dirk Wilden's avatar Dirk Wilden

removed skeleton stuff

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@10510 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 79fec49a
......@@ -8,8 +8,4 @@ if (EXISTS ${CMAKE_SOURCE_DIR}/ObjectTypes/TSplineMesh)
add_definitions (-DENABLE_TSPLINEMESH_SUPPORT)
endif ()
if (EXISTS ${CMAKE_SOURCE_DIR}/ObjectTypes/Skeleton)
add_definitions (-DENABLE_SKELETON_SUPPORT)
endif ()
openflipper_plugin ( TSplineMesh TRANSLATION_LANGUAGES de_DE INSTALLDATA Icons )
This diff is collapsed.
......@@ -63,10 +63,6 @@
#include <ObjectTypes/Plane/Plane.hh>
#include <ObjectTypes/TriangleMesh/TriangleMesh.hh>
#ifdef ENABLE_SKELETON_SUPPORT
#include <ObjectTypes/Skeleton/Skeleton.hh>
#endif
#include "MoveToolbar.hh"
#include "MoveProps.hh"
#include "MoveObjectMarker.hh"
......@@ -234,10 +230,6 @@ class MovePlugin : public QObject, BaseInterface, MouseInterface, KeyInterface,
template <typename MeshType>
OpenMesh::Vec3d getNearestFace(MeshType* _mesh, uint _fh, OpenMesh::Vec3d& _hitPoint);
#ifdef ENABLE_SKELETON_SUPPORT
OpenMesh::Vec3d getNearestJoint(SkeletonObject* _skeletonObj, OpenMesh::Vec3d &_hitPoint, int& _bestJointID);
#endif
/// True if the toolbox widget is active
bool toolboxActive_;
......@@ -254,7 +246,6 @@ class MovePlugin : public QObject, BaseInterface, MouseInterface, KeyInterface,
private :
QAction* moveAction_;
QAction* moveSelectionAction_;
QAction* moveSkeletonAction_;
QActionGroup* toolBarActions_;
......@@ -326,10 +317,6 @@ class MovePlugin : public QObject, BaseInterface, MouseInterface, KeyInterface,
template< class PolyLineT >
void transformPolyLine( ACG::Matrix4x4d _mat , PolyLineT& _polyLine );
#endif
#ifdef ENABLE_SKELETON_SUPPORT
void transformSkeleton(ACG::Matrix4x4d _mat , SkeletonObject* _skeletonObj );
#endif
/** Get the Matrix of the last active Manipulator ( Identity if not found or hidden Manipulator )
*
......@@ -373,20 +360,10 @@ class MovePlugin : public QObject, BaseInterface, MouseInterface, KeyInterface,
/// Move selection on an object with given id
void moveSelection(ACG::Matrix4x4d mat, int _id);
#ifdef ENABLE_SKELETON_SUPPORT
/// Move joint of a skeleton
void moveSkeletonJoint(ACG::Matrix4x4d mat, int _id);
#endif
/// Object marker to dimm Objects during manipulator transformation
MoveObjectMarker objectMarker_;
#ifdef ENABLE_SKELETON_SUPPORT
/// make sure the manipulator is positioned on a joint
void moveManipulatorOnSkeleton(BaseObjectData* _skeletonObj);
#endif
private:
/// Holds the current manipulator mode
......@@ -490,11 +467,6 @@ public slots :
/// transform current selection of an Object by a given matrix
void transformEdgeSelection( int _objectId , Matrix4x4 _matrix );
#ifdef ENABLE_SKELETON_SUPPORT
/// transform selected joint with given matrix
void transformSkeletonJoint( int _objectId , Matrix4x4 _matrix );
#endif
/// Set the position of the manipulator
void setManipulatorPosition( int _objectId , Vector _position );
......@@ -523,11 +495,6 @@ public slots :
bool allTargets_;
bool placeMode_;
// skeleton
bool recursiveJointTransformation_;
bool transformRefPose_;
bool transformCurrentPose_;
};
#endif //MOVEPLUGIN_HH
......@@ -49,10 +49,6 @@
#ifdef ENABLE_TSPLINEMESH_SUPPORT
#include <ObjectTypes/TSplineMesh/TSplineMesh.hh>
#endif
#ifdef ENABLE_SKELETON_SUPPORT
#include <ObjectTypes/Skeleton/SkeletonTransform.hh>
#endif
#include <MeshTools/MeshFunctions.hh>
......@@ -812,115 +808,6 @@ void MovePlugin::transformEdgeSelection( int _objectId , Matrix4x4 _matrix ){
//------------------------------------------------------------------------------
#ifdef ENABLE_SKELETON_SUPPORT
/** \brief transform selected joints with given matrix
*
* when a manipulator is placed on a joint, the selection of the skeleton
* is cleared and only that joint is selected
* the selection is used here to find the joint to be deformed
*
* @param _objectId id of an object
* @param _matrix transformation matrix
*/
void MovePlugin::transformSkeletonJoint( int _objectId , Matrix4x4 _matrix ){
BaseObjectData* obj = 0;
PluginFunctions::getObject(_objectId, obj);
if (obj == 0){
emit log(LOGERR, tr("Unable to get object"));
return;
}
SkeletonObject* skeletonObj = PluginFunctions::skeletonObject(obj);
if (skeletonObj == 0){
emit log(LOGERR, tr("Unable to get skeletonObject"));
return;
}
Skeleton* skeleton = PluginFunctions::skeleton(obj);
if (skeleton == 0){
emit log(LOGERR, tr("Unable to get skeleton"));
return;
}
bool recursiveJointTransformation = recursiveJointTransformation_;
AnimationHandle handle = skeletonObj->skeletonNode()->getActivePose();
Skeleton::Pose* activePose;
if ( !handle.isValid() ){
activePose = skeleton->getReferencePose();
}else{
activePose = skeleton->getAnimation( handle.getAnimation() )->getPose( handle.getFrame() );
//always tranform children otherwise only the local coordsys is rotated
recursiveJointTransformation = false;
// translation changes the skeleton structure
// this is only allowed in refPose therefore delete translation
Matrix4x4 mat = _matrix;
mat(0,3) = 0.0;
mat(1,3) = 0.0;
mat(2,3) = 0.0;
if ( mat.is_identity() )
_matrix = mat;
}
Skeleton::Joint* joint = skeleton->getJoint( skeletonObj->manipulatorNode()->getData().toInt() );
SkeletonTransform transformer(*skeleton);
if ( handle.isValid() )
//we are in an animation pose -> only rotation allowed
transformer.rotateJoint(joint, activePose, _matrix, !transformCurrentPose_);
else
//we are in the refPose apply full transformation
transformer.transformJoint(joint, _matrix, recursiveJointTransformation);
// //if we are in refPose update segmentation
// if ( !handle.isValid() ){
// //tell segmenation plugin to update the segmentation
// bool exists = false;
//
// emit functionExists("segmentationplugin", "updateSegmentation()", exists);
//
// if (exists)
// RPC::callFunction("segmentationplugin", "updateSegmentation");
// }
//update the skin
bool exists = false;
emit functionExists("skeletonplugin", "updateSkin()", exists);
if (exists)
RPC::callFunction("skeletonplugin", "updateSkin");
emit updatedObject(_objectId, UPDATE_GEOMETRY);
QString matString;
for (int i=0; i < 4; i++)
for (int j=0; j < 4; j++)
matString += " , " + QString::number( _matrix(i,j) );
matString = matString.right( matString.length()-3 );
emit scriptInfo( "transformSkeletonJoint( ObjectId , Matrix4x4(" + matString + " ) )" );
// Create backup
emit createBackup(_objectId, "Transformation of Skeleton Joints");
}
#endif
//------------------------------------------------------------------------------
/** \brief set the position of the manipulator
*
* @param _objectId id of an object
......
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