MBSim

Project Page
compound_contour.h
00001 /* Copyright (C) 2004-2009 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: martin.o.foerg@googlemail.com
00018  */
00019 
00020 #ifndef _COMPOUND_CONTOUR_H_
00021 #define _COMPOUND_CONTOUR_H_
00022 
00023 #include "mbsim/contour.h"
00024 #include "mbsim/contours/contour_interpolation.h"
00025 
00026 namespace MBSim {
00027 
00033   class CompoundContour : public RigidContour {
00034     public:
00039       CompoundContour(const std::string &name);
00040 
00041       /* INHERITED INTERFACE OF ELEMENT */
00042       std::string getType() const {
00043         return "CompoundContour";
00044       }
00045       virtual void plot(double t, double dt);
00046 #ifdef HAVE_OPENMBVCPPINTERFACE
00047   OpenMBV::Group* getOpenMBVGrp() { return openMBVGroup; }
00048 #endif
00049       /***************************************************/
00050 
00051       /* INHERITED INTERFACE OF CONTOUR */
00052 //      void setReferencePosition(const fmatvec::Vec3 &WrOP);
00053 //      void setReferenceOrientation(const fmatvec::SqrMat3 &AWC);
00054 //      void setReferenceVelocity(const fmatvec::Vec3 &WvP);
00055 //      void setReferenceAngularVelocity(const fmatvec::Vec3 &WomegaC);
00056 //      void setReferenceJacobianOfTranslation(const fmatvec::Mat3V &WJP);
00057 //      void setReferenceGyroscopicAccelerationOfTranslation(const fmatvec::Vec3 &WjP);
00058 //      void setReferenceJacobianOfRotation(const fmatvec::Mat3V &WJR);
00059 //      void setReferenceGyroscopicAccelerationOfRotation(const fmatvec::Vec3 &WjR);
00060       /***************************************************/
00061 
00062       void init(InitStage stage);
00063       Contour* getContourElement(int i) {
00064         return element[i];
00065       }
00066       Contour* getContour(int i) { return element[i]; }
00067       void addContour(RigidContour* ce);
00068       void addFrame(FixedRelativeFrame* f);
00069       unsigned int getNumberOfElements() { return element.size(); }
00070 
00071       void updateKinematicsForFrame(ContourPointData &cp, FrameFeature ff);
00072       void updateJacobiansForFrame(ContourPointData &cp);
00073 
00074       virtual void updateStateDependentVariables(double t);
00075       virtual void updateJacobians(double t, int j=0);
00076       virtual void updateStateDerivativeDependentVariables(const fmatvec::Vec &ud, double t);
00077 
00078     protected:
00082       std::vector<RigidContour*> element;
00083 
00087       std::vector<FixedRelativeFrame*> frame;
00088 
00092       std::vector<fmatvec::SqrMat3> AIK;
00093 
00094 #ifdef HAVE_OPENMBVCPPINTERFACE
00095       OpenMBV::Group* openMBVGroup;
00096 #endif
00097   };
00098 }
00099 
00100 #endif /* _COMPOUND_CONTOUR_H_ */
00101