Welcome to mirror list, hosted at ThFree Co, Russian Federation.

path.hpp « graphics - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 14824f8d34b41402dbdae0ce15174bf5c2e5dbdf (plain)
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
#pragma once

#include "../geometry/point2d.hpp"

namespace graphics
{
  template <typename T>
  class Path
  {
  private:

    vector<m2::Point<T> > m_pts;

  public:

    void reset(m2::Point<T> const & pt)
    {
      m_pts.clear();
      m_pts.push_back(pt);
    }

    void lineRel(m2::Point<T> const & pt)
    {
      ASSERT(!m_pts.empty(), ());
      m2::Point<T> const & p = m_pts.back();
      m_pts.push_back(p + pt);
    }

    void eclipseArcRel(m2::Point<T> const & pt)
    {
      /// TODO : write implementation
    }

    m2::Point<T> const * points() const
    {
      ASSERT(!m_pts.empty(), ());
      return &m_pts[0];
    }

    unsigned size() const
    {
      return m_pts.size();
    }
  };
}