Skip to content

Commit

Permalink
Fixed last variable shadowing warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
wawanbreton committed Nov 22, 2023
1 parent 4bcc29c commit c56e755
Show file tree
Hide file tree
Showing 66 changed files with 1,091 additions and 1,147 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ set(engine_SRCS # Except main.cpp.
src/utils/polygonUtils.cpp
src/utils/polygon.cpp
src/utils/PolylineStitcher.cpp
src/utils/ProximityPointLink.cpp
src/utils/Simplify.cpp
src/utils/SVG.cpp
src/utils/socket.cpp
Expand Down Expand Up @@ -278,4 +277,4 @@ endif ()

if (ENABLE_BENCHMARKS)
add_subdirectory(benchmark)
endif ()
endif ()
14 changes: 7 additions & 7 deletions include/PathOrderOptimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ class PathOrderOptimizer

// For some Z seam types the start position can be pre-computed.
// This is faster since we don't need to re-compute the start position at each step then.
precompute_start &= seam_config_.type == EZSeamType::RANDOM || seam_config_.type == EZSeamType::USER_SPECIFIED || seam_config_.type == EZSeamType::SHARPEST_CORNER;
precompute_start &= seam_config_.type_ == EZSeamType::RANDOM || seam_config_.type_ == EZSeamType::USER_SPECIFIED || seam_config_.type_ == EZSeamType::SHARPEST_CORNER;
if (precompute_start)
{
for (auto& path : paths_)
Expand All @@ -208,7 +208,7 @@ class PathOrderOptimizer
{
continue; // Can't pre-compute the seam for open polylines since they're at the endpoint nearest to the current position.
}
path.start_vertex_ = findStartLocation(path, seam_config_.pos);
path.start_vertex_ = findStartLocation(path, seam_config_.pos_);
}
}

Expand Down Expand Up @@ -566,7 +566,7 @@ class PathOrderOptimizer
}

