mirror of https://github.com/CGAL/cgal
Merge branch 'Surface_mesh_parametrisation-OpenNL_Eigen-GF-old' into Surface_mesh_parametrisation-OpenNL_Eigen-GF
This commit is contained in:
commit
6196c183c7
|
|
@ -37,7 +37,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>978</width>
|
||||
<height>21</height>
|
||||
<height>26</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuFile">
|
||||
|
|
@ -95,6 +95,7 @@
|
|||
</property>
|
||||
<addaction name="actionMVC"/>
|
||||
<addaction name="actionDCP"/>
|
||||
<addaction name="actionLSC"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuPCA">
|
||||
<property name="title">
|
||||
|
|
@ -652,6 +653,11 @@
|
|||
<string>&Preferences</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionLSC">
|
||||
<property name="text">
|
||||
<string>Least square conformal maps</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
#include <CGAL/Parameterization_polyhedron_adaptor_3.h>
|
||||
#include <CGAL/parameterize.h>
|
||||
#include <CGAL/Discrete_conformal_map_parameterizer_3.h>
|
||||
#include <CGAL/LSCM_parameterizer_3.h>
|
||||
#include <CGAL/Two_vertices_parameterizer_3.h>
|
||||
|
||||
#include <CGAL/Textured_polyhedron_builder.h>
|
||||
|
|
@ -35,7 +36,8 @@ public:
|
|||
// used by Polyhedron_demo_plugin_helper
|
||||
QStringList actionsNames() const {
|
||||
return QStringList() << "actionMVC"
|
||||
<< "actionDCP";
|
||||
<< "actionDCP"
|
||||
<< "actionLSC";
|
||||
}
|
||||
|
||||
bool applicable(QAction*) const {
|
||||
|
|
@ -45,9 +47,10 @@ public:
|
|||
public Q_SLOTS:
|
||||
void on_actionMVC_triggered();
|
||||
void on_actionDCP_triggered();
|
||||
void on_actionLSC_triggered();
|
||||
|
||||
protected:
|
||||
enum Parameterization_method { PARAM_MVC, PARAM_DCP };
|
||||
enum Parameterization_method { PARAM_MVC, PARAM_DCP, PARAM_LSC };
|
||||
void parameterize(Parameterization_method method);
|
||||
}; // end Polyhedron_demo_parameterization_plugin
|
||||
|
||||
|
|
@ -91,6 +94,13 @@ void Polyhedron_demo_parameterization_plugin::parameterize(const Parameterizatio
|
|||
typedef CGAL::Discrete_conformal_map_parameterizer_3<Adaptor> Parameterizer;
|
||||
Parameterizer::Error_code err = CGAL::parameterize(adaptor,Parameterizer());
|
||||
success = err == Parameterizer::OK;
|
||||
}
|
||||
case PARAM_LSC:
|
||||
{
|
||||
std::cout << "Parameterize (LSC)...";
|
||||
typedef CGAL::LSCM_parameterizer_3<Adaptor> Parameterizer;
|
||||
Parameterizer::Error_code err = CGAL::parameterize(adaptor,Parameterizer());
|
||||
success = err == Parameterizer::OK;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -146,4 +156,10 @@ void Polyhedron_demo_parameterization_plugin::on_actionDCP_triggered()
|
|||
parameterize(PARAM_DCP);
|
||||
}
|
||||
|
||||
void Polyhedron_demo_parameterization_plugin::on_actionLSC_triggered()
|
||||
{
|
||||
std::cerr << "LSC...";
|
||||
parameterize(PARAM_LSC);
|
||||
}
|
||||
|
||||
#include "Polyhedron_demo_parameterization_plugin.moc"
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
#include <CGAL/IO/Polyhedron_iostream.h>
|
||||
#include <CGAL/Parameterization_polyhedron_adaptor_3.h>
|
||||
#include <CGAL/parameterize.h>
|
||||
|
||||
#include <CGAL/Timer.h>
|
||||
#include <CGAL/Eigen_solver_traits.h>
|
||||
|
||||
#include <iostream>
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
typedef CGAL::Simple_cartesian<double> Kernel;
|
||||
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
|
||||
|
||||
typedef CGAL::Timer Timer;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// main()
|
||||
|
|
@ -65,7 +65,8 @@ int main(int argc, char * argv[])
|
|||
|
||||
typedef CGAL::Parameterization_polyhedron_adaptor_3<Polyhedron>
|
||||
Parameterization_polyhedron_adaptor;
|
||||
|
||||
Timer t;
|
||||
t.start();
|
||||
Parameterization_polyhedron_adaptor mesh_adaptor(mesh);
|
||||
|
||||
//***************************************
|
||||
|
|
@ -77,16 +78,17 @@ int main(int argc, char * argv[])
|
|||
typedef CGAL::Circular_border_arc_length_parameterizer_3<Parameterization_polyhedron_adaptor>
|
||||
Border_parameterizer;
|
||||
// Eigen solver
|
||||
typedef CGAL::Eigen_solver_traits<> Solver;
|
||||
typedef CGAL::Eigen_solver_traits<Eigen::BiCGSTAB<CGAL::Eigen_sparse_matrix<double>::EigenType, Eigen::IncompleteLUT< double > > > Solver;
|
||||
|
||||
// Floater Mean Value Coordinates parameterization
|
||||
// (circular border) with Eigen solver
|
||||
typedef CGAL::Mean_value_coordinates_parameterizer_3<Parameterization_polyhedron_adaptor,
|
||||
Border_parameterizer,
|
||||
Solver>
|
||||
Solver>
|
||||
Parameterizer;
|
||||
|
||||
Parameterizer::Error_code err = CGAL::parameterize(mesh_adaptor, Parameterizer());
|
||||
t.stop();
|
||||
|
||||
switch(err) {
|
||||
case Parameterizer::OK: // Success
|
||||
|
|
@ -119,6 +121,6 @@ int main(int argc, char * argv[])
|
|||
double v = mesh_adaptor.info(pVertex->halfedge())->uv().y();
|
||||
std::cout << "(u,v) = (" << u << "," << v << ")" << std::endl;
|
||||
}
|
||||
|
||||
std::cerr << t.time() << "sec." << std::endl;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue