2014-01-06 17:29:10 +00:00
|
|
|
#ifndef slic3r_Layer_hpp_
|
|
|
|
#define slic3r_Layer_hpp_
|
|
|
|
|
|
|
|
#include <myinit.h>
|
2014-05-06 08:07:18 +00:00
|
|
|
#include "SurfaceCollection.hpp"
|
|
|
|
#include "ExtrusionEntityCollection.hpp"
|
|
|
|
#include "ExPolygonCollection.hpp"
|
|
|
|
#include "PolylineCollection.hpp"
|
|
|
|
|
2014-01-06 17:29:10 +00:00
|
|
|
|
|
|
|
namespace Slic3r {
|
|
|
|
|
|
|
|
typedef std::pair<coordf_t,coordf_t> t_layer_height_range;
|
|
|
|
typedef std::map<t_layer_height_range,coordf_t> t_layer_height_ranges;
|
|
|
|
|
2014-05-06 08:07:18 +00:00
|
|
|
class Layer;
|
|
|
|
class PrintRegion;
|
|
|
|
class PrintObject;
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: make stuff private
|
|
|
|
class LayerRegion
|
|
|
|
{
|
|
|
|
friend class Layer;
|
|
|
|
|
|
|
|
public:
|
|
|
|
Layer *layer;
|
|
|
|
PrintRegion *region;
|
|
|
|
|
|
|
|
// collection of surfaces generated by slicing the original geometry
|
|
|
|
// divided by type top/bottom/internal
|
|
|
|
SurfaceCollection slices;
|
|
|
|
|
|
|
|
// collection of extrusion paths/loops filling gaps
|
|
|
|
ExtrusionEntityCollection thin_fills;
|
|
|
|
|
|
|
|
// collection of surfaces for infill generation
|
|
|
|
SurfaceCollection fill_surfaces;
|
|
|
|
|
|
|
|
// collection of expolygons representing the bridged areas (thus not
|
|
|
|
// needing support material)
|
|
|
|
ExPolygonCollection bridged;
|
|
|
|
|
|
|
|
// collection of polylines representing the unsupported bridge edges
|
|
|
|
PolylineCollection unsupported_bridge_edges;
|
|
|
|
|
|
|
|
// ordered collection of extrusion paths/loops to build all perimeters
|
|
|
|
ExtrusionEntityCollection perimeters;
|
|
|
|
|
|
|
|
// ordered collection of extrusion paths to fill surfaces
|
|
|
|
ExtrusionEntityCollection fills;
|
|
|
|
|
|
|
|
private:
|
|
|
|
LayerRegion(Layer *layer, PrintRegion *region);
|
|
|
|
~LayerRegion();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
typedef std::vector<LayerRegion*> LayerRegionPtrs;
|
|
|
|
|
|
|
|
class Layer {
|
|
|
|
friend class PrintObject;
|
|
|
|
|
|
|
|
public:
|
|
|
|
int id; // sequential number of layer, 0-based
|
|
|
|
PrintObject *object;
|
|
|
|
Layer *upper_layer;
|
|
|
|
Layer *lower_layer;
|
|
|
|
LayerRegionPtrs regions;
|
|
|
|
bool slicing_errors;
|
|
|
|
coordf_t slice_z; // Z used for slicing in unscaled coordinates
|
|
|
|
coordf_t print_z; // Z used for printing in unscaled coordinates
|
|
|
|
coordf_t height; // layer height in unscaled coordinates
|
|
|
|
|
|
|
|
// collection of expolygons generated by slicing the original geometry;
|
|
|
|
// also known as 'islands' (all regions and surface types are merged here)
|
|
|
|
ExPolygonCollection slices;
|
|
|
|
|
|
|
|
|
|
|
|
size_t region_count();
|
|
|
|
void clear_regions();
|
|
|
|
LayerRegion* get_region(int idx);
|
|
|
|
LayerRegion* add_region(PrintRegion* print_region);
|
|
|
|
void delete_region(int idx);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
Layer(int id, PrintObject *object, coordf_t height, coordf_t print_z,
|
|
|
|
coordf_t slice_z);
|
|
|
|
virtual ~Layer();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class SupportLayer : public Layer {
|
|
|
|
friend class PrintObject;
|
|
|
|
|
|
|
|
public:
|
|
|
|
ExPolygonCollection support_islands;
|
|
|
|
ExtrusionEntityCollection support_fills;
|
|
|
|
ExtrusionEntityCollection support_interface_fills;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
SupportLayer(int id, PrintObject *object, coordf_t height, coordf_t print_z,
|
|
|
|
coordf_t slice_z);
|
|
|
|
virtual ~SupportLayer();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2014-01-06 17:29:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|