diff --git a/Common/Context.h b/Common/Context.h index c14a3cbf5b76b1f2f4924345cf856589425b5cf9..115fc94b21d16136d2f48fa94188fd9764393e54 100644 --- a/Common/Context.h +++ b/Common/Context.h @@ -176,7 +176,7 @@ public : int quality_type, label_type; double quality_inf, quality_sup, radius_inf, radius_sup; double scaling_factor, lc_factor, rand_factor, lc_integration_precision; - int dual; + int dual, draw_skin_only; int light, light_two_side, light_lines; int format, nb_smoothing, algo2d, algo3d, algo_recombine; int order, second_order_linear, second_order_incomplete; diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index 0017ed793530052600c83cff07d943a5b15fe189..98165d62132653f4a18ff01d13a525f6aa64173c 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -917,6 +917,8 @@ StringXNumber MeshOptions_Number[] = { { F, "CutPlaneD" , opt_mesh_cut_planed , 0.0 , "Fourth cut plane equation coefficient (`D' in `AX+BY+CZ+D=0')" }, + { F|O, "DrawSkinOnly" , opt_mesh_draw_skin_only , 0. , + "Draw only the skin of 3D meshes?" }, { F|O, "Dual" , opt_mesh_dual , 0. , "Display the dual mesh obtained by barycentric subdivision" }, diff --git a/Common/Options.cpp b/Common/Options.cpp index ca50d51528bbee58f19e94da4c4a1de604068546..37405944c590abf255ccf28dbd3775e26950d9c1 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -1,4 +1,4 @@ -// $Id: Options.cpp,v 1.362 2007-09-24 08:14:28 geuzaine Exp $ +// $Id: Options.cpp,v 1.363 2007-10-02 20:07:29 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -4935,6 +4935,14 @@ double opt_mesh_dual(OPT_ARGS_NUM) return CTX.mesh.dual; } +double opt_mesh_draw_skin_only(OPT_ARGS_NUM) +{ + if(action & GMSH_SET) { + CTX.mesh.draw_skin_only = (int)val; + } + return CTX.mesh.draw_skin_only; +} + double opt_mesh_use_cut_plane(OPT_ARGS_NUM) { if(action & GMSH_SET){ diff --git a/Common/Options.h b/Common/Options.h index 63eedc0afe2bc1479e817740e711c7c361fce2f5..18ce4f9d1bd6e812de8a05f4446fc5f905022ab6 100644 --- a/Common/Options.h +++ b/Common/Options.h @@ -483,6 +483,7 @@ double opt_mesh_smooth_internal_edges(OPT_ARGS_NUM); double opt_mesh_second_order_linear(OPT_ARGS_NUM); double opt_mesh_second_order_incomplete(OPT_ARGS_NUM); double opt_mesh_dual(OPT_ARGS_NUM); +double opt_mesh_draw_skin_only(OPT_ARGS_NUM); double opt_mesh_use_cut_plane(OPT_ARGS_NUM); double opt_mesh_cut_plane_draw_intersect(OPT_ARGS_NUM); double opt_mesh_cut_plane_only_volume(OPT_ARGS_NUM); diff --git a/Graphics/Mesh.cpp b/Graphics/Mesh.cpp index 3c3f666ac88ec231775713e4ada77b79523c7b3c..f45ace2abf0b8304eb6f933647bac37cd666d123 100644 --- a/Graphics/Mesh.cpp +++ b/Graphics/Mesh.cpp @@ -1,4 +1,4 @@ -// $Id: Mesh.cpp,v 1.208 2007-09-22 20:35:18 geuzaine Exp $ +// $Id: Mesh.cpp,v 1.209 2007-10-02 20:07:29 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -417,6 +417,7 @@ static void addElementsInArrays(GEntity *e, std::vector<T*> &elements, if(faces){ bool unique = e->dim() > 2 && !CTX.pick_elements; + bool skin = e->dim() > 2 && CTX.mesh.draw_skin_only; for(int j = 0; j < ele->getNumFacesRep(); j++){ double x[3], y[3], z[3]; SVector3 n[3]; @@ -431,7 +432,7 @@ static void addElementsInArrays(GEntity *e, std::vector<T*> &elements, if(e->dim() == 2 && CTX.mesh.smooth_normals) for(int k = 0; k < 3; k++) e->model()->normals->get(x[k], y[k], z[k], n[k][0], n[k][1], n[k][2]); - e->va_triangles->add(x, y, z, n, col, ele, unique); + e->va_triangles->add(x, y, z, n, col, ele, unique, skin); } } }