/* drawing (DXF) to G-code (NGC) converter
* Copyright 2013 Stefan Schuermans <stefan@schuermans.info>
* Copyleft: CC-BY-SA http://creativecommons.org/licenses/by-sa/3.0/
*/
#include <vector>
#include "gcode.h"
#include "layer.h"
#include "path.h"
#include "settings.h"
/**
* @brief add a new empty path to the layer
* @return reference to new empty path
*/
Path & Layer::addPath()
{
mPaths.push_back(Path());
return mPaths.back();
}
/**
* @brief convert layer to G-code
* @param[in] settings G-code creation settings
* @param[in,out] gcode new G-code is appended to existing G-code
*/
void Layer::toGCode(const Settings &settings, GCode &gcode) const
{
Paths::const_iterator path;
for (path = mPaths.begin(); path != mPaths.end(); ++path)
path->toGCode(settings, gcode);
}