<commit_before>#include "path/Path.h"

using namespace std;

namespace chr
{
  namespace path
  {
    Path::Path(vector<glm::vec2> &&polyline)
    :
    ASPC(std::forward<vector<glm::vec2>>(polyline))
    {}

    const vector <glm::vec2> &Path::getPolyline() const
    {
      return polyline;
    }

    size_t Path::size() const
    {
      return polyline.size();
    }

    bool Path::empty() const
    {
      return polyline.empty();
    }

    bool Path::isClosed() const
    {
      return (polyline.size() > 2) && (current == polyline.front());
    }

    Path &Path::setSamplingTolerance(float tolerance)
    {
      samplingTolerance = tolerance;
      return *this;
    }

    Path &Path::clear()
    {
      begin();
      current = {numeric_limits<float>::quiet_NaN(), numeric_limits<float>::quiet_NaN()};

      return *this;
    }

    Path &Path::close()
    {
      if ((polyline.size() > 2) && (current != polyline.front()))
      {
        polyline.emplace_back(polyline.front());
        current = polyline.front();
      }

      return *this;
    }

    Path &Path::moveTo(const glm::vec2 &p)
    {
      begin();
      current = p;

      return *this;
    }

    Path &Path::lineTo(const glm::vec2 &p)
    {
      if (current != p)
      {<commit_msg>FIXING ISSUE WITH path/Path: MOVE-TO WAS NOT INSERTING POINT IN POLYLINE<commit_after>#include "path/Path.h"

using namespace std;

namespace chr
{
  namespace path
  {
    Path::Path(vector<glm::vec2> &&polyline)
    :
    ASPC(std::forward<vector<glm::vec2>>(polyline))
    {}

    const vector <glm::vec2> &Path::getPolyline() const
    {
      return polyline;
    }

    size_t Path::size() const
    {
      return polyline.size();
    }

    bool Path::empty() const
    {
      return polyline.empty();
    }

    bool Path::isClosed() const
    {
      return (polyline.size() > 2) && (current == polyline.front());
    }

    Path &Path::setSamplingTolerance(float tolerance)
    {
      samplingTolerance = tolerance;
      return *this;
    }

    Path &Path::clear()
    {
      begin();
      current = {numeric_limits<float>::quiet_NaN(), numeric_limits<float>::quiet_NaN()};

      return *this;
    }

    Path &Path::close()
    {
      if ((polyline.size() > 2) && (current != polyline.front()))
      {
        polyline.emplace_back(polyline.front());
        current = polyline.front();
      }

      return *this;
    }

    Path &Path::moveTo(const glm::vec2 &p)
    {
      begin();
      polyline.emplace_back(p);
      current = p;

      return *this;
    }

    Path &Path::lineTo(const glm::vec2 &p)
    {
      if (current != p)
      {
{'fraction_non_alphanumeric': 0.15474839197881196, 'fraction_numerical': 0.0052970109723798715, 'mean_word_length': 2.3257861635220127, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1741268', 'n_tokens_mistral': 926, 'n_tokens_neox': 878, 'n_words': 171}