Commit dea7a86a authored by Nicolas Mellado's avatar Nicolas Mellado

Extend demo to recently added primitive types (MeanPlane + MongePatch)

parent 77dfa975
......@@ -2,7 +2,7 @@
FittingManager::FittingManager(QObject *parent) :
QObject(parent),
_fitType(FittingManager::PLANE_COV),
_fitType(FittingManager::PLANE_MEAN),
_mesh(nullptr),
_neiApproximation(new Mesh()),
_scale(0.02),
......@@ -118,17 +118,31 @@ FittingManager::fitPrimitive(){
*it = f.project(*it);
switch(_fitType){
case PLANE_COV:
{
COMPUTE(PLANE_COV);
std::cout << "Normal vector: " << f.primitiveGradient(_evalPos).transpose() << std::endl;
std::cout << "Surface variation: " << f.surfaceVariation() << std::endl;
break;
}
case PLANE_MEAN:
{
COMPUTE(PLANE_MEAN);
std::cout << "Normal vector: " << f.primitiveGradient(_evalPos).transpose() << std::endl;
break;
}
case PLANE_COV:
{
COMPUTE(PLANE_COV);
std::cout << "Normal vector: " << f.primitiveGradient(_evalPos).transpose() << std::endl;
std::cout << "Surface variation: " << f.surfaceVariation() << std::endl;
break;
}
case MONGE_PATCH:
{
COMPUTE(MONGE_PATCH);
std::cout << "Mean Curvature: " << f.kMean() << std::endl;
break;
}
case SPHERE_ORIENTED:
{
COMPUTE(SPHERE_ORIENTED);
std::cout << "Normal vector: " << f.primitiveGradient(_evalPos).transpose() << std::endl;
std::cout << "Tau: " << f.tau() << std::endl;
std::cout << "Eta: " << f.eta().transpose() << std::endl;
std::cout << "Kappa: " << f.kappa() << std::endl;
......@@ -137,6 +151,7 @@ FittingManager::fitPrimitive(){
case SPHERE:
{
COMPUTE(SPHERE);
std::cout << "Normal vector: " << f.primitiveGradient(_evalPos).transpose() << std::endl;
std::cout << "Tau: " << f.tau() << std::endl;
std::cout << "Eta: " << f.eta().transpose() << std::endl;
std::cout << "Kappa: " << f.kappa() << std::endl;
......
......@@ -15,7 +15,9 @@ public:
//! Type of supported fit types, used to generate Baskets.
//! \warning Must be aligned with UI
enum FIT_TYPE {
PLANE_MEAN,
PLANE_COV,
MONGE_PATCH,
SPHERE_ORIENTED,
SPHERE,
UNSUPPORTED
......@@ -60,12 +62,24 @@ struct BasketMaker {
typedef Grenaille::DistWeightFunc<MyPoint,Grenaille::SmoothWeightKernel<MyPoint::Scalar> > WeightFunc;
};
template <>
struct BasketMaker<FittingManager::PLANE_MEAN>{
typedef Grenaille::DistWeightFunc<MyPoint,Grenaille::SmoothWeightKernel<MyPoint::Scalar> > WeightFunc;
typedef Grenaille::Basket<MyPoint,WeightFunc, Grenaille::MeanPlaneFit> Basket;
};
template <>
struct BasketMaker<FittingManager::PLANE_COV>{
typedef Grenaille::DistWeightFunc<MyPoint,Grenaille::SmoothWeightKernel<MyPoint::Scalar> > WeightFunc;
typedef Grenaille::Basket<MyPoint,WeightFunc, Grenaille::CovariancePlaneFit> Basket;
};
template <>
struct BasketMaker<FittingManager::MONGE_PATCH>{
typedef Grenaille::DistWeightFunc<MyPoint,Grenaille::SmoothWeightKernel<MyPoint::Scalar> > WeightFunc;
typedef Grenaille::Basket<MyPoint,WeightFunc, Grenaille::CovariancePlaneFit, Grenaille::MongePatch> Basket;
};
template <>
struct BasketMaker<FittingManager::SPHERE_ORIENTED>{
typedef Grenaille::DistWeightFunc<MyPoint,Grenaille::SmoothWeightKernel<MyPoint::Scalar> > WeightFunc;
......
......@@ -20,7 +20,7 @@
<x>0</x>
<y>0</y>
<width>800</width>
<height>25</height>
<height>22</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
......@@ -49,11 +49,21 @@
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="1">
<widget class="QComboBox" name="_paramBasketType">
<item>
<property name="text">
<string>Mean Plane</string>
</property>
</item>
<item>
<property name="text">
<string>Covariance Plane Fit</string>
</property>
</item>
<item>
<property name="text">
<string>Monge Patch</string>
</property>
</item>
<item>
<property name="text">
<string>Oriented Sphere Fit</string>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment