23 #include <mbsim/link_mechanics.h>
24 #ifdef HAVE_OPENMBVCPPINTERFACE
33 class ContactKinematics;
34 class GeneralizedForceLaw;
35 class GeneralizedImpactLaw;
36 class FrictionForceLaw;
37 class FrictionImpactLaw;
38 class ContourPointData;
67 virtual void updatewb(
double t,
int i=0);
68 virtual void updateW(
double t,
int i=0);
69 virtual void updateV(
double t,
int i=0);
70 virtual void updateh(
double t,
int i=0);
71 virtual void updateg(
double t);
72 virtual void updategd(
double t);
73 virtual void updateStopVector(
double t);
74 virtual void updateJacobians(
double t,
int j=0);
78 virtual void updateWRef(
const fmatvec::Mat &ref,
int j=0);
79 virtual void updateVRef(
const fmatvec::Mat &ref,
int j=0);
80 virtual void updatehRef(
const fmatvec::Vec &hRef,
int j=0);
83 virtual void updategRef(
const fmatvec::Vec& ref);
87 virtual void updatejsvRef(
const fmatvec::Vector<int> &ref);
88 virtual void calcxSize();
98 virtual void updateLinkStatus(
double dt);
99 virtual void updateLinkStatusReg(
double dt);
115 virtual void LinearImpactEstimation(fmatvec::Vec &gInActive_,fmatvec::Vec &gdInActive_,
int *IndInActive_,fmatvec::Vec &gAct_,
int *IndActive_);
121 virtual std::string
getType()
const {
return "Contact"; }
122 virtual void plot(
double t,
double dt = 1);
126 #ifdef HAVE_OPENMBVCPPINTERFACE
133 void enableOpenMBVContactPoints(
double size=1.,
bool enable=
true) { openMBVContactFrameSize=size; openMBVContactFrameEnabled=enable; }
140 void setOpenMBVNormalForceArrow(OpenMBV::Arrow *arrow) { contactArrow=arrow; }
149 void setOpenMBVFrictionArrow(OpenMBV::Arrow *arrow) { frictionArrow=arrow; }
153 void setContactForceLaw(GeneralizedForceLaw *fcl_) {
fcl = fcl_; }
154 GeneralizedForceLaw * getContactForceLaw()
const {
return fcl; }
155 void setContactImpactLaw(GeneralizedImpactLaw *fnil_) {
fnil = fnil_; }
156 void setFrictionForceLaw(FrictionForceLaw *fdf_) {
fdf = fdf_; }
157 void setFrictionImpactLaw(FrictionImpactLaw *ftil_) {
ftil = ftil_; }
171 void connect(Contour *contour1, Contour* contour2);
173 void computeCurvatures(fmatvec::Vec &
r)
const;
175 virtual void initializeUsingXML(TiXmlElement *element);
177 void calccorrSize(
int j);
178 void updatecorr(
int j);
179 void updatecorrRef(
const fmatvec::Vec& ref);
242 std::vector<fmatvec::Vec>
gk, gdk, gdnk, gddk, lak, wbk, svk, rFactork;
247 std::vector<fmatvec::Vector<int> >
jsvk;
252 std::vector<fmatvec::Mat*>
fF;
257 std::vector<fmatvec::Vec*>
WF;
262 std::vector<fmatvec::Mat*>
Vk[2], Wk[2];
267 std::vector<int>
laSizek, laIndk, gSizek, gIndk, gdSizek, gdIndk, svSizek, svIndk, rFactorSizek, rFactorIndk;
269 #ifdef HAVE_OPENMBVCPPINTERFACE
273 OpenMBV::Group * openMBVContactGrp;
278 std::vector<std::vector<OpenMBV::Frame*> > openMBVContactFrame;
283 std::vector<OpenMBV::Arrow *> openMBVNormalForceArrow, openMBVFrictionArrow;
288 double openMBVContactFrameSize;
293 bool openMBVContactFrameEnabled;
298 OpenMBV::Arrow *contactArrow, *frictionArrow;
324 std::string saved_ref1, saved_ref2;