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 #ifndef SOFA_COMPONENT_CONTEXTOBJECT_COORDINATESYSTEM_H 00026 #define SOFA_COMPONENT_CONTEXTOBJECT_COORDINATESYSTEM_H 00027 // Author: François Faure, (C) 2006 00028 // 00029 // Copyright: See COPYING file that comes with this distribution 00030 00031 #include <sofa/core/objectmodel/ContextObject.h> 00032 #include <sofa/defaulttype/SolidTypes.h> 00033 #include <sofa/defaulttype/Vec.h> 00034 00035 namespace sofa 00036 { 00037 namespace core 00038 { 00039 namespace objectmodel 00040 { 00041 class Context; 00042 } 00043 00044 namespace componentmodel 00045 { 00046 class Topology; 00047 } 00048 } 00049 namespace simulation 00050 { 00051 namespace tree 00052 { 00053 class GNode; 00054 } 00055 } 00056 00057 namespace component 00058 { 00059 00060 namespace contextobject 00061 { 00062 00065 class CoordinateSystem : public core::objectmodel::ContextObject 00066 { 00067 public: 00068 typedef core::objectmodel::BaseContext::SolidTypes SolidTypes; 00069 typedef SolidTypes::Vec Vec; 00070 typedef SolidTypes::Rot Rot; 00071 typedef SolidTypes::Mat Mat; 00072 typedef SolidTypes::Coord Frame; 00073 typedef SolidTypes::Deriv SpatialVector; 00074 00075 CoordinateSystem(); 00076 virtual ~CoordinateSystem() 00077 {} 00078 00079 // ContextObject 00080 virtual void apply(); 00081 00082 virtual void draw(); 00083 00084 virtual void reinit(); 00085 00086 virtual void init(); 00087 00089 const Frame& getTransform() const; 00091 virtual void setTransform( const Frame& f ); 00093 //Frame getPositionInWorld() const; 00095 //CoordinateSystem* setOrigin( const Vec& t ); 00097 Vec getOrigin() const; 00099 //CoordinateSystem* setOrientation( const Rot& r ); 00101 Rot getOrientation() const; 00103 //CoordinateSystem* set( const Vec& t, const Rot& r ); 00104 00106 //SpatialVector getVelocityInWorld() const; 00108 //const SpatialVector& getVelocity() const; 00110 //CoordinateSystem* setVelocity( const SpatialVector& f ); 00111 00112 Data< defaulttype::Vec3f > origin; 00113 Data< defaulttype::Vec3f > orientation; 00114 protected: 00115 Frame positionInParent_; 00116 //SpatialVector velocity_; ///< velocity wrt parent frame, given in LOCAL frame 00117 00118 00119 }; 00120 00121 } // namespace contextobject 00122 00123 } // namespace component 00124 00125 } // namespace sofa 00126 00127 #endif 00128 00129
1.5.7.1