Comparar commits

...

2 Commits

Autor SHA1 Mensagem Data
Tim Kuipers 7ae68276d4 refactor: filename: gcodePlanner ==> LayerPlan (CURA-3339) 2017-02-17 12:10:50 +01:00
Tim Kuipers 11f97f4a84 refactor: GCodePlanner ==> LayerPlan (CURA-3339) 2017-02-17 12:06:52 +01:00
12 arquivos alterados com 110 adições e 111 exclusões
+1 -2
Ver Arquivo
@@ -66,10 +66,9 @@ set(engine_SRCS # Except main.cpp.
src/FffProcessor.cpp
src/gcodeExport.cpp
src/GCodePathConfig.cpp
src/gcodePlanner.cpp
src/infill.cpp
src/WallsComputation.cpp
src/layerPart.cpp
src/LayerPlan.cpp
src/LayerPlanBuffer.cpp
src/MergeInfillLines.cpp
src/mesh.cpp
+27 -27
Ver Arquivo
@@ -88,10 +88,10 @@ void FffGcodeWriter::writeGCode(SliceDataStorage& storage, TimeKeeper& time_keep
for (unsigned int layer_nr = process_layer_starting_layer_nr; layer_nr < total_layers; layer_nr++)
{
GCodePlanner& gcode_layer = processLayer(storage, layer_nr, total_layers);
LayerPlan& gcode_layer = processLayer(storage, layer_nr, total_layers);
layer_plan_buffer.push(gcode_layer);
planner_state = gcode_layer.getPlanningState();
GCodePlanner* to_be_written = layer_plan_buffer.processBuffer();
LayerPlan* to_be_written = layer_plan_buffer.processBuffer();
if (to_be_written)
{
to_be_written->writeGCode(gcode);
@@ -303,7 +303,7 @@ void FffGcodeWriter::processRaft(const SliceDataStorage& storage, unsigned int t
int layer_height = train->getSettingInMicrons("raft_base_thickness");
z += layer_height;
int64_t comb_offset = train->getSettingInMicrons("raft_base_line_spacing");
GCodePlanner& gcode_layer = *new GCodePlanner(storage, layer_nr, z, layer_height, planner_state, fan_speed_layer_time_settings_per_extruder, combing_mode, comb_offset, train->getSettingBoolean("travel_avoid_other_parts"), train->getSettingInMicrons("travel_avoid_distance"));
LayerPlan& gcode_layer = *new LayerPlan(storage, layer_nr, z, layer_height, planner_state, fan_speed_layer_time_settings_per_extruder, combing_mode, comb_offset, train->getSettingBoolean("travel_avoid_other_parts"), train->getSettingInMicrons("travel_avoid_distance"));
gcode_layer.setIsInside(true);
gcode_layer.setExtruder(extruder_nr);
@@ -332,7 +332,7 @@ void FffGcodeWriter::processRaft(const SliceDataStorage& storage, unsigned int t
layer_plan_buffer.push(gcode_layer);
planner_state = gcode_layer.getPlanningState();
GCodePlanner* to_be_written = layer_plan_buffer.processBuffer();
LayerPlan* to_be_written = layer_plan_buffer.processBuffer();
if (to_be_written)
{
to_be_written->writeGCode(gcode);
@@ -345,7 +345,7 @@ void FffGcodeWriter::processRaft(const SliceDataStorage& storage, unsigned int t
int layer_height = train->getSettingInMicrons("raft_interface_thickness");
z += layer_height;
int64_t comb_offset = train->getSettingInMicrons("raft_interface_line_spacing");
GCodePlanner& gcode_layer = *new GCodePlanner(storage, layer_nr, z, layer_height, planner_state, fan_speed_layer_time_settings_per_extruder, combing_mode, comb_offset, train->getSettingBoolean("travel_avoid_other_parts"), train->getSettingInMicrons("travel_avoid_distance"));
LayerPlan& gcode_layer = *new LayerPlan(storage, layer_nr, z, layer_height, planner_state, fan_speed_layer_time_settings_per_extruder, combing_mode, comb_offset, train->getSettingBoolean("travel_avoid_other_parts"), train->getSettingInMicrons("travel_avoid_distance"));
gcode_layer.setIsInside(true);
gcode_layer.setExtruder(extruder_nr); // reset to extruder number, because we might have primed in the last layer
@@ -367,7 +367,7 @@ void FffGcodeWriter::processRaft(const SliceDataStorage& storage, unsigned int t
layer_plan_buffer.push(gcode_layer);
planner_state = gcode_layer.getPlanningState();
GCodePlanner* to_be_written = layer_plan_buffer.processBuffer();
LayerPlan* to_be_written = layer_plan_buffer.processBuffer();
if (to_be_written)
{
to_be_written->writeGCode(gcode);
@@ -382,7 +382,7 @@ void FffGcodeWriter::processRaft(const SliceDataStorage& storage, unsigned int t
const int layer_nr = initial_raft_layer_nr + 2 + raftSurfaceLayer - 1; // 2: 1 base layer, 1 interface layer
z += layer_height;
const int64_t comb_offset = train->getSettingInMicrons("raft_surface_line_spacing");
GCodePlanner& gcode_layer = *new GCodePlanner(storage, layer_nr, z, layer_height, planner_state, fan_speed_layer_time_settings_per_extruder, combing_mode, comb_offset, train->getSettingBoolean("travel_avoid_other_parts"), train->getSettingInMicrons("travel_avoid_distance"));
LayerPlan& gcode_layer = *new LayerPlan(storage, layer_nr, z, layer_height, planner_state, fan_speed_layer_time_settings_per_extruder, combing_mode, comb_offset, train->getSettingBoolean("travel_avoid_other_parts"), train->getSettingInMicrons("travel_avoid_distance"));
gcode_layer.setIsInside(true);
if (CommandSocket::isInstantiated())
@@ -402,7 +402,7 @@ void FffGcodeWriter::processRaft(const SliceDataStorage& storage, unsigned int t
layer_plan_buffer.push(gcode_layer);
planner_state = gcode_layer.getPlanningState();
GCodePlanner* to_be_written = layer_plan_buffer.processBuffer();
LayerPlan* to_be_written = layer_plan_buffer.processBuffer();
if (to_be_written)
{
to_be_written->writeGCode(gcode);
@@ -411,7 +411,7 @@ void FffGcodeWriter::processRaft(const SliceDataStorage& storage, unsigned int t
}
}
GCodePlanner& FffGcodeWriter::processLayer(const SliceDataStorage& storage, int layer_nr, unsigned int total_layers) const
LayerPlan& FffGcodeWriter::processLayer(const SliceDataStorage& storage, int layer_nr, unsigned int total_layers) const
{
Progress::messageProgress(Progress::Stage::EXPORT, std::max(0, layer_nr) + 1, total_layers);
logDebug("GcodeWriter processing layer %i of %i\n", layer_nr, total_layers);
@@ -470,7 +470,7 @@ GCodePlanner& FffGcodeWriter::processLayer(const SliceDataStorage& storage, int
int64_t comb_offset_from_outlines = max_inner_wall_width * 2;
GCodePlanner& gcode_layer = *new GCodePlanner(storage, layer_nr, z, layer_thickness, planner_state, fan_speed_layer_time_settings_per_extruder, getSettingAsCombingMode("retraction_combing"), comb_offset_from_outlines, avoid_other_parts, avoid_distance);
LayerPlan& gcode_layer = *new LayerPlan(storage, layer_nr, z, layer_thickness, planner_state, fan_speed_layer_time_settings_per_extruder, getSettingAsCombingMode("retraction_combing"), comb_offset_from_outlines, avoid_other_parts, avoid_distance);
if (include_helper_parts && layer_nr == 0)
{ // process the skirt or the brim of the starting extruder.
@@ -573,7 +573,7 @@ bool FffGcodeWriter::getExtrudersNeedPrimeDuringFirstLayer() const
}
}
void FffGcodeWriter::ensureAllExtrudersArePrimed(const SliceDataStorage& storage, GCodePlanner& gcode_layer, const int layer_nr) const
void FffGcodeWriter::ensureAllExtrudersArePrimed(const SliceDataStorage& storage, LayerPlan& gcode_layer, const int layer_nr) const
{
// Add prime for all extruders which haven't primed yet.
@@ -587,7 +587,7 @@ void FffGcodeWriter::ensureAllExtrudersArePrimed(const SliceDataStorage& storage
}
}
void FffGcodeWriter::processSkirtBrim(const SliceDataStorage& storage, GCodePlanner& gcode_layer, unsigned int extruder_nr) const
void FffGcodeWriter::processSkirtBrim(const SliceDataStorage& storage, LayerPlan& gcode_layer, unsigned int extruder_nr) const
{
if (skirt_brim_is_processed[extruder_nr])
{
@@ -603,7 +603,7 @@ void FffGcodeWriter::processSkirtBrim(const SliceDataStorage& storage, GCodePlan
gcode_layer.addPolygonsByOptimizer(skirt_brim, &gcode_layer.configs_storage.skirt_brim_config[extruder_nr]);
}
void FffGcodeWriter::processOozeShield(const SliceDataStorage& storage, GCodePlanner& gcode_layer, unsigned int layer_nr) const
void FffGcodeWriter::processOozeShield(const SliceDataStorage& storage, LayerPlan& gcode_layer, unsigned int layer_nr) const
{
if (layer_nr == 0 && storage.getSettingAsPlatformAdhesion("adhesion_type") == EPlatformAdhesion::BRIM)
{
@@ -615,7 +615,7 @@ void FffGcodeWriter::processOozeShield(const SliceDataStorage& storage, GCodePla
}
}
void FffGcodeWriter::processDraftShield(const SliceDataStorage& storage, GCodePlanner& gcode_layer, unsigned int layer_nr) const
void FffGcodeWriter::processDraftShield(const SliceDataStorage& storage, LayerPlan& gcode_layer, unsigned int layer_nr) const
{
if (storage.draft_protection_shield.size() == 0)
{
@@ -687,7 +687,7 @@ std::vector<unsigned int> FffGcodeWriter::calculateMeshOrder(const SliceDataStor
return ret;
}
void FffGcodeWriter::addMeshLayerToGCode_meshSurfaceMode(const SliceDataStorage& storage, const SliceMeshStorage* mesh, const PathConfigStorage::MeshPathConfigs& mesh_config, GCodePlanner& gcode_layer, int layer_nr) const
void FffGcodeWriter::addMeshLayerToGCode_meshSurfaceMode(const SliceDataStorage& storage, const SliceMeshStorage* mesh, const PathConfigStorage::MeshPathConfigs& mesh_config, LayerPlan& gcode_layer, int layer_nr) const
{
if (layer_nr > mesh->layer_nr_max_filled_layer)
{
@@ -719,7 +719,7 @@ void FffGcodeWriter::addMeshLayerToGCode_meshSurfaceMode(const SliceDataStorage&
addMeshOpenPolyLinesToGCode(storage, mesh, mesh_config, gcode_layer, layer_nr);
}
void FffGcodeWriter::addMeshOpenPolyLinesToGCode(const SliceDataStorage& storage, const SliceMeshStorage* mesh, const PathConfigStorage::MeshPathConfigs& mesh_config, GCodePlanner& gcode_layer, int layer_nr) const
void FffGcodeWriter::addMeshOpenPolyLinesToGCode(const SliceDataStorage& storage, const SliceMeshStorage* mesh, const PathConfigStorage::MeshPathConfigs& mesh_config, LayerPlan& gcode_layer, int layer_nr) const
{
const SliceLayer* layer = &mesh->layers[layer_nr];
@@ -738,7 +738,7 @@ void FffGcodeWriter::addMeshOpenPolyLinesToGCode(const SliceDataStorage& storage
}
void FffGcodeWriter::addMeshLayerToGCode(const SliceDataStorage& storage, const SliceMeshStorage* mesh, const PathConfigStorage::MeshPathConfigs& mesh_config, GCodePlanner& gcode_layer, int layer_nr) const
void FffGcodeWriter::addMeshLayerToGCode(const SliceDataStorage& storage, const SliceMeshStorage* mesh, const PathConfigStorage::MeshPathConfigs& mesh_config, LayerPlan& gcode_layer, int layer_nr) const
{
if (layer_nr > mesh->layer_nr_max_filled_layer)
{
@@ -803,7 +803,7 @@ void FffGcodeWriter::addMeshLayerToGCode(const SliceDataStorage& storage, const
}
}
void FffGcodeWriter::addMeshPartToGCode(const SliceDataStorage& storage, const SliceMeshStorage* mesh, const PathConfigStorage::MeshPathConfigs& mesh_config, const SliceLayerPart& part, GCodePlanner& gcode_layer, int layer_nr) const
void FffGcodeWriter::addMeshPartToGCode(const SliceDataStorage& storage, const SliceMeshStorage* mesh, const PathConfigStorage::MeshPathConfigs& mesh_config, const SliceLayerPart& part, LayerPlan& gcode_layer, int layer_nr) const
{
bool skin_alternate_rotation = mesh->getSettingBoolean("skin_alternate_rotation") && ( mesh->getSettingAsCount("top_layers") >= 4 || mesh->getSettingAsCount("bottom_layers") >= 4 );
@@ -865,7 +865,7 @@ void FffGcodeWriter::addMeshPartToGCode(const SliceDataStorage& storage, const S
void FffGcodeWriter::processMultiLayerInfill(GCodePlanner& gcode_layer, const SliceMeshStorage* mesh, const PathConfigStorage::MeshPathConfigs& mesh_config, const SliceLayerPart& part, unsigned int layer_nr, int infill_line_distance, int infill_overlap, int infill_angle) const
void FffGcodeWriter::processMultiLayerInfill(LayerPlan& gcode_layer, const SliceMeshStorage* mesh, const PathConfigStorage::MeshPathConfigs& mesh_config, const SliceLayerPart& part, unsigned int layer_nr, int infill_line_distance, int infill_overlap, int infill_angle) const
{
int64_t z = layer_nr * getSettingInMicrons("layer_height");
if (infill_line_distance > 0)
@@ -896,7 +896,7 @@ void FffGcodeWriter::processMultiLayerInfill(GCodePlanner& gcode_layer, const Sl
}
}
void FffGcodeWriter::processSingleLayerInfill(GCodePlanner& gcode_layer, const SliceMeshStorage* mesh, const PathConfigStorage::MeshPathConfigs& mesh_config, const SliceLayerPart& part, unsigned int layer_nr, int infill_line_distance, int infill_overlap, int infill_angle) const
void FffGcodeWriter::processSingleLayerInfill(LayerPlan& gcode_layer, const SliceMeshStorage* mesh, const PathConfigStorage::MeshPathConfigs& mesh_config, const SliceLayerPart& part, unsigned int layer_nr, int infill_line_distance, int infill_overlap, int infill_angle) const
{
if (infill_line_distance == 0 || part.infill_area_per_combine_per_density[0].size() == 0)
{
@@ -957,7 +957,7 @@ void FffGcodeWriter::processSingleLayerInfill(GCodePlanner& gcode_layer, const S
}
}
void FffGcodeWriter::processInsets(GCodePlanner& gcode_layer, const SliceMeshStorage* mesh, const PathConfigStorage::MeshPathConfigs& mesh_config, const SliceLayerPart& part, unsigned int layer_nr, EZSeamType z_seam_type, Point z_seam_pos) const
void FffGcodeWriter::processInsets(LayerPlan& gcode_layer, const SliceMeshStorage* mesh, const PathConfigStorage::MeshPathConfigs& mesh_config, const SliceLayerPart& part, unsigned int layer_nr, EZSeamType z_seam_type, Point z_seam_pos) const
{
bool compensate_overlap_0 = mesh->getSettingBoolean("travel_compensate_overlapping_walls_0_enabled");
bool compensate_overlap_x = mesh->getSettingBoolean("travel_compensate_overlapping_walls_x_enabled");
@@ -1017,7 +1017,7 @@ void FffGcodeWriter::processInsets(GCodePlanner& gcode_layer, const SliceMeshSto
}
void FffGcodeWriter::processSkinAndPerimeterGaps(GCodePlanner& gcode_layer, const SliceMeshStorage* mesh, const PathConfigStorage::MeshPathConfigs& mesh_config, const SliceLayerPart& part, unsigned int layer_nr, int skin_overlap, int skin_angle) const
void FffGcodeWriter::processSkinAndPerimeterGaps(LayerPlan& gcode_layer, const SliceMeshStorage* mesh, const PathConfigStorage::MeshPathConfigs& mesh_config, const SliceLayerPart& part, unsigned int layer_nr, int skin_overlap, int skin_angle) const
{
int64_t z = layer_nr * getSettingInMicrons("layer_height");
const unsigned int skin_line_width = mesh_config.skin_config.getLineWidth();
@@ -1160,7 +1160,7 @@ void FffGcodeWriter::processSkinAndPerimeterGaps(GCodePlanner& gcode_layer, cons
}
}
bool FffGcodeWriter::addSupportToGCode(const SliceDataStorage& storage, GCodePlanner& gcode_layer, int layer_nr, int extruder_nr) const
bool FffGcodeWriter::addSupportToGCode(const SliceDataStorage& storage, LayerPlan& gcode_layer, int layer_nr, int extruder_nr) const
{
bool support_added = false;
if (!storage.support.generated || layer_nr > storage.support.layer_nr_max_filled_layer)
@@ -1189,7 +1189,7 @@ bool FffGcodeWriter::addSupportToGCode(const SliceDataStorage& storage, GCodePla
return support_added;
}
bool FffGcodeWriter::addSupportInfillToGCode(const SliceDataStorage& storage, GCodePlanner& gcode_layer, int layer_nr) const
bool FffGcodeWriter::addSupportInfillToGCode(const SliceDataStorage& storage, LayerPlan& gcode_layer, int layer_nr) const
{
const SupportLayer& support_layer = storage.support.supportLayers[std::max(0, layer_nr)]; // account for negative layer numbers for raft filler layers
@@ -1261,7 +1261,7 @@ bool FffGcodeWriter::addSupportInfillToGCode(const SliceDataStorage& storage, GC
return added;
}
bool FffGcodeWriter::addSupportRoofsToGCode(const SliceDataStorage& storage, GCodePlanner& gcode_layer, int layer_nr) const
bool FffGcodeWriter::addSupportRoofsToGCode(const SliceDataStorage& storage, LayerPlan& gcode_layer, int layer_nr) const
{
const SupportLayer& support_layer = storage.support.supportLayers[std::max(0, layer_nr)];
@@ -1327,7 +1327,7 @@ bool FffGcodeWriter::addSupportRoofsToGCode(const SliceDataStorage& storage, GCo
return added;
}
void FffGcodeWriter::setExtruder_addPrime(const SliceDataStorage& storage, GCodePlanner& gcode_layer, int layer_nr, int extruder_nr) const
void FffGcodeWriter::setExtruder_addPrime(const SliceDataStorage& storage, LayerPlan& gcode_layer, int layer_nr, int extruder_nr) const
{
if (extruder_nr == -1) // an object with extruder_nr==-1 means it will be printed with any current nozzle
return;
@@ -1364,7 +1364,7 @@ void FffGcodeWriter::setExtruder_addPrime(const SliceDataStorage& storage, GCode
}
}
void FffGcodeWriter::addPrimeTower(const SliceDataStorage& storage, GCodePlanner& gcode_layer, int layer_nr, int prev_extruder) const
void FffGcodeWriter::addPrimeTower(const SliceDataStorage& storage, LayerPlan& gcode_layer, int layer_nr, int prev_extruder) const
{
if (!getSettingBoolean("prime_tower_enable"))
{
+21 -21
Ver Arquivo
@@ -12,7 +12,7 @@
#include "infill.h"
#include "bridge.h"
#include "pathOrderOptimizer.h"
#include "gcodePlanner.h"
#include "LayerPlan.h"
#include "gcodeExport.h"
#include "commandSocket.h"
#include "PrimeTower.h"
@@ -40,7 +40,7 @@ private:
int max_object_height; //!< The maximal height of all previously sliced meshgroups, used to avoid collision when moving to the next meshgroup to print.
/*
* Buffer for all layer plans (of type GCodePlanner)
* Buffer for all layer plans (of type LayerPlan)
*
* The layer plans are buffered so that we can start heating up a nozzle several layers before it needs to be used.
* Another reason is to perform Auto Temperature.
@@ -75,7 +75,7 @@ private:
std::vector<FanSpeedLayerTimeSettings> fan_speed_layer_time_settings_per_extruder; //!< The settings used relating to minimal layer time and fan speeds. Configured for each extruder.
GCodePlanner::PlanningState planner_state;
LayerPlan::PlanningState planner_state;
public:
FffGcodeWriter(SettingsBase* settings_)
@@ -220,7 +220,7 @@ private:
* \param total_layers The total number of layers.
* \return The layer plans
*/
GCodePlanner& processLayer(const SliceDataStorage& storage, int layer_nr, unsigned int total_layers) const;
LayerPlan& processLayer(const SliceDataStorage& storage, int layer_nr, unsigned int total_layers) const;
/*!
* Whether the extruders need to be primed separately just before they are used.
@@ -235,7 +235,7 @@ private:
* \param layer_plan The initial planning of the g-code of the layer.
* \param layer_nr The index of the layer to write the gcode of.
*/
void ensureAllExtrudersArePrimed(const SliceDataStorage& storage, GCodePlanner& layer_plan, const int layer_nr) const;
void ensureAllExtrudersArePrimed(const SliceDataStorage& storage, LayerPlan& layer_plan, const int layer_nr) const;
/*!
* Add the skirt or the brim to the layer plan \p gcodeLayer.
@@ -245,7 +245,7 @@ private:
* \param extruder_nr The extruder train for which to process the skirt or
* brim.
*/
void processSkirtBrim(const SliceDataStorage& storage, GCodePlanner& gcodeLayer, unsigned int extruder_nr) const;
void processSkirtBrim(const SliceDataStorage& storage, LayerPlan& gcodeLayer, unsigned int extruder_nr) const;
/*!
* Adds the ooze shield to the layer plan \p gcodeLayer.
@@ -254,7 +254,7 @@ private:
* \param gcodeLayer The initial planning of the gcode of the layer.
* \param layer_nr The index of the layer to write the gcode of.
*/
void processOozeShield(const SliceDataStorage& storage, GCodePlanner& gcodeLayer, unsigned int layer_nr) const;
void processOozeShield(const SliceDataStorage& storage, LayerPlan& gcodeLayer, unsigned int layer_nr) const;
/*!
* Adds the draft protection screen to the layer plan \p gcodeLayer.
@@ -263,7 +263,7 @@ private:
* \param gcodeLayer The initial planning of the gcode of the layer.
* \param layer_nr The index of the layer to write the gcode of.
*/
void processDraftShield(const SliceDataStorage& storage, GCodePlanner& gcodeLayer, unsigned int layer_nr) const;
void processDraftShield(const SliceDataStorage& storage, LayerPlan& gcodeLayer, unsigned int layer_nr) const;
/*!
* Calculate in which order to plan the extruders
@@ -293,7 +293,7 @@ private:
* \param layer_nr The index of the layer to write the gcode of.
*
*/
void addMeshLayerToGCode_meshSurfaceMode(const SliceDataStorage& storage, const SliceMeshStorage* mesh, const PathConfigStorage::MeshPathConfigs& mesh_config, GCodePlanner& gcodeLayer, int layer_nr) const;
void addMeshLayerToGCode_meshSurfaceMode(const SliceDataStorage& storage, const SliceMeshStorage* mesh, const PathConfigStorage::MeshPathConfigs& mesh_config, LayerPlan& gcodeLayer, int layer_nr) const;
/*!
* Add the open polylines from a single layer from a single mesh-volume to the layer plan \p gcodeLayer for mesh the surface modes.
@@ -305,7 +305,7 @@ private:
* \param layer_nr The index of the layer to write the gcode of.
*
*/
void addMeshOpenPolyLinesToGCode(const SliceDataStorage& storage, const SliceMeshStorage* mesh, const PathConfigStorage::MeshPathConfigs& mesh_config, GCodePlanner& gcode_layer, int layer_nr) const;
void addMeshOpenPolyLinesToGCode(const SliceDataStorage& storage, const SliceMeshStorage* mesh, const PathConfigStorage::MeshPathConfigs& mesh_config, LayerPlan& gcode_layer, int layer_nr) const;
/*!
* Add a single layer from a single mesh-volume to the layer plan \p gcode_layer.
@@ -317,7 +317,7 @@ private:
* \param layer_nr The index of the layer to write the gcode of.
*
*/
void addMeshLayerToGCode(const SliceDataStorage& storage, const SliceMeshStorage* mesh, const PathConfigStorage::MeshPathConfigs& mesh_config, GCodePlanner& gcode_layer, int layer_nr) const;
void addMeshLayerToGCode(const SliceDataStorage& storage, const SliceMeshStorage* mesh, const PathConfigStorage::MeshPathConfigs& mesh_config, LayerPlan& gcode_layer, int layer_nr) const;
/*!
* Add a single part from a given layer of a mesh-volume to the layer plan \p gcode_layer.
@@ -330,7 +330,7 @@ private:
* \param layer_nr The index of the layer to write the gcode of.
*
*/
void addMeshPartToGCode(const SliceDataStorage& storage, const SliceMeshStorage* mesh, const PathConfigStorage::MeshPathConfigs& mesh_config, const SliceLayerPart& part, GCodePlanner& gcode_layer, int layer_nr) const;
void addMeshPartToGCode(const SliceDataStorage& storage, const SliceMeshStorage* mesh, const PathConfigStorage::MeshPathConfigs& mesh_config, const SliceLayerPart& part, LayerPlan& gcode_layer, int layer_nr) const;
/*!
* Add thicker (multiple layers) sparse infill for a given part in a layer plan.
@@ -344,7 +344,7 @@ private:
* \param infill_overlap The distance by which the infill overlaps with the wall insets.
* \param fillAngle The angle in the XY plane at which the infill is generated.
*/
void processMultiLayerInfill(GCodePlanner& gcodeLayer, const SliceMeshStorage* mesh, const PathConfigStorage::MeshPathConfigs& mesh_config, const SliceLayerPart& part, unsigned int layer_nr, int infill_line_distance, int infill_overlap, int fillAngle) const;
void processMultiLayerInfill(LayerPlan& gcodeLayer, const SliceMeshStorage* mesh, const PathConfigStorage::MeshPathConfigs& mesh_config, const SliceLayerPart& part, unsigned int layer_nr, int infill_line_distance, int infill_overlap, int fillAngle) const;
/*!
* Add normal sparse infill for a given part in a layer.
@@ -357,7 +357,7 @@ private:
* \param infill_overlap The distance by which the infill overlaps with the wall insets.
* \param fillAngle The angle in the XY plane at which the infill is generated.
*/
void processSingleLayerInfill(GCodePlanner& gcodeLayer, const SliceMeshStorage* mesh, const PathConfigStorage::MeshPathConfigs& mesh_config, const SliceLayerPart& part, unsigned int layer_nr, int infill_line_distance, int infill_overlap, int fillAngle) const;
void processSingleLayerInfill(LayerPlan& gcodeLayer, const SliceMeshStorage* mesh, const PathConfigStorage::MeshPathConfigs& mesh_config, const SliceLayerPart& part, unsigned int layer_nr, int infill_line_distance, int infill_overlap, int fillAngle) const;
/*!
* Generate the insets for the walls of a given layer part.
@@ -369,7 +369,7 @@ private:
* \param z_seam_type dir3ective for where to start the outer paerimeter of a part
* \param z_seam_pos The location near where to start the outer inset in case \p z_seam_type is 'back'
*/
void processInsets(GCodePlanner& gcodeLayer, const SliceMeshStorage* mesh, const PathConfigStorage::MeshPathConfigs& mesh_config, const SliceLayerPart& part, unsigned int layer_nr, EZSeamType z_seam_type, Point z_seam_pos) const;
void processInsets(LayerPlan& gcodeLayer, const SliceMeshStorage* mesh, const PathConfigStorage::MeshPathConfigs& mesh_config, const SliceLayerPart& part, unsigned int layer_nr, EZSeamType z_seam_type, Point z_seam_pos) const;
/*!
@@ -386,7 +386,7 @@ private:
* \param skin_overlap The distance by which the skin overlaps with the wall insets and the distance by which the perimeter gaps overlap with adjacent print features.
* \param fillAngle The angle in the XY plane at which the infill is generated.
*/
void processSkinAndPerimeterGaps(GCodePlanner& gcode_layer, const SliceMeshStorage* mesh, const PathConfigStorage::MeshPathConfigs& mesh_config, const SliceLayerPart& part, unsigned int layer_nr, int skin_overlap, int infill_angle) const;
void processSkinAndPerimeterGaps(LayerPlan& gcode_layer, const SliceMeshStorage* mesh, const PathConfigStorage::MeshPathConfigs& mesh_config, const SliceLayerPart& part, unsigned int layer_nr, int skin_overlap, int infill_angle) const;
/*!
* Add the support to the layer plan \p gcodeLayer of the current layer for all support parts with the given \p extruder_nr.
@@ -395,7 +395,7 @@ private:
* \param layer_nr The index of the layer to write the gcode of.
* \return whether any support was added to the layer plan
*/
bool addSupportToGCode(const SliceDataStorage& storage, GCodePlanner& gcodeLayer, int layer_nr, int extruder_nr) const;
bool addSupportToGCode(const SliceDataStorage& storage, LayerPlan& gcodeLayer, int layer_nr, int extruder_nr) const;
/*!
* Add the support lines/walls to the layer plan \p gcodeLayer of the current layer.
* \param[in] storage where the slice data is stored.
@@ -403,7 +403,7 @@ private:
* \param layer_nr The index of the layer to write the gcode of.
* \return whether any support infill was added to the layer plan
*/
bool addSupportInfillToGCode(const SliceDataStorage& storage, GCodePlanner& gcodeLayer, int layer_nr) const;
bool addSupportInfillToGCode(const SliceDataStorage& storage, LayerPlan& gcodeLayer, int layer_nr) const;
/*!
* Add the support skins to the layer plan \p gcodeLayer of the current layer.
* \param[in] storage where the slice data is stored.
@@ -411,7 +411,7 @@ private:
* \param layer_nr The index of the layer to write the gcode of.
* \return whether any support skin was added to the layer plan
*/
bool addSupportRoofsToGCode(const SliceDataStorage& storage, GCodePlanner& gcodeLayer, int layer_nr) const;
bool addSupportRoofsToGCode(const SliceDataStorage& storage, LayerPlan& gcodeLayer, int layer_nr) const;
/*!
* Change to a new extruder, and add the prime tower instructions if the new extruder is different from the last.
@@ -423,7 +423,7 @@ private:
* \param layer_nr The index of the layer to write the gcode of.
* \param extruder_nr The extruder to which to switch
*/
void setExtruder_addPrime(const SliceDataStorage& storage, GCodePlanner& gcode_layer, int layer_nr, int extruder_nr) const;
void setExtruder_addPrime(const SliceDataStorage& storage, LayerPlan& gcode_layer, int layer_nr, int extruder_nr) const;
/*!
* Add the prime tower gcode for the current layer.
@@ -432,7 +432,7 @@ private:
* \param layer_nr The index of the layer to write the gcode of.
* \param prev_extruder The current extruder with which we last printed.
*/
void addPrimeTower(const SliceDataStorage& storage, GCodePlanner& gcodeLayer, int layer_nr, int prev_extruder) const;
void addPrimeTower(const SliceDataStorage& storage, LayerPlan& gcodeLayer, int layer_nr, int prev_extruder) const;
/*!
* Add the end gcode and set all temperatures to zero.
+1 -1
Ver Arquivo
@@ -13,7 +13,7 @@ namespace cura
*/
class GCodePathConfig
{
friend class GCodePlannerTest;
friend class LayerPlanTest;
public:
/*!
* A simple wrapper class for all derivatives of position which are used when printing a line
+24 -24
Ver Arquivo
@@ -1,6 +1,6 @@
/** Copyright (C) 2016 Ultimaker - Released under terms of the AGPLv3 License */
#include <cstring>
#include "gcodePlanner.h"
#include "LayerPlan.h"
#include "pathOrderOptimizer.h"
#include "sliceDataStorage.h"
#include "utils/polygonUtils.h"
@@ -56,7 +56,7 @@ double ExtruderPlan::getFanSpeed()
}
GCodePath* GCodePlanner::getLatestPathWithConfig(const GCodePathConfig* config, SpaceFillType space_fill_type, float flow, bool spiralize)
GCodePath* LayerPlan::getLatestPathWithConfig(const GCodePathConfig* config, SpaceFillType space_fill_type, float flow, bool spiralize)
{
std::vector<GCodePath>& paths = extruder_plans.back().paths;
if (paths.size() > 0 && paths.back().config == config && !paths.back().done && paths.back().flow == flow) // spiralize can only change when a travel path is in between
@@ -74,14 +74,14 @@ GCodePath* GCodePlanner::getLatestPathWithConfig(const GCodePathConfig* config,
return ret;
}
void GCodePlanner::forceNewPathStart()
void LayerPlan::forceNewPathStart()
{
std::vector<GCodePath>& paths = extruder_plans.back().paths;
if (paths.size() > 0)
paths[paths.size()-1].done = true;
}
GCodePlanner::GCodePlanner(const SliceDataStorage& storage, int layer_nr, int z, int layer_thickness, PlanningState last_planned_state, const std::vector<FanSpeedLayerTimeSettings>& fan_speed_layer_time_settings_per_extruder, CombingMode combing_mode, int64_t comb_boundary_offset, bool travel_avoid_other_parts, int64_t travel_avoid_distance)
LayerPlan::LayerPlan(const SliceDataStorage& storage, int layer_nr, int z, int layer_thickness, PlanningState last_planned_state, const std::vector<FanSpeedLayerTimeSettings>& fan_speed_layer_time_settings_per_extruder, CombingMode combing_mode, int64_t comb_boundary_offset, bool travel_avoid_other_parts, int64_t travel_avoid_distance)
: storage(storage)
, configs_storage(storage, layer_nr, layer_thickness)
, layer_nr(layer_nr)
@@ -110,19 +110,19 @@ GCodePlanner::GCodePlanner(const SliceDataStorage& storage, int layer_nr, int z,
comb = nullptr;
}
GCodePlanner::~GCodePlanner()
LayerPlan::~LayerPlan()
{
if (comb)
delete comb;
}
SettingsBaseVirtual* GCodePlanner::getLastPlannedExtruderTrainSettings()
SettingsBaseVirtual* LayerPlan::getLastPlannedExtruderTrainSettings()
{
return last_planned_extruder_setting_base;
}
Polygons GCodePlanner::computeCombBoundaryInside(CombingMode combing_mode)
Polygons LayerPlan::computeCombBoundaryInside(CombingMode combing_mode)
{
if (combing_mode == CombingMode::OFF)
{
@@ -165,12 +165,12 @@ Polygons GCodePlanner::computeCombBoundaryInside(CombingMode combing_mode)
}
}
void GCodePlanner::setIsInside(bool _is_inside)
void LayerPlan::setIsInside(bool _is_inside)
{
is_inside = _is_inside;
}
bool GCodePlanner::setExtruder(int extruder)
bool LayerPlan::setExtruder(int extruder)
{
if (extruder == getExtruder())
{
@@ -223,7 +223,7 @@ bool GCodePlanner::setExtruder(int extruder)
return true;
}
void GCodePlanner::moveInsideCombBoundary(int distance)
void LayerPlan::moveInsideCombBoundary(int distance)
{
int max_dist2 = MM2INT(2.0) * MM2INT(2.0); // if we are further than this distance, we conclude we are not inside even though we thought we were.
// this function is to be used to move from the boudary of a part to inside the part
@@ -241,7 +241,7 @@ void GCodePlanner::moveInsideCombBoundary(int distance)
}
}
GCodePath& GCodePlanner::addTravel(Point p)
GCodePath& LayerPlan::addTravel(Point p)
{
GCodePath* path = nullptr;
const GCodePathConfig& travel_config = configs_storage.travel_config_per_extruder[getExtruder()];
@@ -332,7 +332,7 @@ GCodePath& GCodePlanner::addTravel(Point p)
return ret;
}
GCodePath& GCodePlanner::addTravel_simple(Point p, GCodePath* path)
GCodePath& LayerPlan::addTravel_simple(Point p, GCodePath* path)
{
if (path == nullptr)
{
@@ -343,7 +343,7 @@ GCodePath& GCodePlanner::addTravel_simple(Point p, GCodePath* path)
return *path;
}
void GCodePlanner::planPrime()
void LayerPlan::planPrime()
{
forceNewPathStart();
GCodePath& prime_travel = addTravel_simple(lastPosition + Point(0, 100));
@@ -352,13 +352,13 @@ void GCodePlanner::planPrime()
forceNewPathStart();
}
void GCodePlanner::addExtrusionMove(Point p, const GCodePathConfig* config, SpaceFillType space_fill_type, float flow, bool spiralize)
void LayerPlan::addExtrusionMove(Point p, const GCodePathConfig* config, SpaceFillType space_fill_type, float flow, bool spiralize)
{
getLatestPathWithConfig(config, space_fill_type, flow, spiralize)->points.push_back(p);
lastPosition = p;
}
void GCodePlanner::addPolygon(ConstPolygonRef polygon, int start_idx, const GCodePathConfig* config, WallOverlapComputation* wall_overlap_computation, coord_t wall_0_wipe_dist, bool spiralize)
void LayerPlan::addPolygon(ConstPolygonRef polygon, int start_idx, const GCodePathConfig* config, WallOverlapComputation* wall_overlap_computation, coord_t wall_0_wipe_dist, bool spiralize)
{
Point p0 = polygon[start_idx];
addTravel(p0);
@@ -402,11 +402,11 @@ void GCodePlanner::addPolygon(ConstPolygonRef polygon, int start_idx, const GCod
}
else
{
logWarning("WARNING: line added as polygon! (gcodePlanner)\n");
logWarning("WARNING: line added as polygon! (LayerPlan)\n");
}
}
void GCodePlanner::addPolygonsByOptimizer(const Polygons& polygons, const GCodePathConfig* config, WallOverlapComputation* wall_overlap_computation, EZSeamType z_seam_type, Point z_seam_pos, coord_t wall_0_wipe_dist, bool spiralize)
void LayerPlan::addPolygonsByOptimizer(const Polygons& polygons, const GCodePathConfig* config, WallOverlapComputation* wall_overlap_computation, EZSeamType z_seam_type, Point z_seam_pos, coord_t wall_0_wipe_dist, bool spiralize)
{
if (polygons.size() == 0)
{
@@ -423,7 +423,7 @@ void GCodePlanner::addPolygonsByOptimizer(const Polygons& polygons, const GCodeP
addPolygon(polygons[poly_idx], orderOptimizer.polyStart[poly_idx], config, wall_overlap_computation, wall_0_wipe_dist, spiralize);
}
}
void GCodePlanner::addLinesByOptimizer(const Polygons& polygons, const GCodePathConfig* config, SpaceFillType space_fill_type, int wipe_dist)
void LayerPlan::addLinesByOptimizer(const Polygons& polygons, const GCodePathConfig* config, SpaceFillType space_fill_type, int wipe_dist)
{
LineOrderOptimizer orderOptimizer(lastPosition);
for (unsigned int line_idx = 0; line_idx < polygons.size(); line_idx++)
@@ -615,7 +615,7 @@ void ExtruderPlan::processFanSpeedAndMinimalLayerTime(bool force_minimal_layer_t
}
}
TimeMaterialEstimates GCodePlanner::computeNaiveTimeEstimates()
TimeMaterialEstimates LayerPlan::computeNaiveTimeEstimates()
{
TimeMaterialEstimates ret;
for (ExtruderPlan& extruder_plan : extruder_plans)
@@ -625,7 +625,7 @@ TimeMaterialEstimates GCodePlanner::computeNaiveTimeEstimates()
return ret;
}
void GCodePlanner::processFanSpeedAndMinimalLayerTime()
void LayerPlan::processFanSpeedAndMinimalLayerTime()
{
for (unsigned int extr_plan_idx = 0; extr_plan_idx < extruder_plans.size(); extr_plan_idx++)
{
@@ -637,7 +637,7 @@ void GCodePlanner::processFanSpeedAndMinimalLayerTime()
void GCodePlanner::writeGCode(GCodeExport& gcode)
void LayerPlan::writeGCode(GCodeExport& gcode)
{
CommandSocket::setLayerForSend(layer_nr);
CommandSocket::setSendCurrentPosition( gcode.getPositionXY() );
@@ -878,7 +878,7 @@ void GCodePlanner::writeGCode(GCodeExport& gcode)
gcode.updateTotalPrintTime();
}
void GCodePlanner::overrideFanSpeeds(double speed)
void LayerPlan::overrideFanSpeeds(double speed)
{
for (ExtruderPlan& extruder_plan : extruder_plans)
{
@@ -887,7 +887,7 @@ void GCodePlanner::overrideFanSpeeds(double speed)
}
bool GCodePlanner::makeRetractSwitchRetract(GCodeExport& gcode, unsigned int extruder_plan_idx, unsigned int path_idx)
bool LayerPlan::makeRetractSwitchRetract(GCodeExport& gcode, unsigned int extruder_plan_idx, unsigned int path_idx)
{
std::vector<GCodePath>& paths = extruder_plans[extruder_plan_idx].paths;
for (unsigned int path_idx2 = path_idx + 1; path_idx2 < paths.size(); path_idx2++)
@@ -913,7 +913,7 @@ bool GCodePlanner::makeRetractSwitchRetract(GCodeExport& gcode, unsigned int ext
}
}
bool GCodePlanner::writePathWithCoasting(GCodeExport& gcode, unsigned int extruder_plan_idx, unsigned int path_idx, int64_t layerThickness, double coasting_volume, double coasting_speed, double coasting_min_volume)
bool LayerPlan::writePathWithCoasting(GCodeExport& gcode, unsigned int extruder_plan_idx, unsigned int path_idx, int64_t layerThickness, double coasting_volume, double coasting_speed, double coasting_min_volume)
{
if (coasting_volume <= 0)
{
+17 -17
Ver Arquivo
@@ -1,6 +1,6 @@
/** Copyright (C) 2016 Ultimaker - Released under terms of the AGPLv3 License */
#ifndef GCODE_PLANNER_H
#define GCODE_PLANNER_H
#ifndef LAYER_PLAN_H
#define LAYER_PLAN_H
#include <vector>
@@ -25,7 +25,7 @@ namespace cura
class SliceDataStorage;
class GCodePlanner; // forward declaration so that ExtruderPlan can be a friend
class LayerPlan; // forward declaration so that ExtruderPlan can be a friend
class LayerPlanBuffer; // forward declaration so that ExtruderPlan can be a friend
/*!
@@ -35,7 +35,7 @@ class LayerPlanBuffer; // forward declaration so that ExtruderPlan can be a frie
*/
class ExtruderPlan
{
friend class GCodePlanner; // TODO: GCodePlanner still does a lot which should actually be handled in this class.
friend class LayerPlan; // TODO: LayerPlan still does a lot which should actually be handled in this class.
friend class LayerPlanBuffer; // TODO: LayerPlanBuffer handles paths directly
protected:
std::vector<GCodePath> paths; //!< The paths planned for this extruder
@@ -203,23 +203,23 @@ protected:
class LayerPlanBuffer; // forward declaration to prevent circular dependency
/*!
* The GCodePlanner class stores multiple moves that are planned.
* The LayerPlan class stores multiple moves that are planned.
*
*
* It facilitates the combing to keep the head inside the print.
* It also keeps track of the print time estimate for this planning so speed adjustments can be made for the minimal-layer-time.
*
* A GCodePlanner is also knows as a 'layer plan'.
* A LayerPlan is also knows as a 'layer plan'.
*
*/
class GCodePlanner : public NoCopy
class LayerPlan : public NoCopy
{
friend class LayerPlanBuffer;
friend class GCodePlannerTest;
friend class LayerPlanTest;
public:
/*!
* The state which is passed along between layer plans.
* This is what a \ref GCodePlanner delivers to further computation in \ref FffGcodeWriter
* This is what a \ref LayerPlan delivers to further computation in \ref FffGcodeWriter
* This is the state which is currently planned, not which is written to gcode.
*/
struct PlanningState
@@ -262,22 +262,22 @@ private:
private:
/*!
* Either create a new path with the given config or return the last path if it already had that config.
* If GCodePlanner::forceNewPathStart has been called a new path will always be returned.
* If LayerPlan::forceNewPathStart has been called a new path will always be returned.
*
* \param config The config used for the path returned
* \param space_fill_type The type of space filling which this path employs
* \param flow (optional) A ratio for the extrusion speed
* \param spiralize Whether to gradually increase the z while printing. (Note that this path may be part of a sequence of spiralized paths, forming one polygon)
* \return A path with the given config which is now the last path in GCodePlanner::paths
* \return A path with the given config which is now the last path in LayerPlan::paths
*/
GCodePath* getLatestPathWithConfig(const GCodePathConfig* config, SpaceFillType space_fill_type, float flow = 1.0, bool spiralize = false);
public:
/*!
* Force GCodePlanner::getLatestPathWithConfig to return a new path.
* Force LayerPlan::getLatestPathWithConfig to return a new path.
*
* This function is introduced because in some cases
* GCodePlanner::getLatestPathWithConfig is called consecutively with the same config pointer,
* LayerPlan::getLatestPathWithConfig is called consecutively with the same config pointer,
* though the content of the config has changed.
*
* Example cases:
@@ -293,8 +293,8 @@ public:
* \param last_position The position of the head at the start of this gcode layer
* \param combing_mode Whether combing is enabled and full or within infill only.
*/
GCodePlanner(const SliceDataStorage& storage, int layer_nr, int z, int layer_height, PlanningState last_planned_state, const std::vector<FanSpeedLayerTimeSettings>& fan_speed_layer_time_settings_per_extruder, CombingMode combing_mode, int64_t comb_boundary_offset, bool travel_avoid_other_parts, int64_t travel_avoid_distance);
~GCodePlanner();
LayerPlan(const SliceDataStorage& storage, int layer_nr, int z, int layer_height, PlanningState last_planned_state, const std::vector<FanSpeedLayerTimeSettings>& fan_speed_layer_time_settings_per_extruder, CombingMode combing_mode, int64_t comb_boundary_offset, bool travel_avoid_other_parts, int64_t travel_avoid_distance);
~LayerPlan();
void overrideFanSpeeds(double speed);
/*!
@@ -492,7 +492,7 @@ public:
*
* \param gcode The gcode to write the planned paths to
* \param extruder_plan_idx The index of the current extruder plan
* \param path_idx The index into GCodePlanner::paths for the next path to be written to GCode.
* \param path_idx The index into LayerPlan::paths for the next path to be written to GCode.
* \param layerThickness The height of the current layer.
* \param coasting_volume The volume otherwise leaked during a normal move.
* \param coasting_speed The speed at which to move during move-coasting.
@@ -517,4 +517,4 @@ public:
}//namespace cura
#endif//GCODE_PLANNER_H
#endif // LAYER_PLAN_H
+2 -2
Ver Arquivo
@@ -332,7 +332,7 @@ void LayerPlanBuffer::insertTempCommands()
std::vector<ExtruderPlan*> extruder_plans;
extruder_plans.reserve(buffer.size() * 2);
for (GCodePlanner* layer_plan : buffer)
for (LayerPlan* layer_plan : buffer)
{
for (ExtruderPlan& extr_plan : layer_plan->extruder_plans)
{
@@ -342,7 +342,7 @@ void LayerPlanBuffer::insertTempCommands()
// insert commands for all extruder plans on this layer
GCodePlanner& layer_plan = *buffer.back();
LayerPlan& layer_plan = *buffer.back();
for (unsigned int extruder_plan_idx = 0; extruder_plan_idx < layer_plan.extruder_plans.size(); extruder_plan_idx++)
{
unsigned int overall_extruder_plan_idx = extruder_plans.size() - layer_plan.extruder_plans.size() + extruder_plan_idx;
+7 -7
Ver Arquivo
@@ -8,7 +8,7 @@
#include "commandSocket.h"
#include "gcodeExport.h"
#include "gcodePlanner.h"
#include "LayerPlan.h"
#include "MeshGroup.h"
#include "Preheat.h"
@@ -17,7 +17,7 @@ namespace cura
{
/*!
* Class for buffering multiple layer plans (\ref GCodePlanner) / extruder plans within those layer plans, so that temperature commands can be inserted in earlier layer plans.
* Class for buffering multiple layer plans (\ref LayerPlan) / extruder plans within those layer plans, so that temperature commands can be inserted in earlier layer plans.
*
* This class handles where to insert temperature commands for:
* - initial layer temperature
@@ -42,7 +42,7 @@ class LayerPlanBuffer : SettingsMessenger
std::vector<bool> extruder_used_in_meshgroup; //!< For each extruder whether it has already been planned once in this meshgroup. This is used to see whether we should heat to the initial_print_temp or to the printing_temperature
public:
std::list<GCodePlanner*> buffer; //!< The buffer containing several layer plans (GCodePlanner) before writing them to gcode.
std::list<LayerPlan*> buffer; //!< The buffer containing several layer plans (LayerPlan) before writing them to gcode.
LayerPlanBuffer(SettingsBaseVirtual* settings, GCodeExport& gcode)
: SettingsMessenger(settings)
@@ -58,7 +58,7 @@ public:
/*!
* Push a new layer plan into the buffer
*/
void push(GCodePlanner& layer_plan)
void push(LayerPlan& layer_plan)
{
buffer.push_back(&layer_plan);
}
@@ -70,7 +70,7 @@ public:
* Pop out the earliest layer in the buffer if the buffer size is exceeded
* \return A nullptr or the popped gcode_layer
*/
GCodePlanner* processBuffer()
LayerPlan* processBuffer()
{
if (buffer.size() > 0)
{
@@ -78,7 +78,7 @@ public:
}
if (buffer.size() > buffer_size)
{
GCodePlanner* ret = buffer.front();
LayerPlan* ret = buffer.front();
if (CommandSocket::isInstantiated())
{
CommandSocket::getInstance()->flushGcode();
@@ -90,7 +90,7 @@ public:
}
/*!
* Write all remaining layer plans (GCodePlanner) to gcode and empty the buffer.
* Write all remaining layer plans (LayerPlan) to gcode and empty the buffer.
*/
void flush();
+1 -1
Ver Arquivo
@@ -3,7 +3,7 @@
#include "utils/intpoint.h"
#include "gcodeExport.h"
#include "gcodePlanner.h"
#include "LayerPlan.h"
#include "GCodePathConfig.h"
namespace cura
+4 -4
Ver Arquivo
@@ -5,7 +5,7 @@
#include "ExtruderTrain.h"
#include "sliceDataStorage.h"
#include "gcodeExport.h"
#include "gcodePlanner.h"
#include "LayerPlan.h"
#include "infill.h"
#include "PrintFeature.h"
@@ -94,7 +94,7 @@ void PrimeTower::generatePaths_denseInfill(const SliceDataStorage& storage)
}
void PrimeTower::addToGcode(const SliceDataStorage& storage, GCodePlanner& gcodeLayer, const GCodeExport& gcode, const int layer_nr, const int prev_extruder, const int new_extruder) const
void PrimeTower::addToGcode(const SliceDataStorage& storage, LayerPlan& gcodeLayer, const GCodeExport& gcode, const int layer_nr, const int prev_extruder, const int new_extruder) const
{
if (!enabled)
{
@@ -135,7 +135,7 @@ void PrimeTower::addToGcode(const SliceDataStorage& storage, GCodePlanner& gcode
gcodeLayer.setPrimeTowerIsPlanned();
}
void PrimeTower::addToGcode_denseInfill(GCodePlanner& gcode_layer, const int layer_nr, const int extruder_nr) const
void PrimeTower::addToGcode_denseInfill(LayerPlan& gcode_layer, const int layer_nr, const int extruder_nr) const
{
const ExtrusionMoves& pattern = patterns_per_extruder[extruder_nr][((layer_nr % 2) + 2) % 2]; // +2) %2 to handle negative layer numbers
@@ -225,7 +225,7 @@ void PrimeTower::generateWipeLocations(const SliceDataStorage& storage)
PolygonUtils::spreadDots(segment_start, segment_end, number_of_pre_wipe_locations, pre_wipe_locations);
}
void PrimeTower::preWipe(const SliceDataStorage& storage, GCodePlanner& gcode_layer, const int layer_nr, const int extruder_nr) const
void PrimeTower::preWipe(const SliceDataStorage& storage, LayerPlan& gcode_layer, const int layer_nr, const int extruder_nr) const
{
int current_pre_wipe_location_idx = (pre_wipe_location_skip * layer_nr) % number_of_pre_wipe_locations;
const ClosestPolygonPoint wipe_location = pre_wipe_locations[current_pre_wipe_location_idx];
+4 -4
Ver Arquivo
@@ -16,7 +16,7 @@ namespace cura
class SliceDataStorage;
class GCodePlanner;
class LayerPlan;
class GCodeExport;
/*!
@@ -87,7 +87,7 @@ public:
* \param prev_extruder The previous extruder with which paths were planned; from which extruder a switch was made
* \param new_extruder The switched to extruder with which the prime tower paths should be generated.
*/
void addToGcode(const SliceDataStorage& storage, GCodePlanner& gcode_layer, const GCodeExport& gcode, const int layer_nr, const int prev_extruder, const int new_extruder) const;
void addToGcode(const SliceDataStorage& storage, LayerPlan& gcode_layer, const GCodeExport& gcode, const int layer_nr, const int prev_extruder, const int new_extruder) const;
/*!
* \brief Subtract the prime tower from the support areas in storage.
@@ -136,7 +136,7 @@ private:
* \param extruder The extruder we just switched to, with which the prime
* tower paths should be drawn.
*/
void addToGcode_denseInfill(GCodePlanner& gcode_layer, const int layer_nr, const int extruder) const;
void addToGcode_denseInfill(LayerPlan& gcode_layer, const int layer_nr, const int extruder) const;
/*!
* Plan the moves for wiping the current nozzles oozed material before starting to print the prime tower.
@@ -146,7 +146,7 @@ private:
* \param layer_nr The layer number of the \p gcode_layer
* \param extruder_nr The current extruder
*/
void preWipe(const SliceDataStorage& storage, GCodePlanner& gcode_layer, const int layer_nr, const int extruder_nr) const;
void preWipe(const SliceDataStorage& storage, LayerPlan& gcode_layer, const int layer_nr, const int extruder_nr) const;
};
+1 -1
Ver Arquivo
@@ -6,7 +6,7 @@
#include "utils/intpoint.h"
#include "utils/polygon.h"
#include "mesh.h"
#include "gcodePlanner.h"
#include "LayerPlan.h"
#include "MeshGroup.h"