OrcaSlicer/src/libslic3r/GCode/SmallAreaInfillFlowCompensator.hpp
Dima Buzdyk e6ed93f0c6
Fix -Wsubobject-linkage warning (#6243)
* Fix -Wsubobject-linkage warning

Having tk::spline header-only implementation included from
SmallAreaInfillFlowCompensator.hpp makes
SmallAreaInfillFlowCompensator::flowModel have separate (albeit the
same) implementation in each translation unit.

In order to fix this issue, SmallAreaInfillFlowCompensator::flowModel
converted to opaque 'pimpl'

* spline: remove anonymous namespace

Remove outer anonymous namespace from splice.h to make
forward declaration for tk::spline possible.
2024-08-04 10:48:24 +08:00

40 lines
974 B
C++

#ifndef slic3r_GCode_SmallAreaInfillFlowCompensator_hpp_
#define slic3r_GCode_SmallAreaInfillFlowCompensator_hpp_
#include "../libslic3r.h"
#include "../PrintConfig.hpp"
#include "../ExtrusionEntity.hpp"
#include <memory>
namespace tk {
class spline;
} // namespace tk
namespace Slic3r {
class SmallAreaInfillFlowCompensator
{
public:
SmallAreaInfillFlowCompensator() = delete;
explicit SmallAreaInfillFlowCompensator(const Slic3r::GCodeConfig& config);
~SmallAreaInfillFlowCompensator();
double modify_flow(const double line_length, const double dE, const ExtrusionRole role);
private:
// Model points
std::vector<double> eLengths;
std::vector<double> flowComps;
// TODO: Cubic Spline
std::unique_ptr<tk::spline> flowModel;
double flow_comp_model(const double line_length);
double max_modified_length() { return eLengths.back(); }
};
} // namespace Slic3r
#endif /* slic3r_GCode_SmallAreaInfillFlowCompensator_hpp_ */