mbsim 4.0.0 MBSim Kernel

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 _CONTOUR_FRAME_H__
21 #define _CONTOUR_FRAME_H__
22
23 #include "mbsim/frames/frame.h"
24
25 namespace MBSim {
26
27 class ContourFrame : public Frame {
28
29 public:
30 ContourFrame(const std::string &name = "dummy", const fmatvec::Vec2 &zeta_ = fmatvec::Vec2()) : Frame(name), zeta(zeta_) { }
31
32 virtual const fmatvec::Vec2& evalZeta() { if(updPos) updatePositions(); return zeta; }
33 virtual const fmatvec::Vec2& getZeta(bool check=true) { assert((not check) or (not updPos)); return zeta; }
34 void setZeta(const fmatvec::Vec2 &zeta_) { zeta = zeta_; }
35 virtual double evalEta() { if(updPos) updatePositions(); return zeta(0); }
36 virtual double evalXi() { if(updPos) updatePositions(); return zeta(1); }
37 virtual double getEta(bool check=true) { assert((not check) or (not updPos)); return zeta(0); }
38 virtual double getXi(bool check=true) { assert((not check) or (not updPos)); return zeta(1); }
39 void setEta(double eta) { zeta(0) = eta; }
40 void setXi(double xi) { zeta(1) = xi; }
41
42 void initializeUsingXML(xercesc::DOMElement *element) override;
43
44 protected:
48 fmatvec::Vec2 zeta;
49 };
50
51 }
52
53 #endif
MBSim::ContourFrame
Definition: contour_frame.h:27
MBSim::Element::name
std::string name
name of element
Definition: element.h:260
MBSim::Frame
cartesian frame on bodies used for application of e.g. links and loads
Definition: frame.h:39
MBSim::ContourFrame::zeta
fmatvec::Vec2 zeta
contour parameters of the frame
Definition: contour_frame.h:48
MBSim::Frame::Frame
Frame(const std::string &name="dummy")
constructor
Definition: frame.cc:48
MBSim
namespace MBSim
Definition: bilateral_constraint.cc:30