This class is used to calculate a point on a polyline such as that the paths (not the distance) from that point to both ends of a polyline have the same length.
| 16 | // such as that the paths (not the distance) from that point |
| 17 | // to both ends of a polyline have the same length. |
| 18 | class CalculatePolyLineCenter |
| 19 | { |
| 20 | public: |
| 21 | CalculatePolyLineCenter() : m_length(0.0) {} |
| 22 | void operator()(PointD const & pt); |
| 23 | |
| 24 | PointD GetResult() const; |
| 25 | |
| 26 | private: |
| 27 | struct Value |
| 28 | { |
| 29 | Value(PointD const & p, double l) : m_p(p), m_len(l) {} |
| 30 | bool operator<(Value const & r) const { return (m_len < r.m_len); } |
| 31 | PointD m_p; |
| 32 | double m_len; |
| 33 | }; |
| 34 | |
| 35 | std::vector<Value> m_poly; |
| 36 | double m_length; |
| 37 | }; |
| 38 | |
| 39 | // This class is used to calculate a point such as that |
| 40 | // it lays on the figure triangle that is the closest to |
no outgoing calls