|
mbsimflexiblebody
4.0.0
|
00001 /* Copyright (C) 2004-2011 MBSim Development Team 00002 * 00003 * This library is free software; you can redistribute it and/or 00004 * modify it under the terms of the GNU Lesser General Public 00005 * License as published by the Free Software Foundation; either 00006 * version 2.1 of the License, or (at your option) any later version. 00007 * 00008 * This library is distributed in the hope that it will be useful, 00009 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 * Lesser General Public License for more details. 00012 * 00013 * You should have received a copy of the GNU Lesser General Public 00014 * License along with this library; if not, write to the Free Software 00015 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00016 * 00017 * Contact: thorsten.schindler@mytum.de 00018 */ 00019 00020 #ifndef _CONTOUR1S_FLEXIBLE_H_ 00021 #define _CONTOUR1S_FLEXIBLE_H_ 00022 00023 #include "mbsim/contours/contour1s.h" 00024 #include "mbsimFlexibleBody/utils/contact_utils.h" 00025 #include "mbsimFlexibleBody/flexible_body.h" 00026 #include "contour_1s_neutral_factory.h" 00027 00028 namespace MBSim { 00029 class ContactKinematics; 00030 } 00031 00032 namespace MBSimFlexibleBody { 00033 00046 class Contour1sFlexible : public MBSim::Contour1s { 00047 public: 00052 Contour1sFlexible(const std::string &name); 00053 00054 /* INHERITED INTERFACE OF ELEMENT */ 00055 virtual std::string getType() const { 00056 return "Contour1sFlexible"; 00057 } 00058 /***************************************************/ 00059 00060 /* INHERITED INTERFACE OF CONTOUR */ 00061 virtual void updateKinematicsForFrame(MBSim::ContourPointData &cp, MBSim::Frame::Frame::Feature ff) { 00062 if (neutral) 00063 neutral->updateKinematicsForFrame(cp, ff); 00064 else 00065 static_cast<FlexibleBody*>(parent)->updateKinematicsForFrame(cp, ff); //TODO: avoid asking parent body here! 00066 } 00067 virtual void updateJacobiansForFrame(MBSim::ContourPointData &cp, int j = 0) { 00068 if (neutral) 00069 neutral->updateJacobiansForFrame(cp); 00070 else 00071 static_cast<FlexibleBody*>(parent)->updateJacobiansForFrame(cp); 00072 } 00073 /***************************************************/ 00074 00075 /* INHERITED INTERFACE OF CONTOURCONTINUUM */ 00076 virtual void computeRootFunctionPosition(MBSim::ContourPointData &cp) { 00077 if (neutral) 00078 neutral->updateKinematicsForFrame(cp, MBSim::Frame::position); 00079 else 00080 updateKinematicsForFrame(cp, MBSim::Frame::position); 00081 } 00082 virtual void computeRootFunctionFirstTangent(MBSim::ContourPointData &cp) { 00083 if (neutral) 00084 neutral->updateKinematicsForFrame(cp, MBSim::Frame::firstTangent); 00085 else 00086 updateKinematicsForFrame(cp, MBSim::Frame::firstTangent); 00087 } 00088 virtual void computeRootFunctionNormal(MBSim::ContourPointData &cp) { 00089 if (neutral) 00090 neutral->updateKinematicsForFrame(cp, MBSim::Frame::normal); 00091 else 00092 updateKinematicsForFrame(cp, MBSim::Frame::normal); 00093 } 00094 virtual void computeRootFunctionSecondTangent(MBSim::ContourPointData &cp) { 00095 if (neutral) 00096 neutral->updateKinematicsForFrame(cp, MBSim::Frame::secondTangent); 00097 else 00098 updateKinematicsForFrame(cp, MBSim::Frame::secondTangent); 00099 } 00100 /***************************************************/ 00101 00102 MBSim::ContactKinematics * findContactPairingWith(std::string type0, std::string type1) { 00103 return findContactPairingFlexible(type0.c_str(), type1.c_str()); 00104 } 00105 00106 void setNeutral(Contour1sNeutralFactory* neutral_) { 00107 neutral = neutral_; 00108 } 00109 00110 protected: 00116 Contour1sNeutralFactory* neutral; 00117 00118 }; 00119 00120 } 00121 00122 #endif /* _CONTOUR1S_FLEXIBLE_H_ */ 00123
1.8.0