const bool precompute_start
= seam_config_.type == EZSeamType::RANDOM || seam_config_.type == EZSeamType::USER_SPECIFIED || seam_config_.type == EZSeamType::SHARPEST_CORNER;
= seam_config_.type_ == EZSeamType::RANDOM || seam_config_.type_ == EZSeamType::USER_SPECIFIED || seam_config_.type_ == EZSeamType::SHARPEST_CORNER;
if (! path->is_closed_ || ! precompute_start) // Find the start location unless we've already precomputed it.
{
path->start_vertex_ = findStartLocation(*path, start_position);
Expand Down Expand Up @@ -629,7 +629,7 @@ class PathOrderOptimizer

// Rest of the function only deals with (closed) polygons. We need to be able to find the seam location of those polygons.

if (seam_config_.type == EZSeamType::RANDOM)
if (seam_config_.type_ == EZSeamType::RANDOM)
{
size_t vert = getRandomPointInPolygon(*path.converted_);
return vert;
Expand All @@ -653,7 +653,7 @@ class PathOrderOptimizer
// For most seam types, the shortest distance matters. Not for SHARPEST_CORNER though.
// For SHARPEST_CORNER, use a fixed starting score of 0.
const coord_t distance = (combing_boundary_ == nullptr) ? getDirectDistance(here, target_pos) : getCombingDistance(here, target_pos);
const double score_distance = (seam_config_.type == EZSeamType::SHARPEST_CORNER && seam_config_.corner_pref != EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_NONE)
const double score_distance = (seam_config_.type_ == EZSeamType::SHARPEST_CORNER && seam_config_.corner_pref_ != EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_NONE)
? MM2INT(10)
: vSize2(here - target_pos);

Expand All @@ -662,7 +662,7 @@ class PathOrderOptimizer
// angles > 0 are convex (right turning)

double corner_shift;
if (seam_config_.type == EZSeamType::SHORTEST)
if (seam_config_.type_ == EZSeamType::SHORTEST)
{
// the more a corner satisfies our criteria, the closer it appears to be
// shift 10mm for a very acute corner
Expand All @@ -678,7 +678,7 @@ class PathOrderOptimizer
}

double score = score_distance;
switch (seam_config_.corner_pref)
switch (seam_config_.corner_pref_)
{
default:
case EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_INNER:
Expand Down
6 changes: 3 additions & 3 deletions include/TreeSupportUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ class TreeSupportUtils
Polygon result_line;
for (ExtrusionJunction junction : line)
{
result_line.add(junction.p);
result_line.add(junction.p_);
}

if (line.is_closed)
if (line.is_closed_)
{
result_line.add(line[0].p);
result_line.add(line[0].p_);
}

result.add(result_line);
Expand Down
4 changes: 2 additions & 2 deletions include/communication/CommandLine.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,12 @@ class CommandLine : public Communication
/*
* \brief The command line arguments that the application was called with.
*/
std::vector<std::string> arguments;
std::vector<std::string> arguments_;

/*
* The last progress update that we output to stdcerr.
*/
unsigned int last_shown_progress;
unsigned int last_shown_progress_;

/*
* \brief Get the default search directories to search for definition files.
Expand Down
12 changes: 6 additions & 6 deletions include/infill/LightningTreeNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class LightningTreeNode : public std::enable_shared_from_this<LightningTreeNode>
*/
bool isRoot() const
{
return is_root;
return is_root_;
}

/*!
Expand Down Expand Up @@ -262,12 +262,12 @@ class LightningTreeNode : public std::enable_shared_from_this<LightningTreeNode>

void removeJunctionOverlap(Polygons& polylines, const coord_t line_width) const;

bool is_root;
Point p;
std::weak_ptr<LightningTreeNode> parent;
std::vector<LightningTreeNodeSPtr> children;
bool is_root_;
Point p_;
std::weak_ptr<LightningTreeNode> parent_;
std::vector<LightningTreeNodeSPtr> children_;

std::optional<Point> last_grounding_location; //<! The last known grounding location, see 'getLastGroundingLocation()'.
std::optional<Point> last_grounding_location_; //<! The last known grounding location, see 'getLastGroundingLocation()'.
};

} // namespace cura
Expand Down
18 changes: 9 additions & 9 deletions include/infill/SierpinskiFill.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ class SierpinskiFill
};


bool dithering; //!< Whether to oscilate between neighboring realizable density values when the requested density lies in between two possible density values.
bool dithering_; //!< Whether to oscilate between neighboring realizable density values when the requested density lies in between two possible density values.
/*!
* Whether to diffuse errors caused by constraints between consecutive cells.
* Whether to center a stairway of depths around the contrast edge,
Expand All @@ -321,24 +321,24 @@ class SierpinskiFill
* no constraint error constraint error
* diffusion diffusion
*/
bool constraint_error_diffusion;
bool constraint_error_diffusion_;

//! Whether to use the constraint errors when performing dithering.
bool use_errors_in_dithering = true;
bool use_errors_in_dithering_ = true;


const DensityProvider& density_provider; //!< function which determines the requested infill density of a triangle defined by two consecutive edges.
AABB aabb; //!< The square which is the basis of the subdivision of the area on which the curve is based.
coord_t line_width; //!< The line width of the fill lines
int max_depth; //!< Maximum recursion depth of the fractal
const DensityProvider& density_provider_; //!< function which determines the requested infill density of a triangle defined by two consecutive edges.
AABB aabb_; //!< The square which is the basis of the subdivision of the area on which the curve is based.
coord_t line_width_; //!< The line width of the fill lines
int max_depth_; //!< Maximum recursion depth of the fractal

SierpinskiTriangle root; //! The (root of the) tree containing all possible triangles of the subdivision.
SierpinskiTriangle root_; //! The (root of the) tree containing all possible triangles of the subdivision.

/*!
* The triangles of the subdivision which are crossed by the fractal.
* This sequence is created by \ref createLowerBoundSequence and updated by \ref diffuseError
*/
std::list<SierpinskiTriangle*> sequence;
std::list<SierpinskiTriangle*> sequence_;


/*!
Expand Down
16 changes: 8 additions & 8 deletions include/infill/SubDivCube.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@ class SubDivCube
*/
void addLineAndCombine(Polygons& group, Point from, Point to);

size_t depth; //!< the recursion depth of the cube (0 is most recursed)
Point3 center; //!< center location of the cube in absolute coordinates
std::array<std::shared_ptr<SubDivCube>, 8> children; //!< pointers to this cube's eight octree children
static std::vector<CubeProperties> cube_properties_per_recursion_step; //!< precomputed array of basic properties of cubes based on recursion depth.
static Ratio radius_multiplier; //!< multiplier for the bounding radius when determining if a cube should be subdivided
static Point3Matrix rotation_matrix; //!< The rotation matrix to get from axis aligned cubes to cubes standing on a corner point aligned with the infill_angle
static PointMatrix infill_rotation_matrix; //!< Horizontal rotation applied to infill
static coord_t radius_addition; //!< addition to the bounding radius when determining if a cube should be subdivided
size_t depth_; //!< the recursion depth of the cube (0 is most recursed)
Point3 center_; //!< center location of the cube in absolute coordinates
std::array<std::shared_ptr<SubDivCube>, 8> children_; //!< pointers to this cube's eight octree children
static std::vector<CubeProperties> cube_properties_per_recursion_step_; //!< precomputed array of basic properties of cubes based on recursion depth.
static Ratio radius_multiplier_; //!< multiplier for the bounding radius when determining if a cube should be subdivided
static Point3Matrix rotation_matrix_; //!< The rotation matrix to get from axis aligned cubes to cubes standing on a corner point aligned with the infill_angle
static PointMatrix infill_rotation_matrix_; //!< Horizontal rotation applied to infill
static coord_t radius_addition_; //!< addition to the bounding radius when determining if a cube should be subdivided
};

} // namespace cura
Expand Down
64 changes: 32 additions & 32 deletions include/pathPlanning/Comb.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ class Comb
class Crossing
{
public:
bool dest_is_inside; //!< Whether the startPoint or endPoint is inside the inside boundary
Point in_or_mid; //!< The point on the inside boundary, or in between the inside and outside boundary if the start/end point isn't inside the inside boudary
Point out; //!< The point on the outside boundary
PolygonsPart dest_part; //!< The assembled inside-boundary PolygonsPart in which the dest_point lies. (will only be initialized when Crossing::dest_is_inside holds)
std::optional<ConstPolygonPointer> dest_crossing_poly; //!< The polygon of the part in which dest_point lies, which will be crossed (often will be the outside polygon)
const Polygons& boundary_inside; //!< The inside boundary as in \ref Comb::boundary_inside
const LocToLineGrid& inside_loc_to_line; //!< The loc to line grid \ref Comb::inside_loc_to_line
bool dest_is_inside_; //!< Whether the startPoint or endPoint is inside the inside boundary
Point in_or_mid_; //!< The point on the inside boundary, or in between the inside and outside boundary if the start/end point isn't inside the inside boudary
Point out_; //!< The point on the outside boundary
PolygonsPart dest_part_; //!< The assembled inside-boundary PolygonsPart in which the dest_point lies. (will only be initialized when Crossing::dest_is_inside holds)
std::optional<ConstPolygonPointer> dest_crossing_poly_; //!< The polygon of the part in which dest_point lies, which will be crossed (often will be the outside polygon)
const Polygons& boundary_inside_; //!< The inside boundary as in \ref Comb::boundary_inside
const LocToLineGrid& inside_loc_to_line_; //!< The loc to line grid \ref Comb::inside_loc_to_line

/*!
* Simple constructor
Expand Down Expand Up @@ -94,8 +94,8 @@ class Comb
bool findOutside(const ExtruderTrain& train, const Polygons& outside, const Point close_to, const bool fail_on_unavoidable_obstacles, Comb& comber);

private:
const Point dest_point; //!< Either the eventual startPoint or the eventual endPoint of this combing move
unsigned int dest_part_idx; //!< The index into Comb:partsView_inside of the part in which the \p dest_point is.
const Point dest_point_; //!< Either the eventual startPoint or the eventual endPoint of this combing move
unsigned int dest_part_idx_; //!< The index into Comb:partsView_inside of the part in which the \p dest_point is.

/*!
* Find the best crossing from some inside polygon to the outside boundary.
Expand All @@ -113,29 +113,29 @@ class Comb
};


const SliceDataStorage& storage; //!< The storage from which to compute the outside boundary, when needed.
const LayerIndex layer_nr; //!< The layer number for the layer for which to compute the outside boundary, when needed.

const coord_t travel_avoid_distance; //!<
const coord_t offset_from_outlines; //!< Offset from the boundary of a part to the comb path. (nozzle width / 2)
const coord_t max_moveInside_distance2; //!< Maximal distance of a point to the Comb::boundary_inside which is still to be considered inside. (very sharp corners not allowed :S)
const coord_t offset_from_inside_to_outside; //!< The sum of the offsets for the inside and outside boundary Comb::offset_from_outlines and Comb::offset_from_outlines_outside
const coord_t max_crossing_dist2; //!< The maximal distance by which to cross the in_between area between inside and outside
static const coord_t max_moveOutside_distance2 = std::numeric_limits<coord_t>::max(); //!< Any point which is not inside should be considered outside.
static constexpr coord_t offset_dist_to_get_from_on_the_polygon_to_outside = 40; //!< in order to prevent on-boundary vs crossing boundary confusions (precision thing)
static constexpr coord_t offset_extra_start_end = 100; //!< Distance to move start point and end point toward eachother to extra avoid collision with the boundaries.

Polygons boundary_inside_minimum; //!< The boundary within which to comb. (Will be reordered by the partsView_inside_minimum)
Polygons boundary_inside_optimal; //!< The boundary within which to comb. (Will be reordered by the partsView_inside_optimal)
const PartsView partsView_inside_minimum; //!< Structured indices onto boundary_inside_minimum which shows which polygons belong to which part.
const PartsView partsView_inside_optimal; //!< Structured indices onto boundary_inside_optimal which shows which polygons belong to which part.
std::unique_ptr<LocToLineGrid> inside_loc_to_line_minimum; //!< The SparsePointGridInclusive mapping locations to line segments of the inner boundary.
std::unique_ptr<LocToLineGrid> inside_loc_to_line_optimal; //!< The SparsePointGridInclusive mapping locations to line segments of the inner boundary.
std::unordered_map<size_t, Polygons> boundary_outside; //!< The boundary outside of which to stay to avoid collision with other layer parts. This is a pointer cause we only compute it when we move outside the boundary (so not when there is only a single part in the layer)
std::unordered_map<size_t, Polygons> model_boundary; //!< The boundary of the model itself
std::unordered_map<size_t, std::unique_ptr<LocToLineGrid>> outside_loc_to_line; //!< The SparsePointGridInclusive mapping locations to line segments of the outside boundary.
std::unordered_map<size_t, std::unique_ptr<LocToLineGrid>> model_boundary_loc_to_line; //!< The SparsePointGridInclusive mapping locations to line segments of the model boundary
coord_t move_inside_distance; //!< When using comb_boundary_inside_minimum for combing it tries to move points inside by this amount after calculating the path to move it from the border a bit.
const SliceDataStorage& storage_; //!< The storage from which to compute the outside boundary, when needed.
const LayerIndex layer_nr_; //!< The layer number for the layer for which to compute the outside boundary, when needed.

const coord_t travel_avoid_distance_; //!<
const coord_t offset_from_outlines_; //!< Offset from the boundary of a part to the comb path. (nozzle width / 2)
const coord_t max_moveInside_distance2_; //!< Maximal distance of a point to the Comb::boundary_inside which is still to be considered inside. (very sharp corners not allowed :S)
const coord_t offset_from_inside_to_outside_; //!< The sum of the offsets for the inside and outside boundary Comb::offset_from_outlines and Comb::offset_from_outlines_outside
const coord_t max_crossing_dist2_; //!< The maximal distance by which to cross the in_between area between inside and outside
static const coord_t max_moveOutside_distance2_ = std::numeric_limits<coord_t>::max(); //!< Any point which is not inside should be considered outside.
static constexpr coord_t offset_dist_to_get_from_on_the_polygon_to_outside_ = 40; //!< in order to prevent on-boundary vs crossing boundary confusions (precision thing)
static constexpr coord_t offset_extra_start_end_ = 100; //!< Distance to move start point and end point toward eachother to extra avoid collision with the boundaries.

Polygons boundary_inside_minimum_; //!< The boundary within which to comb. (Will be reordered by the partsView_inside_minimum)
Polygons boundary_inside_optimal_; //!< The boundary within which to comb. (Will be reordered by the partsView_inside_optimal)
const PartsView parts_view_inside_minimum_; //!< Structured indices onto boundary_inside_minimum which shows which polygons belong to which part.
const PartsView parts_view_inside_optimal_; //!< Structured indices onto boundary_inside_optimal which shows which polygons belong to which part.
std::unique_ptr<LocToLineGrid> inside_loc_to_line_minimum_; //!< The SparsePointGridInclusive mapping locations to line segments of the inner boundary.
std::unique_ptr<LocToLineGrid> inside_loc_to_line_optimal_; //!< The SparsePointGridInclusive mapping locations to line segments of the inner boundary.
std::unordered_map<size_t, Polygons> boundary_outside_; //!< The boundary outside of which to stay to avoid collision with other layer parts. This is a pointer cause we only compute it when we move outside the boundary (so not when there is only a single part in the layer)
std::unordered_map<size_t, Polygons> model_boundary_; //!< The boundary of the model itself
std::unordered_map<size_t, std::unique_ptr<LocToLineGrid>> outside_loc_to_line_; //!< The SparsePointGridInclusive mapping locations to line segments of the outside boundary.
std::unordered_map<size_t, std::unique_ptr<LocToLineGrid>> model_boundary_loc_to_line_; //!< The SparsePointGridInclusive mapping locations to line segments of the model boundary
coord_t move_inside_distance_; //!< When using comb_boundary_inside_minimum for combing it tries to move points inside by this amount after calculating the path to move it from the border a bit.

/*!
* Get the SparsePointGridInclusive mapping locations to line segments of the outside boundary. Calculate it when it hasn't been calculated yet.
Expand Down
Loading

0 comments on commit c56e755

Please sign in to comment.