All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
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=0) : RigidContour(name,R), rFrustumOnPlane(0), rFrustumOnTop(0), hFrustum(0), rho(0) {
45  }
46 
47  PlaneWithFrustum(const std::string &name, double rFrustumOnPlane_, double rFrustumOnTop_, double hFrustum_, double rho_, Frame *R=0) : RigidContour(name,R), rFrustumOnPlane(rFrustumOnPlane_), rFrustumOnTop(rFrustumOnTop_), hFrustum(hFrustum_), rho(rho_) {
48  checkInput();
49  }
50 
51  /* INHERITED INTERFACE OF ELEMENT */
52  std::string getType() const { return "PlaneWithFrustum"; }
53  /***************************************************/
54 
55  /* GETTER / SETTER */
56  double getFrustumRadiusOnPlane() {return rFrustumOnPlane; }
57  double getFrustumRadiusOnTop() {return rFrustumOnTop; }
58  double getFrustumHeight() {return hFrustum; }
59  double getRoundingRadius() {return rho; }
60  /***************************************************/
61 
62  void enableOpenMBV();
63 
64  virtual void initializeUsingXML(xercesc::DOMElement *element);
65 
66  private:
67  double rFrustumOnPlane;
68  double rFrustumOnTop;
69  double hFrustum;
70  double rho;
71 
72  void checkInput() {
73  assert(rFrustumOnTop<rFrustumOnPlane); //TODO
74  assert(rFrustumOnTop>1e-6); //TODO
75  assert(rho>1e-6);
76  assert(rho<fabs(hFrustum));
77  assert(rho<rFrustumOnTop);
78  }
79  };
80 }
81 
82 #endif /* _PLANEWITHFRUSTUM_H_ */
std::string getType() const
Definition: planewithfrustum.h:52
basic class for rigid contours
Definition: rigid_contour.h:37
PlaneWithFrustum(const std::string &name="", Frame *R=0)
constructor
Definition: planewithfrustum.h:44
plane without borders and a frustum on reference kos
Definition: planewithfrustum.h:34
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 * R
coordinate system of contour
Definition: rigid_contour.h:88

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML