contrek 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +13 -0
  3. data/.rspec +3 -0
  4. data/Gemfile +3 -0
  5. data/Gemfile.lock +84 -0
  6. data/LICENSE.md +9 -0
  7. data/README.md +118 -0
  8. data/Rakefile +19 -0
  9. data/contrek.gemspec +23 -0
  10. data/contrek.png +0 -0
  11. data/ext/cpp_polygon_finder/PolygonFinder/.cproject +136 -0
  12. data/ext/cpp_polygon_finder/PolygonFinder/.project +27 -0
  13. data/ext/cpp_polygon_finder/PolygonFinder/.settings/org.eclipse.ltk.core.refactoring.prefs +2 -0
  14. data/ext/cpp_polygon_finder/PolygonFinder/images/labyrinth.png +0 -0
  15. data/ext/cpp_polygon_finder/PolygonFinder/src/Main.cpp +41 -0
  16. data/ext/cpp_polygon_finder/PolygonFinder/src/Tests.cpp +69 -0
  17. data/ext/cpp_polygon_finder/PolygonFinder/src/Tests.h +19 -0
  18. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/bitmaps/Bitmap.cpp +52 -0
  19. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/bitmaps/Bitmap.h +32 -0
  20. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/bitmaps/FastPngBitmap.cpp +656 -0
  21. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/bitmaps/FastPngBitmap.h +42 -0
  22. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/bitmaps/PngBitmap.cpp +48 -0
  23. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/bitmaps/PngBitmap.h +32 -0
  24. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/bitmaps/RemoteFastPngBitmap.cpp +30 -0
  25. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/bitmaps/RemoteFastPngBitmap.h +26 -0
  26. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/bitmaps/X_picopng.cpp +576 -0
  27. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/finder/List.cpp +120 -0
  28. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/finder/List.h +40 -0
  29. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/finder/Lists.cpp +36 -0
  30. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/finder/Lists.h +30 -0
  31. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/finder/Node.cpp +111 -0
  32. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/finder/Node.h +80 -0
  33. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/finder/NodeCluster.cpp +325 -0
  34. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/finder/NodeCluster.h +59 -0
  35. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/finder/PolygonFinder.cpp +206 -0
  36. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/finder/PolygonFinder.h +69 -0
  37. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/finder/optionparser.h +2858 -0
  38. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/matchers/Matcher.cpp +23 -0
  39. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/matchers/Matcher.h +23 -0
  40. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/matchers/RGBMatcher.cpp +20 -0
  41. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/matchers/RGBMatcher.h +23 -0
  42. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/matchers/RGBNotMatcher.cpp +20 -0
  43. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/matchers/RGBNotMatcher.h +23 -0
  44. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/matchers/ValueNotMatcher.cpp +20 -0
  45. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/matchers/ValueNotMatcher.h +21 -0
  46. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/reducers/LinearReducer.cpp +40 -0
  47. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/reducers/LinearReducer.h +23 -0
  48. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/reducers/Reducer.cpp +19 -0
  49. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/reducers/Reducer.h +25 -0
  50. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/reducers/UniqReducer.cpp +30 -0
  51. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/reducers/UniqReducer.h +21 -0
  52. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/reducers/VisvalingamReducer.cpp +50 -0
  53. data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/reducers/VisvalingamReducer.h +121 -0
  54. data/ext/cpp_polygon_finder/cpp_polygon_finder.cpp +260 -0
  55. data/ext/cpp_polygon_finder/extconf.rb +2 -0
  56. data/lib/contrek/bitmaps/bitmap.rb +21 -0
  57. data/lib/contrek/bitmaps/chunky_bitmap.rb +33 -0
  58. data/lib/contrek/bitmaps/painting.rb +40 -0
  59. data/lib/contrek/bitmaps/png_bitmap.rb +62 -0
  60. data/lib/contrek/bitmaps/rgb_color.rb +25 -0
  61. data/lib/contrek/finder/list.rb +132 -0
  62. data/lib/contrek/finder/list_entry.rb +11 -0
  63. data/lib/contrek/finder/listable.rb +8 -0
  64. data/lib/contrek/finder/lists.rb +25 -0
  65. data/lib/contrek/finder/node.rb +126 -0
  66. data/lib/contrek/finder/node_cluster.rb +294 -0
  67. data/lib/contrek/finder/polygon_finder.rb +121 -0
  68. data/lib/contrek/map/mercator_projection.rb +76 -0
  69. data/lib/contrek/matchers/matcher.rb +20 -0
  70. data/lib/contrek/matchers/matcher_hsb.rb +24 -0
  71. data/lib/contrek/matchers/value_not_matcher.rb +9 -0
  72. data/lib/contrek/reducers/linear_reducer.rb +25 -0
  73. data/lib/contrek/reducers/reducer.rb +14 -0
  74. data/lib/contrek/reducers/uniq_reducer.rb +9 -0
  75. data/lib/contrek/reducers/visvalingam_reducer.rb +139 -0
  76. data/lib/contrek/version.rb +3 -0
  77. data/lib/contrek.rb +58 -0
  78. metadata +175 -0
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Matcher.cpp
3
+ *
4
+ * Created on: 25 nov 2018
5
+ * Author: ema
6
+ * Copyright 2025 Emanuele Cesaroni
7
+ */
8
+
9
+ #include "Matcher.h"
10
+ #include <iostream>
11
+ Matcher::Matcher(char value) {
12
+ this->value = value;
13
+ }
14
+
15
+ Matcher::~Matcher() {
16
+ }
17
+
18
+ bool Matcher::match(char value) {
19
+ return(this->value == value);
20
+ }
21
+ bool Matcher::unmatch(char value) {
22
+ return(!match(value));
23
+ }
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Matcher.h
3
+ *
4
+ * Created on: 25 nov 2018
5
+ * Author: ema
6
+ * Copyright 2025 Emanuele Cesaroni
7
+ */
8
+
9
+ #ifndef POLYGON_MATCHERS_MATCHER_H_
10
+ #define POLYGON_MATCHERS_MATCHER_H_
11
+
12
+ class Matcher {
13
+ protected:
14
+ char value;
15
+
16
+ public:
17
+ Matcher(char value);
18
+ virtual bool match(char value);
19
+ virtual bool unmatch(char value);
20
+ virtual ~Matcher();
21
+ };
22
+
23
+ #endif /* POLYGON_MATCHERS_MATCHER_H_ */
@@ -0,0 +1,20 @@
1
+ /*
2
+ * RGBMatcher.cpp
3
+ *
4
+ * Created on: 05 dic 2018
5
+ * Author: ema
6
+ * Copyright 2025 Emanuele Cesaroni
7
+ */
8
+
9
+ #include "RGBMatcher.h"
10
+ #include <iostream>
11
+ RGBMatcher::RGBMatcher(unsigned int rgb_value) : Matcher(0L) {
12
+ this->rgb_value = rgb_value;
13
+ }
14
+
15
+ RGBMatcher::~RGBMatcher() {
16
+ }
17
+
18
+ bool RGBMatcher::match(unsigned int value) {
19
+ return(this->rgb_value == value);
20
+ }
@@ -0,0 +1,23 @@
1
+ /*
2
+ * RGBMatcher.h
3
+ *
4
+ * Created on: 05 dic 2018
5
+ * Author: ema
6
+ * Copyright 2025 Emanuele Cesaroni
7
+ */
8
+
9
+ #ifndef POLYGON_MATCHERS_RGBMATCHER_H_
10
+ #define POLYGON_MATCHERS_RGBMATCHER_H_
11
+
12
+ #include "Matcher.h"
13
+
14
+ class RGBMatcher : public Matcher {
15
+ public:
16
+ RGBMatcher(unsigned int rgb_value);
17
+ virtual ~RGBMatcher();
18
+ bool match(unsigned int value);
19
+ private:
20
+ unsigned int rgb_value;
21
+ };
22
+
23
+ #endif /* POLYGON_MATCHERS_RGBMATCHER_H_ */
@@ -0,0 +1,20 @@
1
+ /*
2
+ * RGBMatcher.cpp
3
+ *
4
+ * Created on: 05 dic 2018
5
+ * Author: ema
6
+ * Copyright 2025 Emanuele Cesaroni
7
+ */
8
+
9
+ #include "RGBNotMatcher.h"
10
+ #include <iostream>
11
+ RGBNotMatcher::RGBNotMatcher(int rgb_value) : Matcher(0L) {
12
+ this->rgb_value = rgb_value;
13
+ }
14
+
15
+ RGBNotMatcher::~RGBNotMatcher() {
16
+ }
17
+
18
+ bool RGBNotMatcher::match(int value) {
19
+ return(this->rgb_value != value);
20
+ }
@@ -0,0 +1,23 @@
1
+ /*
2
+ * RGBMatcher.h
3
+ *
4
+ * Created on: 05 dic 2018
5
+ * Author: ema
6
+ * Copyright 2025 Emanuele Cesaroni
7
+ */
8
+
9
+ #ifndef POLYGON_MATCHERS_RGBNOTMATCHER_H_
10
+ #define POLYGON_MATCHERS_RGBNOTMATCHER_H_
11
+
12
+ #include "Matcher.h"
13
+
14
+ class RGBNotMatcher : public Matcher {
15
+ public:
16
+ RGBNotMatcher(int rgb_value);
17
+ virtual ~RGBNotMatcher();
18
+ bool match(int value);
19
+ private:
20
+ int rgb_value;
21
+ };
22
+
23
+ #endif /* POLYGON_MATCHERS_RGBMATCHER_H_ */
@@ -0,0 +1,20 @@
1
+ /*
2
+ * ValueNotMatcher.cpp
3
+ *
4
+ * Created on: 27 nov 2018
5
+ * Author: ema
6
+ * Copyright 2025 Emanuele Cesaroni
7
+ */
8
+
9
+ #include "ValueNotMatcher.h"
10
+ #include <iostream>
11
+
12
+ ValueNotMatcher::ValueNotMatcher(char value) : Matcher(value) {
13
+ }
14
+
15
+ ValueNotMatcher::~ValueNotMatcher() {
16
+ }
17
+
18
+ bool ValueNotMatcher::match(char value) {
19
+ return(this->value != value);
20
+ }
@@ -0,0 +1,21 @@
1
+ /*
2
+ * ValueNotMatcher.h
3
+ *
4
+ * Created on: 27 nov 2018
5
+ * Author: ema
6
+ * Copyright 2025 Emanuele Cesaroni
7
+ */
8
+
9
+ #ifndef POLYGON_MATCHERS_VALUENOTMATCHER_H_
10
+ #define POLYGON_MATCHERS_VALUENOTMATCHER_H_
11
+
12
+ #include "Matcher.h"
13
+
14
+ class ValueNotMatcher : public Matcher {
15
+ public:
16
+ ValueNotMatcher(char value);
17
+ virtual ~ValueNotMatcher();
18
+ bool match(char value);
19
+ };
20
+
21
+ #endif /* POLYGON_MATCHERS_VALUENOTMATCHER_H_ */
@@ -0,0 +1,40 @@
1
+ /*
2
+ * LinearReducer.cpp
3
+ *
4
+ * Created on: 19 dic 2018
5
+ * Author: ema
6
+ * Copyright 2025 Emanuele Cesaroni
7
+ */
8
+
9
+ #include <iterator>
10
+ #include <list>
11
+ #include "LinearReducer.h"
12
+ #include "Reducer.h"
13
+
14
+ LinearReducer::LinearReducer(std::list<Point*> *list_of_points) : Reducer(list_of_points) {
15
+ }
16
+
17
+ LinearReducer::~LinearReducer() {
18
+ }
19
+
20
+ void LinearReducer::reduce() {
21
+ std::list<Point*>::iterator start_p = this->points->begin();
22
+ std::list<Point*>::iterator end_p = std::next(start_p, 1);
23
+
24
+ int *dir = seq_dir(*start_p, *end_p);
25
+
26
+ for (std::list<Point*>::iterator point = std::next(end_p, 1); point != this->points->end(); ++point)
27
+ { int *act_seq = seq_dir(*end_p, *point);
28
+ if (act_seq[0] == dir[0] && act_seq[1] == dir[1])
29
+ { point = this->points->erase(end_p);
30
+ end_p = point;
31
+ } else {
32
+ dir = act_seq;
33
+ end_p = point;
34
+ }
35
+ }
36
+ }
37
+
38
+ int *LinearReducer::seq_dir(Point *a, Point *b)
39
+ { return(new int[2] {b->x - a->x, b->y - a->y});
40
+ }
@@ -0,0 +1,23 @@
1
+ /*
2
+ * LinearReducer.h
3
+ *
4
+ * Created on: 19 dic 2018
5
+ * Author: ema
6
+ * Copyright 2025 Emanuele Cesaroni
7
+ */
8
+
9
+ #ifndef POLYGON_REDUCERS_LINEARREDUCER_H_
10
+ #define POLYGON_REDUCERS_LINEARREDUCER_H_
11
+
12
+ #include "Reducer.h"
13
+
14
+ class LinearReducer : public Reducer {
15
+ public:
16
+ LinearReducer(std::list<Point*> *list_of_points);
17
+ virtual ~LinearReducer();
18
+ void reduce();
19
+ private:
20
+ int *seq_dir(Point *a, Point *b);
21
+ };
22
+
23
+ #endif /* POLYGON_REDUCERS_LINEARREDUCER_H_ */
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Reducer.cpp
3
+ *
4
+ * Created on: 16 dic 2018
5
+ * Author: ema
6
+ * Copyright 2025 Emanuele Cesaroni
7
+ */
8
+
9
+ #include "Reducer.h"
10
+
11
+ Reducer::Reducer(std::list<Point*> *list_of_points) {
12
+ this->points = list_of_points;
13
+ }
14
+
15
+ Reducer::~Reducer() {
16
+ }
17
+
18
+ void Reducer::reduce() {
19
+ }
@@ -0,0 +1,25 @@
1
+ /*
2
+ * Reducer.h
3
+ *
4
+ * Created on: 16 dic 2018
5
+ * Author: ema
6
+ * Copyright 2025 Emanuele Cesaroni
7
+ */
8
+
9
+ #ifndef POLYGON_REDUCERS_REDUCER_H_
10
+ #define POLYGON_REDUCERS_REDUCER_H_
11
+
12
+ #include <list>
13
+ #include "../finder/Node.h"
14
+
15
+ struct Point;
16
+ class Reducer {
17
+ public:
18
+ Reducer(std::list<Point*> *list_of_points);
19
+ virtual ~Reducer();
20
+ virtual void reduce();
21
+ protected:
22
+ std::list<Point*> *points;
23
+ };
24
+
25
+ #endif /* POLYGON_REDUCERS_REDUCER_H_ */
@@ -0,0 +1,30 @@
1
+ /*
2
+ * UniqReducer.cpp
3
+ *
4
+ * Created on: 19 dic 2018
5
+ * Author: ema
6
+ * Copyright 2025 Emanuele Cesaroni
7
+ */
8
+
9
+ #include "UniqReducer.h"
10
+ #include "Reducer.h"
11
+ #include "algorithm"
12
+ #include "list"
13
+ #include "iterator"
14
+ #include "iostream"
15
+
16
+ UniqReducer::UniqReducer(std::list<Point*> *list_of_points) : Reducer(list_of_points) {
17
+ }
18
+
19
+ UniqReducer::~UniqReducer() {
20
+ }
21
+
22
+ struct is_near {
23
+ bool operator() (Point *first, Point *second)
24
+ { return (first->x == second->x && first->y == second->y); }
25
+ };
26
+
27
+ void UniqReducer::reduce() {
28
+ this->points->unique(is_near());
29
+ }
30
+
@@ -0,0 +1,21 @@
1
+ /*
2
+ * UniqReducer.h
3
+ *
4
+ * Created on: 19 dic 2018
5
+ * Author: ema
6
+ * Copyright 2025 Emanuele Cesaroni
7
+ */
8
+
9
+ #ifndef POLYGON_REDUCERS_UNIQREDUCER_H_
10
+ #define POLYGON_REDUCERS_UNIQREDUCER_H_
11
+
12
+ #include "Reducer.h"
13
+
14
+ class UniqReducer : public Reducer {
15
+ public:
16
+ UniqReducer(std::list<Point*> *list_of_points);
17
+ virtual ~UniqReducer();
18
+ void reduce();
19
+ };
20
+
21
+ #endif /* POLYGON_REDUCERS_UNIQREDUCER_H_ */
@@ -0,0 +1,50 @@
1
+ /*
2
+ * VisvalingamReducer.cpp
3
+ *
4
+ * Created on: 20 dic 2018
5
+ * Author: ema
6
+ * Copyright 2025 Emanuele Cesaroni
7
+ */
8
+
9
+ #include <iostream>
10
+ #include <list>
11
+ #include "VisvalingamReducer.h"
12
+ #include "Reducer.h"
13
+
14
+ VisvalingamReducer::VisvalingamReducer(std::list<Point*> *list_of_points, float tolerance) : Reducer(list_of_points) {
15
+ this->tolerance = tolerance * tolerance;
16
+ }
17
+
18
+ VisvalingamReducer::~VisvalingamReducer() {
19
+ }
20
+
21
+ void VisvalingamReducer::reduce() {
22
+ std::list<Point*> *new_points = this->simplify();
23
+ this->points->assign(new_points->begin(), new_points->end());
24
+ }
25
+ std::list<Point*> *VisvalingamReducer::simplify() {
26
+ Vertex *vwLine = VisvalingamReducer::Vertex::buildLine(this->points);
27
+ float minArea = this->tolerance;
28
+ for (;;) {
29
+ minArea = this->simplifyVertex(vwLine);
30
+ if (minArea >= this->tolerance) break;
31
+ }
32
+ std::list<Point*> *simp = vwLine->getCoordinates();
33
+ return(simp);
34
+ }
35
+ float VisvalingamReducer::simplifyVertex(VisvalingamReducer::Vertex *vwLine) {
36
+ VisvalingamReducer::Vertex *curr = vwLine;
37
+ float minArea = curr->getArea();
38
+ VisvalingamReducer::Vertex *minVertex = nullptr;
39
+ while (curr != nullptr) {
40
+ float area = curr->getArea();
41
+ if (area < minArea) {
42
+ minArea = area;
43
+ minVertex = curr;
44
+ }
45
+ curr = curr->get_next();
46
+ }
47
+ if (minVertex != nullptr && minArea < this->tolerance) minVertex->remove();
48
+ if (!vwLine->isLiving()) return -1;
49
+ return(minArea);
50
+ }
@@ -0,0 +1,121 @@
1
+ /*
2
+ * VisvalingamReducer.h
3
+ *
4
+ * Created on: 20 dic 2018
5
+ * Author: ema
6
+ * Copyright 2025 Emanuele Cesaroni
7
+ */
8
+
9
+ #ifndef POLYGON_REDUCERS_VISVALINGAMREDUCER_H_
10
+ #define POLYGON_REDUCERS_VISVALINGAMREDUCER_H_
11
+
12
+ #include <cmath>
13
+ #include <limits>
14
+ #include <list>
15
+ #include "Reducer.h"
16
+ #include "../finder/Node.h"
17
+
18
+ struct Point;
19
+
20
+ class VisvalingamReducer : public Reducer {
21
+ public:
22
+ VisvalingamReducer(std::list<Point*> *list_of_points, float tolerance);
23
+ virtual ~VisvalingamReducer();
24
+ void reduce();
25
+ std::list<Point*> *simplify();
26
+ class Triangle {
27
+ public:
28
+ static int area(Point *a, Point *b, Point *c) {
29
+ return( std::abs( ((c->x - a->x) * (b->y - a->y) - (b->x - a->x) * (c->y - a->y)) / 2));
30
+ }
31
+ };
32
+ class Vertex {
33
+ const float MAX_AREA = std::numeric_limits<float>::max();
34
+ Vertex(Point *pt) {
35
+ this->pt = pt;
36
+ this->prev = nullptr;
37
+ this->next = nullptr;
38
+ this->area = MAX_AREA;
39
+ this->isLive = true;
40
+ }
41
+
42
+ public:
43
+ Point *pt;
44
+ void setNext(Vertex *nextp) {
45
+ this->next = nextp;
46
+ }
47
+ void setPrec(Vertex *prev) {
48
+ this->prev = prev;
49
+ }
50
+ void updateArea() {
51
+ if (this->prev == nullptr || this->next == nullptr)
52
+ { this->area = MAX_AREA;
53
+ return;
54
+ }
55
+ this->area = Triangle::area(this->prev->pt, this->pt, this->next->pt);
56
+ }
57
+ float getArea()
58
+ { return(this->area);
59
+ }
60
+ Vertex *get_next() {
61
+ return(this->next);
62
+ }
63
+ bool isLiving()
64
+ { return(this->isLive);
65
+ }
66
+ static Vertex *buildLine(std::list<Point*> *pts) {
67
+ Vertex *first = nullptr;
68
+ Vertex *prev = nullptr;
69
+ int i = 0;
70
+ for (std::list<Point*>::iterator it = pts->begin(); it != pts->end(); ++it, i++)
71
+ { Vertex *v = new Vertex(*it);
72
+ if (first == nullptr) first = v;
73
+ v->setPrec(prev);
74
+ if (prev != nullptr)
75
+ { prev->setNext(v);
76
+ prev->updateArea();
77
+ }
78
+ prev = v;
79
+ }
80
+ return(first);
81
+ }
82
+ Vertex* remove() {
83
+ Vertex *tmpPrev = this->prev;
84
+ Vertex *tmpNext = this->next;
85
+ Vertex *result = nullptr;
86
+ if (this->prev != nullptr)
87
+ { this->prev->setNext(tmpNext);
88
+ this->prev->updateArea();
89
+ result = prev;
90
+ }
91
+ if (this->next != nullptr)
92
+ { this->next->setPrec(tmpPrev);
93
+ this->next->updateArea();
94
+ if (result == nullptr) result = this->next;
95
+ }
96
+ this->isLive = false;
97
+ return(result);
98
+ }
99
+ std::list<Point*> *getCoordinates() {
100
+ std::list<Point*> *coords = new std::list<Point*>();
101
+ Vertex *curr = this;
102
+ for (;;)
103
+ { coords->push_back(curr->pt);
104
+ curr = curr->get_next();
105
+ if (curr == nullptr) break;
106
+ }
107
+ return(coords);
108
+ }
109
+
110
+ private:
111
+ Vertex *next, *prev;
112
+ double area = MAX_AREA;
113
+ bool isLive = true;
114
+ };
115
+
116
+ private:
117
+ float simplifyVertex(VisvalingamReducer::Vertex *vwLine);
118
+ float tolerance;
119
+ };
120
+
121
+ #endif /* POLYGON_REDUCERS_VISVALINGAMREDUCER_H_ */