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 
25 #include "mbsim/utils/boost_parameters.h"
26 #include <mbsim/utils/openmbv_utils.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  std::string getType() const { return "PlanarFrustum"; }
46  virtual void init(InitStage stage);
47  /***************************************************/
48 
49  /* GETTER / SETTER */
50  void setRadii(const fmatvec::Vec2 &r_) { r = r_; }
51  const fmatvec::Vec2& getRadii() const { return r; }
52  void setHeight(double h_) { h = h_; }
53  double getHeight() const { return h; }
54  /***************************************************/
55 
56  BOOST_PARAMETER_MEMBER_FUNCTION( (void), enableOpenMBV, tag, (optional (diffuseColor,(const fmatvec::Vec3&),"[-1;1;1]")(transparency,(double),0))) {
57  OpenMBVFrustum ombv(1,1,1,diffuseColor,transparency);
58  openMBVRigidBody=ombv.createOpenMBV();
59  }
60 
61  private:
65  fmatvec::Vec2 r;
66 
70  double h;
71  };
72 
73 }
74 
75 #endif /* _FRUSTUM2D_H_ */
basic class for rigid contours
Definition: rigid_contour.h:37
virtual void init(InitStage stage)
plots time series header
Definition: planar_frustum.cc:31
fmatvec::Vec2 r
radii of frustum in dirction of axis
Definition: planar_frustum.h:65
std::string getType() const
Definition: planar_frustum.h:45
double h
height of frustum
Definition: planar_frustum.h:70
InitStage
The stages of the initialization.
Definition: element.h:97
std::string name
name of element
Definition: element.h:298
planar slice of a frustum
Definition: planar_frustum.h:36
PlanarFrustum(const std::string &name)
constructor
Definition: planar_frustum.h:42

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML