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="", Frame *R=0);
00040 
00044       ~CompoundContour();
00045 
00046       /* INHERITED INTERFACE OF ELEMENT */
00047       std::string getType() const {
00048         return "CompoundContour";
00049       }
00050       virtual void plot(double t, double dt);
00051 #ifdef HAVE_OPENMBVCPPINTERFACE
00052       boost::shared_ptr<OpenMBV::Group> getOpenMBVGrp() { return openMBVGroup; }
00053 #endif
00054       /***************************************************/
00055 
00056       /* INHERITED INTERFACE OF CONTOUR */
00057 //      void setReferencePosition(const fmatvec::Vec3 &WrOP);
00058 //      void setReferenceOrientation(const fmatvec::SqrMat3 &AWC);
00059 //      void setReferenceVelocity(const fmatvec::Vec3 &WvP);
00060 //      void setReferenceAngularVelocity(const fmatvec::Vec3 &WomegaC);
00061 //      void setReferenceJacobianOfTranslation(const fmatvec::Mat3V &WJP);
00062 //      void setReferenceGyroscopicAccelerationOfTranslation(const fmatvec::Vec3 &WjP);
00063 //      void setReferenceJacobianOfRotation(const fmatvec::Mat3V &WJR);
00064 //      void setReferenceGyroscopicAccelerationOfRotation(const fmatvec::Vec3 &WjR);
00065       /***************************************************/
00066 
00067       void init(InitStage stage);
00068       Contour* getContourElement(int i) {
00069         return element[i];
00070       }
00071       Contour* getContour(int i) { return element[i]; }
00072       void addContour(RigidContour* ce);
00073       void addFrame(FixedRelativeFrame* f);
00074       unsigned int getNumberOfElements() { return element.size(); }
00075 
00076       void updateKinematicsForFrame(ContourPointData &cp, Frame::Feature ff);
00077       void updateJacobiansForFrame(ContourPointData &cp);
00078 
00079       virtual void updateStateDependentVariables(double t);
00080       virtual void updateJacobians(double t, int j=0);
00081       virtual void updateStateDerivativeDependentVariables(const fmatvec::Vec &ud, double t);
00082 
00083     protected:
00087       std::vector<RigidContour*> element;
00088 
00092       std::vector<FixedRelativeFrame*> frame;
00093 
00097       std::vector<fmatvec::SqrMat3> AIK;
00098 
00099 #ifdef HAVE_OPENMBVCPPINTERFACE
00100       boost::shared_ptr<OpenMBV::Group> openMBVGroup;
00101 #endif
00102   };
00103 }
00104 
00105 #endif /* _COMPOUND_CONTOUR_H_ */
00106