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 
28 namespace MBSim {
29 
33  class Room : public CompoundContour {
34  public:
41  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)) { }
42 
43  /* INHERITED INTERFACE OF ELEMENT */
44  /***************************************************/
45  void init(InitStage stage, const InitConfigSet &config) override;
46  /***************************************************/
47 
48  /* GETTER / SETTER */
49  void setLength(const fmatvec::Vec3 &length) { l = length(0); h = length(1); d = length(2); }
50  void setLength(double l_, double h_, double d_) { l = l_; h = h_; d = d_; }
51  /***************************************************/
52 
53  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))) {
54  OpenMBVColoredBody ombv(diffuseColor,transparency,pointSize,lineWidth);
55  openMBVRigidBody=ombv.createOpenMBV<OpenMBV::Cuboid>();
56  }
57 
58  protected:
62  double l{1};
63  double h{1};
64  double d{1};
65 
69  bool enable{false};
70 
74  int gridSize{10};
75  };
76 }
77 
78 #endif /* _ROOM_H_ */
int gridSize
grid size
Definition: room.h:74
contour consisting of primitive contour elements
Definition: compound_contour.h:34
bool enable
enable openMBV output
Definition: room.h:69
Room with 6 faces pointing inwards.
Definition: room.h:33
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:62
Room(const std::string &name="", const fmatvec::Vec3 &length=fmatvec::Vec3(fmatvec::INIT, 1), Frame *R=nullptr)
constructor
Definition: room.h:41
std::string name
name of element
Definition: element.h:235
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:62
Frame * R
coordinate system of contour
Definition: rigid_contour.h:130
namespace MBSim
Definition: eigenanalyzer.cc:47