PMLInteractionForceField.h

Go to the documentation of this file.
00001 /******************************************************************************
00002 *       SOFA, Simulation Open-Framework Architecture, version 1.0 beta 3      *
00003 *                (c) 2006-2008 MGH, INRIA, USTL, UJF, CNRS                    *
00004 *                                                                             *
00005 * This library is free software; you can redistribute it and/or modify it     *
00006 * under the terms of the GNU Lesser General Public License as published by    *
00007 * the Free Software Foundation; either version 2.1 of the License, or (at     *
00008 * your option) any later version.                                             *
00009 *                                                                             *
00010 * This library is distributed in the hope that it will be useful, but WITHOUT *
00011 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or       *
00012 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
00013 * for more details.                                                           *
00014 *                                                                             *
00015 * You should have received a copy of the GNU Lesser General Public License    *
00016 * along with this library; if not, write to the Free Software Foundation,     *
00017 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.          *
00018 *******************************************************************************
00019 *                               SOFA :: Modules                               *
00020 *                                                                             *
00021 * Authors: The SOFA Team and external contributors (see Authors.txt)          *
00022 *                                                                             *
00023 * Contact information: contact@sofa-framework.org                             *
00024 ******************************************************************************/
00025 
00026 /***************************************************************************
00027  *                                                                         *
00028  *   This program is free software; you can redistribute it and/or modify  *
00029  *   it under the terms of the GNU General Public License as published by  *
00030  *   the Free Software Foundation; either version 2 of the License, or     *
00031  *   (at your option) any later version.                                   *
00032  *                                                                         *
00033  ***************************************************************************/
00034 
00035 //-------------------------------------------------------------------------
00036 //                      --   Description   --
00037 //  PMLInteractionForceField create an interaction Forcefield (stiffSprings)
00038 //  between 2 other pml Bodies. The sofa structure is translated from pml,
00039 //  specifying the 2 bodies and the list of springs (LINES)
00040 //  It inherits from PMLBody abstract class.
00041 //-------------------------------------------------------------------------
00042 
00043 
00044 #ifndef PMLINTERACTIONFORCEFIELD_H
00045 #define PMLINTERACTIONFORCEFIELD_H
00046 
00047 #include "PMLBody.h"
00048 #include "sofa/component/forcefield/StiffSpringForceField.h"
00049 
00050 #include <map>
00051 
00052 
00053 namespace sofa
00054 {
00055 
00056 namespace filemanager
00057 {
00058 
00059 namespace pml
00060 {
00061 
00062 using namespace sofa::component::forcefield;
00063 using namespace std;
00064 
00065 class PMLInteractionForceField: public PMLBody
00066 {
00067 public :
00068 
00069     PMLInteractionForceField(StructuralComponent* body, PMLBody* b1, PMLBody* b2, GNode * parent);
00070 
00071     ~PMLInteractionForceField();
00072 
00073     string isTypeOf() { return "interaction"; }
00074 
00076     GNode* getPointsNode(){return NULL;}
00077     bool FusionBody(PMLBody*){return false;}
00078     Vector3 getDOF(unsigned int ){return Vector3();}
00079 
00080 private :
00081 
00084     void createForceField();
00085     void createMechanicalState(StructuralComponent* ){}
00086     void createTopology(StructuralComponent* ){}
00087     void createMass(StructuralComponent* ){}
00088     void createVisualModel(StructuralComponent* ){}
00089     void createCollisionModel(){}
00090 
00091     void createSprings(StructuralComponent * body);
00092 
00093 
00094     //structure
00095     StiffSpringForceField<Vec3Types> *Sforcefield;
00096     PMLBody * body1;
00097     PMLBody * body2;
00098 
00099     //properties
00100     SReal  ks;          // spring stiffness
00101     SReal  kd;          // damping factor
00102 };
00103 
00104 }
00105 }
00106 }
00107 
00108 #endif
00109 

Generated on Sun Nov 23 03:56:14 2008 for Sofa by  doxygen 1.5.7.1