@@ -9,6 +9,7 @@ namespace irregular
9
9
10
10
using LengthDbl = double ;
11
11
using AreaDbl = double ;
12
+ using ElementPos = int64_t ;
12
13
13
14
/* *
14
15
* Structure for a point.
@@ -21,6 +22,8 @@ struct Point
21
22
/* * y-coordiante. */
22
23
LengthDbl y;
23
24
25
+ Point rotate (Angle angle) const ;
26
+
24
27
bool operator ==(const Point & point) const { return x == point.x && y == point.y ; }
25
28
26
29
std::string to_string () const ;
@@ -49,10 +52,6 @@ LengthDbl cross_product(
49
52
const Point & vector_1,
50
53
const Point & vector_2);
51
54
52
- Point rotate (
53
- const Point & point,
54
- Angle angle);
55
-
56
55
Angle angle (
57
56
const Point & vector);
58
57
@@ -99,13 +98,11 @@ struct ShapeElement
99
98
/* * Length of the element. */
100
99
LengthDbl length () const ;
101
100
101
+ ShapeElement rotate (Angle angle) const ;
102
+
102
103
std::string to_string () const ;
103
104
};
104
105
105
- ShapeElement rotate (
106
- const ShapeElement& element,
107
- Angle angle);
108
-
109
106
enum class ShapeType
110
107
{
111
108
Circle,
@@ -158,6 +155,10 @@ struct Shape
158
155
/* Check if the shape is connected and in anticlockwise direction. */
159
156
bool check () const ;
160
157
158
+ Shape rotate (Angle angle) const ;
159
+
160
+ Shape identity_line_axial_symmetry () const ;
161
+
161
162
std::string to_string (Counter indentation) const ;
162
163
};
163
164
@@ -364,7 +365,7 @@ class Instance
364
365
inline AreaDbl previous_bin_area (BinPos bin_pos) const { return previous_bins_area_[bin_pos]; }
365
366
366
367
/* * Get the total area of the bins. */
367
- inline Area bin_area () const { return bin_area_; }
368
+ inline AreaDbl bin_area () const { return bin_area_; }
368
369
369
370
/* * Get the number of defects. */
370
371
inline DefectId number_of_defects () const { return number_of_defects_; }
@@ -374,12 +375,12 @@ class Instance
374
375
*/
375
376
376
377
/* * Get the x of a bin type depending on its orientation. */
377
- inline Length x_max (
378
+ inline LengthDbl x_max (
378
379
const BinType& bin_type,
379
380
Direction o) const ;
380
381
381
382
/* * Get the y of a bin type depending on its orientation. */
382
- inline Length y_max (
383
+ inline LengthDbl y_max (
383
384
const BinType& bin_type,
384
385
Direction o) const ;
385
386
@@ -496,14 +497,14 @@ class Instance
496
497
// ///////////////////////////// Inlined methods ////////////////////////////////
497
498
// //////////////////////////////////////////////////////////////////////////////
498
499
499
- Length Instance::x_max (
500
+ LengthDbl Instance::x_max (
500
501
const BinType& bin_type,
501
502
Direction o) const
502
503
{
503
504
return (o == Direction::X)? bin_type.x_max : bin_type.y_max ;
504
505
}
505
506
506
- Length Instance::y_max (
507
+ LengthDbl Instance::y_max (
507
508
const BinType& bin_type,
508
509
Direction o) const
509
510
{
0 commit comments