LaparoscopicRigidMapping.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef SOFA_COMPONENT_MAPPING_LAPAROSCOPICRIGIDMAPPING_H
00026 #define SOFA_COMPONENT_MAPPING_LAPAROSCOPICRIGIDMAPPING_H
00027
00028
00029 #include <sofa/core/componentmodel/behavior/MechanicalMapping.h>
00030 #include <sofa/core/componentmodel/behavior/MechanicalState.h>
00031 #include <sofa/defaulttype/RigidTypes.h>
00032 #include <sofa/defaulttype/LaparoscopicRigidTypes.h>
00033 #include <sofa/component/topology/PointSubset.h>
00034 #include <sofa/component/MechanicalObject.h>
00035 #include <sofa/simulation/tree/GNode.h>
00036 #include <sofa/defaulttype/VecTypes.h>
00037
00038
00039 namespace sofa
00040 {
00041
00042 namespace component
00043 {
00044
00045 namespace mapping
00046 {
00047
00048 template <class BasicMapping>
00049 class LaparoscopicRigidMapping : public BasicMapping, public virtual core::objectmodel::BaseObject
00050 {
00051 public:
00052 typedef BasicMapping Inherit;
00053 typedef typename Inherit::In In;
00054 typedef typename Inherit::Out Out;
00055 typedef typename Out::VecCoord VecCoord;
00056 typedef typename In::VecCoord InVecCoord;
00057 typedef typename Out::VecDeriv VecDeriv;
00058 typedef typename Out::Coord Coord;
00059 typedef typename Out::Deriv Deriv;
00060
00061
00062 public:
00063 Data<defaulttype::Vector3> pivot;
00064 Data<defaulttype::Quat> rotation;
00065
00066 LaparoscopicRigidMapping(In* from, Out* to)
00067 : Inherit(from, to)
00068 , pivot(initData(&pivot, defaulttype::Vector3(0,0,0), "pivot","Pivot point position"))
00069 , rotation(initData(&rotation, defaulttype::Quat(0,0,0,1), "rotation", "TODO-rotation"))
00070 {
00071 }
00072
00073 virtual ~LaparoscopicRigidMapping()
00074 {
00075 }
00076
00077
00078
00079
00080
00081 void init();
00082
00083 void apply( typename Out::VecCoord& out, const typename In::VecCoord& in );
00084
00085 void applyJ( typename Out::VecDeriv& out, const typename In::VecDeriv& in );
00086
00087 void applyJT( typename In::VecDeriv& out, const typename Out::VecDeriv& in );
00088
00089 void draw();
00090
00091 protected:
00092 defaulttype::Quat currentRotation;
00093 };
00094
00095 }
00096
00097 }
00098
00099 }
00100
00101 #endif