Skip to content

Commit

Permalink
Code cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
wawanbreton committed Apr 11, 2024
1 parent 60046cd commit 2116cae
Show file tree
Hide file tree
Showing 31 changed files with 171 additions and 272 deletions.
2 changes: 1 addition & 1 deletion include/PrimeTower.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class PrimeTower

Point2LL post_wipe_point_; //!< Location to post-wipe the unused nozzle off on

std::vector<ClosestPoint> prime_tower_start_locations_; //!< The differernt locations where to pre-wipe the active nozzle
std::vector<ClosestPointPolygon> prime_tower_start_locations_; //!< The differernt locations where to pre-wipe the active nozzle
const unsigned int number_of_prime_tower_start_locations_ = 21; //!< The required size of \ref PrimeTower::wipe_locations

MovesByExtruder prime_moves_; //!< For each extruder, the moves to be processed for actual priming.
Expand Down
7 changes: 1 addition & 6 deletions include/geometry/closed_lines_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ namespace cura
* \brief Convenience definition for a container that can hold only closed polylines. This makes it
* explicit what the lines actually represent.
*/
#warning Try with a using instead
class ClosedLinesSet : public LinesSet<ClosedPolyline>
{
public:
ClosedLinesSet() = default;
};
using ClosedLinesSet = LinesSet<ClosedPolyline>;

} // namespace cura

Expand Down
1 change: 0 additions & 1 deletion include/geometry/closed_polyline.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class ClosedPolyline : public Polyline
bool explicitely_closed_{ false };

public:
#warning try to set bool explicitely_closed as argument
ClosedPolyline() = default;

ClosedPolyline(const ClosedPolyline& other) = default;
Expand Down
3 changes: 1 addition & 2 deletions include/geometry/lines_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,7 @@ class LinesSet
/*!
* Add a simple line consisting of two points
*/
#warning rename to addSegment and move to mixed
void addLine(const Point2LL& from, const Point2LL& to);
void addSegment(const Point2LL& from, const Point2LL& to);

coord_t length() const;

Expand Down
11 changes: 0 additions & 11 deletions include/geometry/open_lines_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,6 @@ namespace cura
* explicit what the lines actually represent.
*/
using OpenLinesSet = LinesSet<OpenPolyline>;
#warning Try with a using instead
/*class OpenLinesSet : public LinesSet<OpenPolyline>
{
public:
OpenLinesSet() = default;
OpenLinesSet(const LinesSet<OpenPolyline>& other)
: LinesSet(other)
{
}
};*/

} // namespace cura

Expand Down
33 changes: 0 additions & 33 deletions include/geometry/points_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,6 @@ class Point3Matrix;
const static int clipper_init = (0);
#define NO_INDEX (std::numeric_limits<size_t>::max())

#warning Move this somewhere else, or remove it...
template<typename T>
bool shorterThan(const T& shape, const coord_t check_length)
{
const auto* p0 = &shape.back();
int64_t length = 0;
for (const auto& p1 : shape)
{
length += vSize(*p0 - p1);
if (length >= check_length)
{
return false;
}
p0 = &p1;
}
return true;
}

/*!
* \brief Base class for all geometry containers representing a set of points.
*/
Expand All @@ -55,12 +37,6 @@ class PointsSet

PointsSet(ClipperLib::Path&& points);

/*PointsSet& operator=(const PointsSet& other)
{
std::vector<point_t>::operator=(other);
return *this;
}*/

const std::vector<Point2LL>& getPoints() const
{
return points_;
Expand Down Expand Up @@ -207,15 +183,6 @@ class PointsSet

PointsSet& operator=(PointsSet&& other) = default;

#warning seems to be unused
Point2LL min() const;

#warning seems to be unused
Point2LL max() const;

#warning seems to be unused
Point2LL closestPointTo(const Point2LL& p) const;

/*!
* Translate all the points in some direction.
*
Expand Down
7 changes: 0 additions & 7 deletions include/geometry/shape.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class Shape : public LinesSet<Polygon>

Shape difference(const Shape& other) const;

#warning rename this to union
Shape unionPolygons(const Shape& other, ClipperLib::PolyFillType fill_type = ClipperLib::pftNonZero) const;

/*!
Expand All @@ -85,12 +84,6 @@ class Shape : public LinesSet<Polygon>
#warning Technically this should return a MixedLinesSet
LinesSet<OpenPolyline> intersection(const LinesSet<LineType>& polylines, bool restitch = true, const coord_t max_stitch_distance = 10_mu) const;

/*!
* Add the front to each polygon so that the polygon is represented as a polyline
*/
#warning This could probably be removed
void toPolylines();

/*!
* Split this poly line object into several line segment objects
* and store them in the \p result
Expand Down
2 changes: 1 addition & 1 deletion include/infill/LightningLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ using SparseLightningTreeNodeGrid = SparsePointGridInclusive<std::weak_ptr<Light
struct GroundingLocation
{
LightningTreeNodeSPtr tree_node; //!< not null if the gounding location is on a tree
std::optional<ClosestPoint> boundary_location; //!< in case the gounding location is on the boundary
std::optional<ClosestPointPolygon> boundary_location; //!< in case the gounding location is on the boundary
Point2LL p() const;
};

Expand Down
2 changes: 1 addition & 1 deletion include/pathPlanning/Comb.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class Comb
* \param comber[in] The combing calculator which has references to the offsets and boundaries to use in combing.
* \return A pair of which the first is the crossing point on the inside boundary and the second the crossing point on the outside boundary
*/
std::shared_ptr<std::pair<ClosestPoint, ClosestPoint>>
std::shared_ptr<std::pair<ClosestPointPolygon, ClosestPointPolygon>>
findBestCrossing(const ExtruderTrain& train, const Shape& outside, const Polygon& from, const Point2LL estimated_start, const Point2LL estimated_end, Comb& comber);
};

Expand Down
2 changes: 2 additions & 0 deletions include/utils/ExtrusionLine.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ struct ExtrusionLine
* Get the minimal width of this path
*/
coord_t getMinimalWidth() const;

bool shorterThan(const coord_t check_length) const;
};

using VariableWidthLines = std::vector<ExtrusionLine>; //<! The ExtrusionLines generated by libArachne
Expand Down
Loading

0 comments on commit 2116cae

Please sign in to comment.