diff --git a/src/drawingPasses/poncaFitField.h b/src/drawingPasses/poncaFitField.h index 1c7806c..8fa3471 100644 --- a/src/drawingPasses/poncaFitField.h +++ b/src/drawingPasses/poncaFitField.h @@ -18,6 +18,8 @@ struct FitField : public BaseFitField { using FitType = _FitType; using WeightFunc = typename FitType::WeightFunction; + /// Method called at the end of the fitting process, only for stable fits + virtual void postProcess(FitType& /*fit*/){}; void render(const DataManager::KdTree& points, float*buffer, int w, int h) override{ if(points.point_data().empty()) return; @@ -43,6 +45,7 @@ struct FitField : public BaseFitField { } if ( (b[2] = fit.isStable()) ){ + postProcess(fit); float dist = fit.potential({i,j}); if (std::abs(dist)> maxVal) maxVal = std::abs(dist); @@ -58,6 +61,13 @@ struct FitField : public BaseFitField { }; using PlaneFitField = FitField; -using SphereFitField = FitField; -using OrientedSphereFitField = FitField; -using UnorientedSphereFitField = FitField; + +struct SphereFitField : public FitField{ + void postProcess(typename FitField::FitType& fit) override { fit.applyPrattNorm(); }; +}; +struct OrientedSphereFitField : public FitField{ + void postProcess(typename FitField::FitType& fit) override { fit.applyPrattNorm(); }; +}; +struct UnorientedSphereFitField : public FitField{ + void postProcess(typename FitField::FitType& fit) override { fit.applyPrattNorm(); }; +};