acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
geometry.h
1#pragma once
2
3
4#include "acme/prototype/mathematics/mathematics.h"
5
6
7namespace geometry
8{
9
10
11 class CLASS_DECL_ACME rotation
12 {
13 public:
14 ::f64 m_dCosPhi;
15 ::f64 m_dSinPhi;
16 ::i32 m_iXCenter;
17 ::i32 m_iYCenter;
18
19 void rotate(::i32_point * ppoint, ::i32 iCount);
20
21 };
22
23 class CLASS_DECL_ACME geometry :
24 virtual public ::particle
25 {
26 public:
27
28
29 geometry();
30 ~geometry() override;
31
32
33 //virtual void initialize(::particle * pparticle) override;
34 void destroy() override;
35
36
37 ::f64 rotate_y(::f64 x, ::f64 y, ::f64 phi);
38 ::f64 rotate_x(::f64 x, ::f64 y, ::f64 phi);
39 void rotate(::i32 x, ::i32 y, ::i32_point * ppoint, ::i32 iCount, ::f64 phi);
40
41 void rotate(::i32 x, ::i32 y, ::i32_point * ppoint, ::i32 iCount, ::f64 cosphi, ::f64 sinphi);
42
43 void rotate(::i32 x, ::i32 y, ::f64_point * ppoint, ::i32 iCount, ::f64 phi);
44
45 void rotate(::i32 x, ::i32 y, ::f64_point * ppoint, ::i32 iCount, ::f64 cosphi, ::f64 sinphi);
46
47
48
49 //void RandomPoint(::i32_point * ppoint, const ::i32_rectangle & rectangle);
50 void deflate(::i32_rectangle * prectangle, ::f64 dLeftRate, ::f64 dRightRate, ::f64 dTopRate, ::f64 dBottomRate);
51
52
53 template < prototype_rectangle RECTANGLE >
54 inline typename RECTANGLE::POINT_TYPE random_point(const RECTANGLE & r)
55 {
56
57 return { mathematics()->random(r.left, r.right), mathematics()->random(r.top, r.bottom) };
58
59 }
60
61
62 template < prototype_rectangle RECTANGLE >
63 inline typename RECTANGLE::POINT_TYPE random_point(const RECTANGLE & r, ::f64 dRate)
64 {
65
66 auto rectangle = r;
67
68 rectangle.rate(dRate);
69
70 return random_point(rectangle);
71
72 }
73
74
75
76
77
78 };
79
80
81} // namespace geometry
82
83
84
Definition geometry.h:12