Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions Lab/demo/Lab/Plugins/Mesh_3/Mesh_3_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class Mesh_3_plugin :
Q_PROPERTY(double edges_approx READ get_edges_approx WRITE set_edges_approx)
Q_PROPERTY(double facets_sizing READ get_facets_sizing WRITE set_facets_sizing)
Q_PROPERTY(double approx READ get_approx WRITE set_approx)
Q_PROPERTY(double facet_normal_angle READ get_facet_normal_angle WRITE set_facet_normal_angle)
Q_PROPERTY(double tets_sizing READ get_tets_sizing WRITE set_tets_sizing)
Q_PROPERTY(double tets_shape READ get_tets_shape WRITE set_tets_shape)
Q_PROPERTY(bool protect_features READ get_protect_features WRITE set_protect_features)
Expand Down Expand Up @@ -160,6 +161,7 @@ public Q_SLOTS:
void set_edges_approx(const double v) { edges_approx = v; };
void set_facets_sizing(const double v) { facets_sizing = v; };
void set_approx(const double v) { approx = v; };
void set_facet_normal_angle(const double v) { facet_normal_angle = v; };
void set_tets_sizing(const double v) { tets_sizing = v; };
void set_tets_shape(const double v) { tets_shape = v; };
void set_manifold_criterion(const bool v) { manifold_criterion = v; }
Expand All @@ -174,6 +176,7 @@ public Q_SLOTS:
double get_edges_approx() { return edges_approx; };
double get_facets_sizing() { return facets_sizing; };
double get_approx() { return approx; };
double get_facet_normal_angle() { return facet_normal_angle; };
double get_tets_sizing() { return tets_sizing; };
double get_tets_shape() { return tets_shape; };
bool get_manifold_criterion() { return manifold_criterion; };
Expand Down Expand Up @@ -253,6 +256,7 @@ public Q_SLOTS:
int sizing_decimals;
double approx;
int approx_decimals;
double facet_normal_angle;
double edges_sizing;
double edges_min_sizing;
double edges_approx;
Expand Down Expand Up @@ -486,6 +490,7 @@ void Mesh_3_plugin::set_defaults() {
facets_sizing = default_sizing;
facets_min_sizing = 0.1 * default_sizing;
angle = 25.;
facet_normal_angle = 90.;
//tetrahedra parameters
tets_sizing = default_sizing;
tets_min_sizing = 0.1 * default_sizing;
Expand Down Expand Up @@ -564,10 +569,11 @@ void Mesh_3_plugin::mesh_3(const Mesh_type mesh_type,
connect(ui.protect, SIGNAL(toggled(bool)), ui.noEdgeApprox, SLOT(setEnabled(bool)));

//triangle parameters
Setup_ui_row s5(ui.approxLabel, ui.approx, diag * 10e-7, diag, approx, {ui.noApprox});
Setup_ui_row s6(ui.sizingLabel, ui.facetSizing, diag * 10e-6, diag, facets_sizing, {ui.noFacetSizing});
Setup_ui_row s7(ui.sizingMinLabel, ui.facetMinSizing, diag * 10e-6, diag, facets_min_sizing, {ui.noFacetMinSizing});
Setup_ui_row s8(ui.angleLabel, ui.facetAngle, 0.0, 30.0, angle, {ui.noAngle});
Setup_ui_row s5( ui.approxLabel, ui.approx, diag * 10e-7, diag, approx, {ui.noApprox});
Setup_ui_row s6( ui.sizingLabel, ui.facetSizing, diag * 10e-6, diag, facets_sizing, {ui.noFacetSizing});
Setup_ui_row s7( ui.sizingMinLabel, ui.facetMinSizing, diag * 10e-6, diag, facets_min_sizing, {ui.noFacetMinSizing});
Setup_ui_row s8( ui.angleLabel, ui.facetAngle, 0.0, 30.0, angle, {ui.noAngle});
Setup_ui_row s8b(ui.facetNormalAngleLabel, ui.facetNormalAngle, 0.0, 180., facet_normal_angle,{ui.noFacetNormalAngle});

//tetrahedra parameters
Setup_ui_row s9(ui.tetSizingLabel, ui.tetSizing, diag * 10e-6, diag, tets_sizing, {ui.noTetSizing});
Expand Down Expand Up @@ -700,6 +706,7 @@ void Mesh_3_plugin::mesh_3(const Mesh_type mesh_type,
facets_sizing = !ui.noFacetSizing->isChecked() ? 0 : ui.facetSizing->value();
facets_min_sizing = !ui.noFacetMinSizing->isChecked() ? 0 : ui.facetMinSizing->value();
approx = !ui.noApprox->isChecked() ? 0 : ui.approx->value();
facet_normal_angle = !ui.noFacetNormalAngle->isChecked() ? 0 : ui.facetNormalAngle->value();
tets_shape = !ui.noTetShape->isChecked() ? 0 : ui.tetShape->value();
tets_sizing = !ui.noTetSizing->isChecked() ? 0 : ui.tetSizing->value();
tets_min_sizing = !ui.noTetMinSizing->isChecked() ? 0 : ui.tetMinSizing->value();
Expand Down Expand Up @@ -777,6 +784,7 @@ void Mesh_3_plugin::mesh_3(const Mesh_type mesh_type,
facets_sizing,
facets_min_sizing,
approx,
facet_normal_angle,
tets_sizing,
tets_min_sizing,
edges_sizing,
Expand All @@ -800,6 +808,7 @@ void Mesh_3_plugin::mesh_3(const Mesh_type mesh_type,
facets_sizing,
facets_min_sizing,
approx,
facet_normal_angle,
tets_sizing,
tets_min_sizing,
edges_sizing,
Expand Down Expand Up @@ -828,6 +837,7 @@ void Mesh_3_plugin::mesh_3(const Mesh_type mesh_type,
facets_sizing,
facets_min_sizing,
approx,
facet_normal_angle,
tets_sizing,
tets_min_sizing,
edges_sizing,
Expand Down Expand Up @@ -871,6 +881,7 @@ void Mesh_3_plugin::mesh_3(const Mesh_type mesh_type,
facets_sizing,
facets_min_sizing,
approx,
facet_normal_angle,
tets_sizing,
tets_min_sizing,
edges_sizing,
Expand Down
32 changes: 24 additions & 8 deletions Lab/demo/Lab/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Meshing_thread* cgal_code_mesh_3(QList<const SMesh*> pMeshes,
const double facet_sizing,
const double facet_min_sizing,
const double facet_approx,
const double facet_normal_angle,
const double tet_sizing,
const double tet_min_sizing,
const double edge_size,
Expand All @@ -48,7 +49,8 @@ Meshing_thread* cgal_code_mesh_3(QList<const SMesh*> pMeshes,
<< " edge min size bound: " << edge_min_size << std::endl
<< " edge distance bound: " << edge_distance << std::endl
<< " facets size bound: " << facet_sizing << std::endl
<< " approximation bound: " << facet_approx << std::endl;
<< " approximation bound: " << facet_approx << std::endl
<< " normal angle bound: " << facet_normal_angle << std::endl;
if (!surface_only)
std::cerr << " tetrahedra size bound: " << tet_sizing << std::endl;

Expand Down Expand Up @@ -99,13 +101,15 @@ Meshing_thread* cgal_code_mesh_3(QList<const SMesh*> pMeshes,
"<li>Edge min size bound: %3</li>"
"<li>Edge distance bound: %4</li>"
"<li>Facets size bound: %5</li>"
"<li>Approximation bound: %6</li>")
"<li>Approximation bound: %6</li>"
"<li>Normal angle bound: %7</li>")
.arg(facet_angle)
.arg(edge_size)
.arg(edge_min_size)
.arg(edge_distance)
.arg(facet_sizing)
.arg(facet_approx);
.arg(facet_approx)
.arg(facet_normal_angle);
if (!surface_only)
tooltip += QString("<li>Tetrahedra size bound: %1</li>" )
.arg(tet_sizing);
Expand All @@ -116,6 +120,7 @@ Meshing_thread* cgal_code_mesh_3(QList<const SMesh*> pMeshes,
param.facet_angle = facet_angle;
param.facet_sizing = facet_sizing;
param.facet_approx = facet_approx;
param.facet_normal_angle = facet_normal_angle;
param.tet_sizing = tet_sizing;
param.facet_min_sizing = facet_min_sizing;
param.tet_min_sizing = tet_min_sizing;
Expand Down Expand Up @@ -143,6 +148,7 @@ Meshing_thread* cgal_code_mesh_3(const QList<const SMesh*> pMeshes,
const double facet_sizing,
const double facet_min_sizing,
const double facet_approx,
const double facet_normal_angle,
const double tet_sizing,
const double tet_min_sizing,
const double edge_size,
Expand All @@ -163,7 +169,8 @@ Meshing_thread* cgal_code_mesh_3(const QList<const SMesh*> pMeshes,
<< " edge min size bound: " << edge_min_size << std::endl
<< " edge distance bound: " << edge_distance << std::endl
<< " facets size bound: " << facet_sizing << std::endl
<< " approximation bound: " << facet_approx << std::endl;
<< " approximation bound: " << facet_approx << std::endl
<< " normal angle bound: " << facet_normal_angle << std::endl;
if (!surface_only)
std::cerr << " tetrahedra size bound: " << tet_sizing << std::endl;

Expand Down Expand Up @@ -209,13 +216,15 @@ Meshing_thread* cgal_code_mesh_3(const QList<const SMesh*> pMeshes,
"<li>Edge min size bound :%3</li>"
"<li>Edge distance bound: %4</li>"
"<li>Facets size bound: %5</li>"
"<li>Approximation bound: %6</li>")
"<li>Approximation bound: %6</li>"
"<li>Normal angle bound: %7</li>")
.arg(facet_angle)
.arg(edge_size)
.arg(edge_min_size)
.arg(edge_distance)
.arg(facet_sizing)
.arg(facet_approx);
.arg(facet_approx)
.arg(facet_normal_angle);
if (!surface_only)
tooltip += QString("<li>Tetrahedra size bound: %1</li>")
.arg(tet_sizing);
Expand All @@ -226,6 +235,7 @@ Meshing_thread* cgal_code_mesh_3(const QList<const SMesh*> pMeshes,
param.facet_angle = facet_angle;
param.facet_sizing = facet_sizing;
param.facet_approx = facet_approx;
param.facet_normal_angle = facet_normal_angle;
param.tet_sizing = tet_sizing;
param.facet_min_sizing = facet_min_sizing;
param.tet_min_sizing = tet_min_sizing;
Expand Down Expand Up @@ -254,6 +264,7 @@ Meshing_thread* cgal_code_mesh_3(const Implicit_function_interface* pfunction,
const double facet_sizing,
const double facet_min_sizing,
const double facet_approx,
const double facet_normal_angle,
const double tet_sizing,
const double tet_min_sizing,
const double edge_size,
Expand Down Expand Up @@ -286,6 +297,7 @@ Meshing_thread* cgal_code_mesh_3(const Implicit_function_interface* pfunction,
param.facet_sizing = facet_sizing;
param.facet_min_sizing = facet_min_sizing;
param.facet_approx = facet_approx;
param.facet_normal_angle = facet_normal_angle;
param.tet_sizing = tet_sizing;
param.tet_min_sizing = tet_min_sizing;
param.tet_shape = tet_shape;
Expand Down Expand Up @@ -319,6 +331,7 @@ Meshing_thread* cgal_code_mesh_3(const Image* pImage,
const double facet_sizing,
const double facet_min_sizing,
const double facet_approx,
const double facet_normal_angle,
const double tet_sizing,
const double tet_min_sizing,
const double edge_size,
Expand Down Expand Up @@ -348,6 +361,7 @@ Meshing_thread* cgal_code_mesh_3(const Image* pImage,
param.facet_sizing = facet_sizing;
param.facet_min_sizing = facet_min_sizing;
param.facet_approx = facet_approx;
param.facet_normal_angle = facet_normal_angle;
param.tet_sizing = tet_sizing;
param.tet_min_sizing = tet_min_sizing;
param.facet_min_sizing = facet_min_sizing;
Expand All @@ -368,13 +382,15 @@ Meshing_thread* cgal_code_mesh_3(const Image* pImage,
"<li>Edge min size bound: %3</li>"
"<li>Edge distance bound: %4</li>"
"<li>Facets size bound: %5</li>"
"<li>Approximation bound: %6</li>")
"<li>Approximation bound: %6</li>"
"<li>Normal angle bound: %7</li>")
.arg(facet_angle)
.arg(edge_size)
.arg(edge_min_size)
.arg(edge_distance)
.arg(facet_sizing)
.arg(facet_approx);
.arg(facet_approx)
.arg(facet_normal_angle);
if (!surface_only)
tooltip += QString("<li>Tetrahedra size bound: %1</li>")
.arg(tet_sizing);
Expand Down
4 changes: 4 additions & 0 deletions Lab/demo/Lab/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Meshing_thread* cgal_code_mesh_3(QList<const SMesh*> pMeshes,
const double facet_sizing,
const double facet_min_sizing,
const double facet_approx,
const double facet_normal_angle,
const double tet_sizing,
const double tet_min_sizing,
const double edge_size,
Expand All @@ -47,6 +48,7 @@ Meshing_thread* cgal_code_mesh_3(const QList<const SMesh*> pMeshes,
const double facet_sizing,
const double facet_min_sizing,
const double facet_approx,
const double facet_normal_angle,
const double tet_sizing,
const double tet_min_sizing,
const double edge_size,
Expand All @@ -65,6 +67,7 @@ Meshing_thread* cgal_code_mesh_3(const Implicit_function_interface* pfunction,
const double facet_sizing,
const double facet_min_sizing,
const double facet_approx,
const double facet_normal_angle,
const double tet_sizing,
const double tet_min_sizing,
const double edge_size,
Expand All @@ -82,6 +85,7 @@ Meshing_thread* cgal_code_mesh_3(const CGAL::Image_3* pImage,
const double facet_sizing,
const double facet_min_sizing,
const double facet_approx,
const double facet_normal_angle,
const double tet_sizing,
const double tet_min_sizing,
const double edge_size,
Expand Down
6 changes: 5 additions & 1 deletion Lab/demo/Lab/Plugins/Mesh_3/Mesh_function.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ struct Mesh_parameters
double facet_sizing;
double facet_min_sizing;
double facet_approx;
double facet_normal_angle;

double tet_shape;
double tet_sizing;
Expand Down Expand Up @@ -175,6 +176,8 @@ log() const
res << QString("facet min size: %1").arg(facet_min_sizing);
if(is_valid(facet_approx))
res << QString("facet approx error: %1").arg(facet_approx);
if(is_valid(facet_normal_angle))
res << QString("facet normal angle: %1").arg(facet_normal_angle);
if(is_valid(tet_shape))
res << QString("tet shape (radius-edge): %1").arg(tet_shape);
if(is_valid(tet_sizing))
Expand Down Expand Up @@ -394,7 +397,8 @@ launch()
p_.facet_sizing,
p_.facet_approx,
CGAL::FACET_VERTICES_ON_SURFACE,
p_.facet_min_sizing),
p_.facet_min_sizing,
p_.facet_normal_angle),
Cell_criteria(p_.tet_shape,
p_.tet_sizing,
p_.tet_min_sizing));
Expand Down
Loading
Loading