Program listing for file mechanics/src/collision/RigidBodyDS.hpp#

 1#ifndef RigidBodyDS_h
 2#define RigidBodyDS_h
 3
 4#include <MechanicsFwd.hpp>
 5#include <NewtonEulerDS.hpp>
 6#include <SiconosVisitor.hpp>
 7#include <SiconosContactor.hpp>
 8
 9class RigidBodyDS : public NewtonEulerDS,
10               public std::enable_shared_from_this<RigidBodyDS>
11{
12protected:
13
14  ACCEPT_SERIALIZATION(RigidBodyDS);
15
16  RigidBodyDS() : NewtonEulerDS() {};
17
18  SP::SiconosContactorSet _contactors;
19  bool _useContactorInertia;
20
21
22  bool _allowSelfCollide = true;
23
24public:
25
26  RigidBodyDS(SP::SiconosVector position,
27         SP::SiconosVector velocity,
28         double mass,
29         SP::SimpleMatrix inertia = SP::SimpleMatrix());
30
31  virtual ~RigidBodyDS();
32
33  void setUseContactorInertia(bool use) { _useContactorInertia = use; }
34
35  bool useContactorInertia() { return _useContactorInertia; }
36
37
38  bool allowSelfCollide() { return _allowSelfCollide; }
39
40
41  void setAllowSelfCollide(bool x) { _allowSelfCollide = x; }
42
43
44  SP::SiconosContactorSet contactors() const { return _contactors; }
45
46
47  void setContactors(SP::SiconosContactorSet c) { _contactors = c; }
48
49
50  virtual SP::SiconosVector base_position() { return q(); }
51
52  ACCEPT_BASE_VISITORS(NewtonEulerDS);
53};
54
55#endif