00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _LINK_MECHANICS_H_
00021 #define _LINK_MECHANICS_H_
00022
00023 #include "link.h"
00024
00025 #ifdef HAVE_OPENMBVCPPINTERFACE
00026 namespace OpenMBV {
00027 class Group;
00028 class Arrow;
00029 }
00030 #endif
00031
00032 namespace H5 {
00033 class Group;
00034 }
00035
00036 namespace MBSim {
00037 class Contour;
00038
00048 class LinkMechanics : public Link {
00049 public:
00054 LinkMechanics(const std::string &name);
00055
00059 virtual ~LinkMechanics();
00060
00061
00062 virtual void updatedhdz(double t);
00063
00064
00065
00066 virtual void init(InitStage stage);
00067
00068
00069
00070 std::string getType() const { return "Link"; }
00071 virtual void plot(double t, double dt = 1);
00072 virtual void closePlot();
00073
00074
00075
00076 virtual void updateWRef(const fmatvec::Mat& ref, int i=0);
00077 virtual void updateVRef(const fmatvec::Mat& ref, int i=0);
00078 virtual void updatehRef(const fmatvec::Vec &hRef, int i=0);
00079 virtual void updatedhdqRef(const fmatvec::Mat& ref, int i=0);
00080 virtual void updatedhduRef(const fmatvec::SqrMat& ref, int i=0);
00081 virtual void updatedhdtRef(const fmatvec::Vec& ref, int i=0);
00082 virtual void updaterRef(const fmatvec::Vec &ref, int i=0);
00083
00084
00085
00086 const std::vector<Contour*> & getContour() const { return contour; }
00087
00088
00089
00093 virtual void connect(Frame *frame_);
00094
00098 virtual void connect(Contour *contour_);
00099
00100 const std::vector<Frame*>& getFrame() const {
00101 return frame;
00102 }
00103
00104 protected:
00105 #ifdef HAVE_OPENMBVCPPINTERFACE
00106 void setOpenMBVForceArrow(const boost::shared_ptr<OpenMBV::Arrow> &arrow, const std::vector<bool>& which);
00107 void setOpenMBVMomentArrow(const boost::shared_ptr<OpenMBV::Arrow> &arrow, const std::vector<bool>& which);
00108 #endif
00109
00113 std::vector<fmatvec::Vec3> WF, WM;
00114
00118 std::vector<fmatvec::Mat3xV> fF, fM;
00119
00123 std::vector<Frame*> frame;
00124
00128 std::vector<Contour*> contour;
00129
00130 #ifdef HAVE_OPENMBVCPPINTERFACE
00131 boost::shared_ptr<OpenMBV::Group> openMBVForceGrp;
00132 std::vector<boost::shared_ptr<OpenMBV::Arrow> > openMBVArrowF;
00133 std::vector<boost::shared_ptr<OpenMBV::Arrow> > openMBVArrowM;
00134 #endif
00135 };
00136 }
00137
00138 #endif
00139