mbsim  4.0.0
MBSim Kernel
room.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 _ROOM_H_
21 #define _ROOM_H_
22 
23 #include "mbsim/contours/compound_contour.h"
24 
25 #include "mbsim/utils/boost_parameters.h"
26 #include <mbsim/utils/openmbv_utils.h>
27 #include <openmbvcppinterface/cuboid.h>
28 
29 namespace MBSim {
30 
34  class Room : public CompoundContour {
35  public:
42  Room(const std::string &name="", const fmatvec::Vec3 &length=fmatvec::Vec3(fmatvec::INIT,1), Frame *R=nullptr) : CompoundContour(name,R), l(length(0)), h(length(1)), d(length(2)) { }
43 
44  /* INHERITED INTERFACE OF ELEMENT */
45  /***************************************************/
46  void init(InitStage stage, const InitConfigSet &config) override;
47  /***************************************************/
48 
49  /* GETTER / SETTER */
50  void setLength(const fmatvec::Vec3 &length) { l = length(0); h = length(1); d = length(2); }
51  void setLength(double l_, double h_, double d_) { l = l_; h = h_; d = d_; }
52  /***************************************************/
53 
54  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))) {
55  OpenMBVColoredBody ombv(diffuseColor,transparency,pointSize,lineWidth);
56  openMBVRigidBody=ombv.createOpenMBV<OpenMBV::Cuboid>();
57  }
58 
59  protected:
63  double l{1};
64  double h{1};
65  double d{1};
66 
70  bool enable{false};
71 
75  int gridSize{10};
76  };
77 }
78 
79 #endif /* _ROOM_H_ */
int gridSize
grid size
Definition: room.h:75
contour consisting of primitive contour elements
Definition: compound_contour.h:34
bool enable
enable openMBV output
Definition: room.h:70
Room with 6 faces pointing inwards.
Definition: room.h:34
void init(InitStage stage, const InitConfigSet &config) override
plots time series header
Definition: room.cc:33
InitStage
The stages of the initialization.
Definition: element.h:64
Room(const std::string &name="", const fmatvec::Vec3 &length=fmatvec::Vec3(fmatvec::INIT, 1), Frame *R=nullptr)
constructor
Definition: room.h:42
std::string name
name of element
Definition: element.h:262
cartesian frame on bodies used for application of e.g. links and loads
Definition: frame.h:39
double l
length, height and depth of room
Definition: room.h:63
Frame * R
coordinate system of contour
Definition: rigid_contour.h:133
namespace MBSim
Definition: bilateral_constraint.cc:29