Commit 7d6fb1f2 authored by Dirk Wilden's avatar Dirk Wilden

transform skeletons

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@10977 383ad7c9-94d9-4d36-a494-682f7c89f535
parent a12f03a8
...@@ -8,4 +8,8 @@ if (EXISTS ${CMAKE_SOURCE_DIR}/ObjectTypes/TSplineMesh) ...@@ -8,4 +8,8 @@ if (EXISTS ${CMAKE_SOURCE_DIR}/ObjectTypes/TSplineMesh)
add_definitions (-DENABLE_TSPLINEMESH_SUPPORT) add_definitions (-DENABLE_TSPLINEMESH_SUPPORT)
endif () endif ()
if (EXISTS ${CMAKE_SOURCE_DIR}/ObjectTypes/Skeleton)
add_definitions (-DENABLE_SKELETON_SUPPORT)
endif ()
openflipper_plugin ( TSplineMesh TRANSLATION_LANGUAGES de_DE INSTALLDATA Icons ) openflipper_plugin ( TSplineMesh TRANSLATION_LANGUAGES de_DE INSTALLDATA Icons )
...@@ -67,6 +67,10 @@ ...@@ -67,6 +67,10 @@
#include <ObjectTypes/TSplineMesh/TSplineMesh.hh> #include <ObjectTypes/TSplineMesh/TSplineMesh.hh>
#endif #endif
#ifdef ENABLE_SKELETON_SUPPORT
#include <ObjectTypes/Skeleton/Helper/SkeletonTransform.hh>
#endif
/** \brief Default Constructor /** \brief Default Constructor
* *
*/ */
...@@ -448,6 +452,10 @@ void MovePlugin::moveObject(ACG::Matrix4x4d mat, int _id) { ...@@ -448,6 +452,10 @@ void MovePlugin::moveObject(ACG::Matrix4x4d mat, int _id) {
#ifdef ENABLE_POLYLINE_SUPPORT #ifdef ENABLE_POLYLINE_SUPPORT
} else if ( object->dataType() == DATA_POLY_LINE ) { } else if ( object->dataType() == DATA_POLY_LINE ) {
transformPolyLine(mat , *PluginFunctions::polyLine(object) ); transformPolyLine(mat , *PluginFunctions::polyLine(object) );
#endif
#ifdef ENABLE_SKELETON_SUPPORT
} else if ( object->dataType() == DATA_SKELETON ) {
transformSkeleton(mat , *PluginFunctions::skeleton(object) );
#endif #endif
} else if ( object->dataType() == DATA_PLANE ) { } else if ( object->dataType() == DATA_PLANE ) {
PluginFunctions::planeNode(object)->transform(mat); PluginFunctions::planeNode(object)->transform(mat);
...@@ -1708,6 +1716,24 @@ void MovePlugin::transformPolyLine( ACG::Matrix4x4d _mat , PolyLineT& _polyLine ...@@ -1708,6 +1716,24 @@ void MovePlugin::transformPolyLine( ACG::Matrix4x4d _mat , PolyLineT& _polyLine
#endif #endif
//------------------------------------------------------------------------------
#ifdef ENABLE_SKELETON_SUPPORT
/** \brief Transform a skeleton with the given transformation matrix
*
* @param _mat transformation matrix
* @param _skeleton the skeleton
*/
void MovePlugin::transformSkeleton( ACG::Matrix4x4d _mat , Skeleton& _skeleton ) {
SkeletonTransform transformer(_skeleton);
transformer.transformSkeleton(_mat);
}
#endif
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
/** \brief scale mesh to have a boundingboxdiagonal of one /** \brief scale mesh to have a boundingboxdiagonal of one
......
...@@ -63,6 +63,10 @@ ...@@ -63,6 +63,10 @@
#include <ObjectTypes/Plane/Plane.hh> #include <ObjectTypes/Plane/Plane.hh>
#include <ObjectTypes/TriangleMesh/TriangleMesh.hh> #include <ObjectTypes/TriangleMesh/TriangleMesh.hh>
#ifdef ENABLE_SKELETON_SUPPORT
#include <ObjectTypes/Skeleton/Skeleton.hh>
#endif
#include "MoveToolbar.hh" #include "MoveToolbar.hh"
#include "MoveProps.hh" #include "MoveProps.hh"
#include "MoveObjectMarker.hh" #include "MoveObjectMarker.hh"
...@@ -320,6 +324,11 @@ class MovePlugin : public QObject, BaseInterface, MouseInterface, KeyInterface, ...@@ -320,6 +324,11 @@ class MovePlugin : public QObject, BaseInterface, MouseInterface, KeyInterface,
void transformPolyLine( ACG::Matrix4x4d _mat , PolyLineT& _polyLine ); void transformPolyLine( ACG::Matrix4x4d _mat , PolyLineT& _polyLine );
#endif #endif
#ifdef ENABLE_SKELETON_SUPPORT
///Transform a skeleton with the given transformation matrix
void transformSkeleton( ACG::Matrix4x4d _mat , Skeleton& _skeleton );
#endif
/** Get the Matrix of the last active Manipulator ( Identity if not found or hidden Manipulator ) /** Get the Matrix of the last active Manipulator ( Identity if not found or hidden Manipulator )
* *
* @param _reset reset the transformation matrix of the manipulator to identity) * @param _reset reset the transformation matrix of the manipulator to identity)
......
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