mbsim 4.0.0 MBSim Kernel

planewithfrustum.h
1 /* Copyright (C) 2004-2009 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 _PLANEWITHFRUSTUM_H_
21 #define _PLANEWITHFRUSTUM_H_
22
23 #include "mbsim/contours/rigid_contour.h"
24
25 namespace MBSim {
26
34 class PlaneWithFrustum : public RigidContour {
35 public:
44 PlaneWithFrustum(const std::string &name="", Frame *R=nullptr) : RigidContour(name,R) {
45 }
46
47 PlaneWithFrustum(const std::string &name, double rFrustumOnPlane_, double rFrustumOnTop_, double hFrustum_, double rho_, Frame *R=nullptr) : RigidContour(name,R), rFrustumOnPlane(rFrustumOnPlane_), rFrustumOnTop(rFrustumOnTop_), hFrustum(hFrustum_), rho(rho_) {
48 checkInput();
49 }
50
51 /* INHERITED INTERFACE OF ELEMENT */
52 /***************************************************/
53
54 /* GETTER / SETTER */
55 double getFrustumRadiusOnPlane() {return rFrustumOnPlane; }
56 double getFrustumRadiusOnTop() {return rFrustumOnTop; }
57 double getFrustumHeight() {return hFrustum; }
58 double getRoundingRadius() {return rho; }
59 /***************************************************/
60
61 void enableOpenMBV();
62
63 void initializeUsingXML(xercesc::DOMElement *element) override;
64
65 private:
66 double rFrustumOnPlane{0};
67 double rFrustumOnTop{0};
68 double hFrustum{0};
69 double rho{0};
70
71 void checkInput() {
72 assert(rFrustumOnTop<rFrustumOnPlane); //TODO
73 assert(rFrustumOnTop>1e-6); //TODO
74 assert(rho>1e-6);
75 assert(rho<fabs(hFrustum));
76 assert(rho<rFrustumOnTop);
77 }
78 };
79 }
80
81 #endif /* _PLANEWITHFRUSTUM_H_ */
MBSim::RigidContour
basic class for rigid contours
Definition: rigid_contour.h:37
MBSim::PlaneWithFrustum::PlaneWithFrustum
PlaneWithFrustum(const std::string &name="", Frame *R=nullptr)
constructor
Definition: planewithfrustum.h:44
MBSim::PlaneWithFrustum
plane without borders and a frustum on reference kos
Definition: planewithfrustum.h:34
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::RigidContour::R
Frame * R
coordinate system of contour
Definition: rigid_contour.h:133
MBSim
namespace MBSim
Definition: bilateral_constraint.cc:30