/* drawing (DXF) to G-code (NGC) converter
* Copyright 2013 Stefan Schuermans <stefan@schuermans.info>
* Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html
*/
#include <math.h>
#include <vector>
#include "gcode.h"
#include "path.h"
#include "point.h"
#include "settings.h"
/**
* @brief add a new point to the end of the path
* @param[in] point point to add
*/
void Path::addPoint(const Point &point)
{
mPoints.push_back(point);
}
/**
* @brief add a new point to the end of the path
* @param[in] x x coordinate of point to add
* @param[in] y y coordinate of point to add
*/
void Path::addPoint(double x, double y)
{
addPoint(Point(x, y));
}
/**
* @brief prepend other path to this one
* @param[in] other other path to prepend
*/
void Path::prependPath(const Path &other)
{
mPoints.insert(mPoints.begin(),
other.mPoints.begin(), other.mPoints.end());
}
/**
* @brief prepend other path in reverse to this one
* @param[in] other other path to prepend
*/
void Path::prependReversedPath(const Path &other)
{
mPoints.insert(mPoints.begin(),
other.mPoints.rbegin(), other.mPoints.rend());
}