Skip to content
Snippets Groups Projects
Commit afb141ea authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

Added experimental option to only mesh visible entities. (You can easily

shoot yourself in the foot with this: use with caution!)
parent f37ee975
No related branches found
No related tags found
No related merge requests found
...@@ -164,7 +164,7 @@ class Context_T { ...@@ -164,7 +164,7 @@ class Context_T {
int light, light_two_side, light_lines; int light, light_two_side, light_lines;
int format, nb_smoothing, algo2d, algo3d, algo_recombine; int format, nb_smoothing, algo2d, algo3d, algo_recombine;
int order, second_order_linear, second_order_incomplete; int order, second_order_linear, second_order_incomplete;
int second_order_experimental; int second_order_experimental, mesh_only_visible;
int smooth_internal_edges, c1_continuity; int smooth_internal_edges, c1_continuity;
int min_circ_points, min_curv_points; int min_circ_points, min_curv_points;
double normals, tangents, explode; double normals, tangents, explode;
......
...@@ -982,6 +982,8 @@ StringXNumber MeshOptions_Number[] = { ...@@ -982,6 +982,8 @@ StringXNumber MeshOptions_Number[] = {
{ F|O, "LineWidth" , opt_mesh_line_width , 1.0 , { F|O, "LineWidth" , opt_mesh_line_width , 1.0 ,
"Display width of mesh lines (in pixels)" }, "Display width of mesh lines (in pixels)" },
{ F|O, "MeshOnlyVisible" , opt_mesh_mesh_only_visible, 0. ,
"Mesh only visible entities" },
{ F|O, "MetisAlgorithm" , opt_mesh_partition_metis_algorithm, 1. , { F|O, "MetisAlgorithm" , opt_mesh_partition_metis_algorithm, 1. ,
"METIS partitioning algorithm (1=Recursive, 2=K-way)" }, "METIS partitioning algorithm (1=Recursive, 2=K-way)" },
{ F|O, "MetisEdgeMatching" , opt_mesh_partition_metis_edge_matching, 3. , { F|O, "MetisEdgeMatching" , opt_mesh_partition_metis_edge_matching, 3. ,
......
...@@ -5104,6 +5104,13 @@ double opt_mesh_algo3d(OPT_ARGS_NUM) ...@@ -5104,6 +5104,13 @@ double opt_mesh_algo3d(OPT_ARGS_NUM)
return CTX.mesh.algo3d; return CTX.mesh.algo3d;
} }
double opt_mesh_mesh_only_visible(OPT_ARGS_NUM)
{
if(action & GMSH_SET)
CTX.mesh.mesh_only_visible = (int)val;
return CTX.mesh.mesh_only_visible;
}
double opt_mesh_min_circ_points(OPT_ARGS_NUM) double opt_mesh_min_circ_points(OPT_ARGS_NUM)
{ {
if(action & GMSH_SET) if(action & GMSH_SET)
......
...@@ -475,6 +475,7 @@ double opt_mesh_nb_smoothing(OPT_ARGS_NUM); ...@@ -475,6 +475,7 @@ double opt_mesh_nb_smoothing(OPT_ARGS_NUM);
double opt_mesh_algo2d(OPT_ARGS_NUM); double opt_mesh_algo2d(OPT_ARGS_NUM);
double opt_mesh_algo3d(OPT_ARGS_NUM); double opt_mesh_algo3d(OPT_ARGS_NUM);
double opt_mesh_recombine_algo(OPT_ARGS_NUM); double opt_mesh_recombine_algo(OPT_ARGS_NUM);
double opt_mesh_mesh_only_visible(OPT_ARGS_NUM);
double opt_mesh_min_circ_points(OPT_ARGS_NUM); double opt_mesh_min_circ_points(OPT_ARGS_NUM);
double opt_mesh_allow_swap_edge_angle(OPT_ARGS_NUM); double opt_mesh_allow_swap_edge_angle(OPT_ARGS_NUM);
double opt_mesh_min_curv_points(OPT_ARGS_NUM); double opt_mesh_min_curv_points(OPT_ARGS_NUM);
......
...@@ -271,6 +271,7 @@ void meshGEdge::operator() (GEdge *ge) ...@@ -271,6 +271,7 @@ void meshGEdge::operator() (GEdge *ge)
if(ge->geomType() == GEntity::DiscreteCurve) return; if(ge->geomType() == GEntity::DiscreteCurve) return;
if(ge->geomType() == GEntity::BoundaryLayerCurve) return; if(ge->geomType() == GEntity::BoundaryLayerCurve) return;
if(ge->meshAttributes.Method == MESH_NONE) return; if(ge->meshAttributes.Method == MESH_NONE) return;
if(CTX.mesh.mesh_only_visible && !ge->getVisibility()) return;
deMeshGEdge dem; deMeshGEdge dem;
dem(ge); dem(ge);
......
...@@ -1297,6 +1297,7 @@ void meshGFace::operator() (GFace *gf) ...@@ -1297,6 +1297,7 @@ void meshGFace::operator() (GFace *gf)
if(gf->geomType() == GEntity::BoundaryLayerSurface) return; if(gf->geomType() == GEntity::BoundaryLayerSurface) return;
if(gf->geomType() == GEntity::ProjectionFace) return; if(gf->geomType() == GEntity::ProjectionFace) return;
if(gf->meshAttributes.Method == MESH_NONE) return; if(gf->meshAttributes.Method == MESH_NONE) return;
if(CTX.mesh.mesh_only_visible && !gf->getVisibility()) return;
// destroy the mesh if it exists // destroy the mesh if it exists
deMeshGFace dem; deMeshGFace dem;
......
...@@ -544,6 +544,7 @@ void meshGRegion::operator() (GRegion *gr) ...@@ -544,6 +544,7 @@ void meshGRegion::operator() (GRegion *gr)
if(gr->geomType() == GEntity::DiscreteVolume) return; if(gr->geomType() == GEntity::DiscreteVolume) return;
if(gr->meshAttributes.Method == MESH_NONE) return; if(gr->meshAttributes.Method == MESH_NONE) return;
if(CTX.mesh.mesh_only_visible && !gr->getVisibility()) return;
ExtrudeParams *ep = gr->meshAttributes.extrude; ExtrudeParams *ep = gr->meshAttributes.extrude;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment