mbsim  4.0.0
MBSim Kernel
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
planar_frustum.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 _PLANAR_FRUSTUM_H_
21 #define _PLANAR_FRUSTUM_H_
22 
23 #include "mbsim/contours/rigid_contour.h"
24 #include "mbsim/utils/boost_parameters.h"
25 #include "mbsim/utils/openmbv_utils.h"
26 #include <openmbvcppinterface/frustum.h>
27 
28 namespace MBSim {
29 
36  class PlanarFrustum : public RigidContour {
37  public:
42  PlanarFrustum(const std::string &name) : RigidContour(name), h(0) { }
43 
44  /* INHERITED INTERFACE OF ELEMENT */
45  void init(InitStage stage, const InitConfigSet &config) override;
46  /***************************************************/
47 
48  /* GETTER / SETTER */
49  void setRadii(const fmatvec::Vec2 &r_) { r = r_; }
50  const fmatvec::Vec2& getRadii() const { return r; }
51  void setHeight(double h_) { h = h_; }
52  double getHeight() const { return h; }
53  /***************************************************/
54 
55  BOOST_PARAMETER_MEMBER_FUNCTION( (void), enableOpenMBV, tag, (optional (diffuseColor,(const fmatvec::Vec3&),fmatvec::Vec3(std::vector<double>{-1,1,1}))(transparency,(double),0)(pointSize,(double),0)(lineWidth,(double),0))) {
56  OpenMBVColoredBody ombv(diffuseColor,transparency,pointSize,lineWidth);
57  openMBVRigidBody=ombv.createOpenMBV<OpenMBV::Frustum>();
58  }
59 
60  private:
64  fmatvec::Vec2 r;
65 
69  double h;
70  };
71 
72 }
73 
74 #endif /* _FRUSTUM2D_H_ */
basic class for rigid contours
Definition: rigid_contour.h:37
fmatvec::Vec2 r
radii of frustum in dirction of axis
Definition: planar_frustum.h:64
void init(InitStage stage, const InitConfigSet &config) override
plots time series header
Definition: planar_frustum.cc:31
double h
height of frustum
Definition: planar_frustum.h:69
InitStage
The stages of the initialization.
Definition: element.h:62
std::string name
name of element
Definition: element.h:260
planar slice of a frustum
Definition: planar_frustum.h:36
PlanarFrustum(const std::string &name)
constructor
Definition: planar_frustum.h:42