Program listing for file mechanics/src/collision/native/bodies/DiskPlanR.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#ifndef DiskPlanR_h
#define DiskPlanR_h

#include "MechanicsFwd.hpp"
#include "LagrangianScleronomousR.hpp"


class DiskPlanR : public LagrangianScleronomousR, public std::enable_shared_from_this<DiskPlanR>
{
private:

  ACCEPT_SERIALIZATION(DiskPlanR);

  double r, A, B, C, sqrA2pB2,
    AC, B2, A2, AB, BC, xCenter, yCenter, width, halfWidth, x1, x2, y1, y2;
  bool finite;

  void init(double, double, double, double, double, double, double);

  DiskPlanR() : LagrangianScleronomousR() {};

public:


  DiskPlanR(double r, double A, double B, double C);


  DiskPlanR(double disk, double A, double B, double C,
            double xCenter, double yCenter, double width);


  DiskPlanR(double, double, double, double, double);


  double distance(double x, double y, double r) const;

  double getRadius() const
  {
    return r;
  };

  double getA() const
  {
    return A;
  };

  double getB() const
  {
    return B;
  };

  double getC() const
  {
    return C;
  };

  double gethypotAB() const
  {
    return sqrA2pB2;
  };

  double getXCenter() const
  {
    return xCenter;
  };

  double getYCenter() const
  {
    return yCenter;
  };

  double getWidth() const
  {
    return width;
  };

  using LagrangianScleronomousR::computeh;
  void computeh(SiconosVector& q, SiconosVector& z, SiconosVector& y);

  void computeJachq(SiconosVector& q, SiconosVector& z);

  bool equal(double, double, double, double) const;

  bool equal(double, double, double, double, double, double, double) const;

  bool equal(const DiskPlanR&) const;

  bool isFinite() const
  {
    return finite;
  };


  ACCEPT_VISITORS();

  ~DiskPlanR() {};

};
#endif