All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
floating_relative_contour_frame.h
1 /* Copyright (C) 2004-2014 MBSim Development Team
2  *
3  * This library is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU Lesser General Public
5  * License as published by the Free Software Foundation; either
6  * version 2.1 of the License, or (at your option) any later version.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with this library; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16  *
17  * Contact: martin.o.foerg@googlemail.com
18  */
19 
20 #ifndef _FLOATING_RELATIVE_CONTOUR_FRAME_H__
21 #define _FLOATING_RELATIVE_CONTOUR_FRAME_H__
22 
23 #include "mbsim/frames/contour_frame.h"
24 
25 namespace MBSim {
26 
28 
29  public:
30  FloatingRelativeContourFrame(const std::string &name = "dummy", const fmatvec::Vec3 &r=fmatvec::Vec3(), const fmatvec::SqrMat3 &A=fmatvec::SqrMat3(fmatvec::EYE), Frame *refFrame=0) : ContourFrame(name), R(refFrame), RrRP(r), ARP(A) {
31  }
32 
33  std::string getType() const { return "FloatingRelativeContourFrame"; }
34 
35  void setRelativePosition(const fmatvec::Vec3 &r) { RrRP = r; }
36  void setRelativeOrientation(const fmatvec::SqrMat3 &A) { ARP = A; }
37  void setFrameOfReference(Frame *frame) { R = frame; }
38 
39  const fmatvec::Vec3& getRelativePosition() const { return RrRP; }
40  const fmatvec::SqrMat3& getRelativeOrientation() const { return ARP; }
41  const Frame* getFrameOfReference() const { return R; }
42 
43  const fmatvec::Vec3& evalGlobalRelativePosition() { if(updPos) updatePositions(); return WrRP; }
44 
45  void updatePositions();
46  void updateVelocities();
47  void updateAccelerations();
48  void updateJacobians(int j=0);
49  void updateGyroscopicAccelerations();
50 
51  protected:
52  Frame *R;
53  fmatvec::Vec3 RrRP, WrRP;
54  fmatvec::SqrMat3 ARP;
55  };
56 
57 }
58 
59 #endif
Definition: floating_relative_contour_frame.h:27
std::string getType() const
Definition: floating_relative_contour_frame.h:33
Definition: contour_frame.h:27
std::string name
name of element
Definition: element.h:298
cartesian frame on bodies used for application of e.g. links and loads
Definition: frame.h:37
Frame(const std::string &name="dummy")
constructor
Definition: frame.cc:36

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML