mirror of
https://git.mirrors.martin98.com/https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-16 02:41:30 +08:00

* 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.
40 lines
974 B
C++
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_ */
|