Program listing for file mechanics/src/collision/SiconosContactor.hpp

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef SiconosContactor_h
#define SiconosContactor_h

#include <vector>
#include <utility>

#include "MechanicsFwd.hpp"

#include <SiconosSerialization.hpp>

#include "SiconosShape.hpp"



class SiconosContactor
{
private:
  SiconosContactor() {};

protected:

  ACCEPT_SERIALIZATION(SiconosContactor);

public:
  SiconosContactor(SP::SiconosShape _shape,
                   SP::SiconosVector _offset = SP::SiconosVector(),
                   int _collision_group = 0);

  SP::SiconosShape shape;
  SP::SiconosVector offset;
  int collision_group;
};

class SiconosContactorSet : public std::vector< SP::SiconosContactor >
{
protected:

  ACCEPT_SERIALIZATION(SiconosContactorSet);

public:
  typedef std::vector< SP::SiconosContactor >::iterator iterator;

  void append(SP::SiconosContactor b) { push_back(b); }
  void append(std::vector<SP::SiconosContactor> b) { insert(end(), b.begin(), b.end()); }
  void append(const SiconosContactorSet& b) { insert(end(), b.begin(), b.end()); }
  void append(const SP::SiconosContactorSet& b) { insert(end(), b->begin(), b->end()); }
};

#endif