Ported ExtrusionPath::Collection

This commit is contained in:
Alessandro Ranellucci 2013-07-18 19:09:07 +02:00
parent 0efea9e442
commit c030e38908
18 changed files with 181 additions and 60 deletions

View file

@ -23,6 +23,7 @@ class ExPolygon
};
typedef std::vector<ExPolygon> ExPolygons;
typedef std::vector<ExPolygon*> ExPolygonsPtr;
}

View file

@ -5,24 +5,24 @@ namespace Slic3r {
void
ExPolygonCollection::scale(double factor)
{
for (ExPolygons::iterator it = expolygons.begin(); it != expolygons.end(); ++it) {
(*it).scale(factor);
for (ExPolygonsPtr::iterator it = expolygons.begin(); it != expolygons.end(); ++it) {
(**it).scale(factor);
}
}
void
ExPolygonCollection::translate(double x, double y)
{
for (ExPolygons::iterator it = expolygons.begin(); it != expolygons.end(); ++it) {
(*it).translate(x, y);
for (ExPolygonsPtr::iterator it = expolygons.begin(); it != expolygons.end(); ++it) {
(**it).translate(x, y);
}
}
void
ExPolygonCollection::rotate(double angle, Point* center)
{
for (ExPolygons::iterator it = expolygons.begin(); it != expolygons.end(); ++it) {
(*it).rotate(angle, center);
for (ExPolygonsPtr::iterator it = expolygons.begin(); it != expolygons.end(); ++it) {
(**it).rotate(angle, center);
}
}

View file

@ -9,8 +9,7 @@ namespace Slic3r {
class ExPolygonCollection
{
public:
ExPolygons expolygons;
SV* arrayref();
ExPolygonsPtr expolygons;
void scale(double factor);
void translate(double x, double y);
void rotate(double angle, Point* center);

View file

@ -25,11 +25,14 @@ enum ExtrusionRole {
class ExtrusionEntity
{
public:
virtual ~ExtrusionEntity() {};
ExtrusionRole role;
double height; // vertical thickness of the extrusion expressed in mm
double flow_spacing;
};
typedef std::vector<ExtrusionEntity*> ExtrusionEntitiesPtr;
class ExtrusionPath : public ExtrusionEntity
{
public:

View file

@ -0,0 +1,18 @@
#ifndef slic3r_ExtrusionEntityCollection_hpp_
#define slic3r_ExtrusionEntityCollection_hpp_
#include <myinit.h>
#include "ExtrusionEntity.hpp"
namespace Slic3r {
class ExtrusionEntityCollection
{
public:
ExtrusionEntitiesPtr entities;
bool no_sort;
};
}
#endif

View file

@ -19,6 +19,9 @@ class Surface
bool in_collection;
};
typedef std::vector<Surface> Surfaces;
typedef std::vector<Surface*> SurfacesPtr;
}
#endif

View file

@ -5,13 +5,10 @@
namespace Slic3r {
typedef std::vector<Surface> Surfaces;
class SurfaceCollection
{
public:
Surfaces surfaces;
SV* arrayref();
SurfacesPtr surfaces;
};
}