mbsimflexiblebody  3.2.0
flexible_band.h
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 _FLEXIBLE_BAND_H_
00021 #define _FLEXIBLE_BAND_H_
00022 
00023 #include "mbsimFlexibleBody/contours/contour1s_flexible.h"
00024 #include "mbsim/contour.h"
00025 
00026 namespace MBSimFlexibleBody {
00027 
00035   class FlexibleBand : public Contour1sFlexible {       
00036     public:
00041       FlexibleBand(const std::string& name);
00042 
00043       /* INHERITED INTERFACE OF ELEMENT */
00044       virtual std::string getType() const { return "FlexibleBand"; }
00045       /***************************************************/
00046 
00047       /* INHERITED INTERFACE OF CONTOUR */
00048       virtual void updateKinematicsForFrame(MBSim::ContourPointData& cp, MBSim::FrameFeature ff);   
00049       virtual void updateJacobiansForFrame(MBSim::ContourPointData &cp, int j = 0);
00050       virtual fmatvec::Vec3 computePosition(MBSim::ContourPointData &cp) { updateKinematicsForFrame(cp, MBSim::position_cosy); return cp.getFrameOfReference().getPosition(); }
00051       virtual fmatvec::Vec3 computeVelocity(MBSim::ContourPointData &cp) { updateKinematicsForFrame(cp, MBSim::velocity_cosy); return cp.getFrameOfReference().getVelocity(); }
00052       /***************************************************/
00053       
00054       /* INHERITED INTERFACE OF CONTOURCONTINUUM */
00055       virtual void computeRootFunctionPosition(MBSim::ContourPointData &cp) { Contour1sFlexible::updateKinematicsForFrame(cp, MBSim::position); }
00056       virtual void computeRootFunctionFirstTangent(MBSim::ContourPointData &cp) { Contour1sFlexible::updateKinematicsForFrame(cp, MBSim::firstTangent); }
00057       /***************************************************/
00058       
00059       /* GETTER / SETTER */
00060       void setCn(const fmatvec::Vec& Cn_);   
00061       void setWidth(double width_);
00062       
00067       void setNormalDistance(double nDist_);
00068       
00073       double getNormalDistance() {return nDist;};
00074       double getWidth() const; 
00075       /***************************************************/
00076 
00077     private:
00081       fmatvec::Vec Cn;
00082 
00086       double width;
00087 
00091       double nDist; 
00092   };
00093 
00094   inline void FlexibleBand::setWidth(double width_) { width = width_; }
00095   inline void FlexibleBand::setNormalDistance(double nDist_) { nDist = nDist_; }
00096   inline double FlexibleBand::getWidth() const { return width; } 
00097 
00098 }
00099 
00100 #endif /* _FLEXIBLE_BAND_H_ */
00101