mirror of https://github.com/CGAL/cgal
added parameterization (no visualization yet)
This commit is contained in:
parent
22ebed4f8b
commit
33f63f15fe
|
|
@ -47,7 +47,8 @@ protected slots:
|
|||
void on_actionActivatePolyhedron_triggered();
|
||||
void on_actionSetPolyhedronA_triggered();
|
||||
void on_actionSetPolyhedronB_triggered();
|
||||
void on_actionInsideOut_triggered();
|
||||
void on_actionInsideOut_triggered();
|
||||
void on_actionMVC_triggered();
|
||||
|
||||
// save
|
||||
// TODO: save all, save current (do we store the current file name?)
|
||||
|
|
|
|||
|
|
@ -183,12 +183,19 @@
|
|||
<addaction name="actionIntersection" />
|
||||
<addaction name="actionDifference" />
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuParameterization" >
|
||||
<property name="title" >
|
||||
<string>Parameterization</string>
|
||||
</property>
|
||||
<addaction name="actionMVC" />
|
||||
</widget>
|
||||
<addaction name="actionConvexHull" />
|
||||
<addaction name="actionKernel" />
|
||||
<addaction name="menuSubdivision" />
|
||||
<addaction name="actionSimplify" />
|
||||
<addaction name="actionRemeshing" />
|
||||
<addaction name="menu_Boolean_operations" />
|
||||
<addaction name="menuParameterization" />
|
||||
<addaction name="actionInsideOut" />
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuView" >
|
||||
|
|
@ -523,6 +530,11 @@
|
|||
<string>Remeshing</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionMVC" >
|
||||
<property name="text" >
|
||||
<string>Mean value coordinates</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
#include <QApplication>
|
||||
#include <QTime>
|
||||
|
||||
#include "MainWindow.h"
|
||||
#include "Scene.h"
|
||||
#include "Polyhedron_type.h"
|
||||
|
||||
#include <CGAL/Parameterization_polyhedron_adaptor_3.h>
|
||||
#include <CGAL/parameterize.h>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
void MainWindow::on_actionMVC_triggered()
|
||||
{
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
|
||||
int index = getSelectedPolygonIndex();
|
||||
|
||||
// get active polyhedron
|
||||
Polyhedron* pMesh = scene->polyhedron(index);
|
||||
|
||||
// parameterize
|
||||
QTime time;
|
||||
time.start();
|
||||
typedef CGAL::Parameterization_polyhedron_adaptor_3<Polyhedron> Adaptor;
|
||||
typedef CGAL::Parameterizer_traits_3<Adaptor> Parameterizer;
|
||||
Adaptor adaptor(*pMesh);
|
||||
std::cerr << "Parameterize..." << std::endl;
|
||||
Parameterizer::Error_code err = CGAL::parameterize(adaptor);
|
||||
std::cout << "ok (" << time.elapsed() << " ms)" << std::endl;
|
||||
|
||||
QApplication::setOverrideCursor(Qt::ArrowCursor);
|
||||
}
|
||||
|
|
@ -54,4 +54,5 @@ int main(int argc, char **argv)
|
|||
# include "MainWindow_self_intersection.cpp"
|
||||
# include "MainWindow_simplify.cpp"
|
||||
# include "MainWindow_subdivision_methods.cpp"
|
||||
# include "MainWindow_parameterization.cpp"
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue