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 protected:
00101 #ifdef HAVE_OPENMBVCPPINTERFACE
00102 void setOpenMBVForceArrow(OpenMBV::Arrow *arrow, const std::vector<bool>& which);
00103 void setOpenMBVMomentArrow(OpenMBV::Arrow *arrow, const std::vector<bool>& which);
00104 #endif
00105
00109 std::vector<fmatvec::Vec3> WF, WM;
00110
00114 std::vector<fmatvec::Mat3xV> fF, fM;
00115
00119 std::vector<Frame*> frame;
00120
00124 std::vector<Contour*> contour;
00125
00126 #ifdef HAVE_OPENMBVCPPINTERFACE
00127 OpenMBV::Group *openMBVForceGrp;
00128 std::vector<OpenMBV::Arrow*> openMBVArrowF;
00129 std::vector<OpenMBV::Arrow*> openMBVArrowM;
00130 #endif
00131 };
00132 }
00133
00134 #endif
00135