From facd2d069f013623ba038742d7fadee5968f5a67 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Thu, 5 Apr 2007 12:51:28 +0000 Subject: [PATCH] made returning lateral entities in extrusions optional (since it can break backward compatibility when extruding multiple entities at once) --- Common/Context.h | 2 +- Common/DefaultOptions.h | 2 ++ Common/Options.cpp | 9 ++++++++- Common/Options.h | 3 ++- Geo/Geo.cpp | 38 +++++++++++++++++++---------------- doc/texinfo/opt_geometry.texi | 5 +++++ doc/texinfo/opt_view.texi | 16 +++++++-------- 7 files changed, 47 insertions(+), 28 deletions(-) diff --git a/Common/Context.h b/Common/Context.h index 531cb0fcf1..d9180ebb33 100644 --- a/Common/Context.h +++ b/Common/Context.h @@ -147,7 +147,7 @@ public : int point_type, line_type; // flat or 3D int draw, light; int old_circle, circle_points; - int extrude_spline_points, old_newreg; + int extrude_spline_points, extrude_return_lateral, old_newreg; double normals, tangents; double scaling_factor; int auto_coherence, highlight_orphans; diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index 69aa38998a..baa5a12815 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -792,6 +792,8 @@ StringXNumber GeometryOptions_Number[] = { { F|O, "CirclePoints" , opt_geometry_circle_points, 20. , "Number of points used to draw a circle/ellipse" }, + { F|O, "ExtrudeReturnLateralEntities" , opt_geometry_extrude_return_lateral, 1. , + "Add lateral entities in lists returned by extrusion commands?" }, { F|O, "ExtrudeSplinePoints" , opt_geometry_extrude_spline_points, 5. , "Number of control points for splines created during extrusion" }, diff --git a/Common/Options.cpp b/Common/Options.cpp index edc644fdee..632757f8cb 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -1,4 +1,4 @@ -// $Id: Options.cpp,v 1.338 2007-03-18 12:05:16 geuzaine Exp $ +// $Id: Options.cpp,v 1.339 2007-04-05 12:51:28 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -4083,6 +4083,13 @@ double opt_geometry_extrude_spline_points(OPT_ARGS_NUM) return CTX.geom.extrude_spline_points; } +double opt_geometry_extrude_return_lateral(OPT_ARGS_NUM) +{ + if(action & GMSH_SET) + CTX.geom.extrude_return_lateral = (int)val; + return CTX.geom.extrude_return_lateral; +} + double opt_geometry_scaling_factor(OPT_ARGS_NUM) { if(action & GMSH_SET) diff --git a/Common/Options.h b/Common/Options.h index 2ffe7e5811..21d6bce11b 100644 --- a/Common/Options.h +++ b/Common/Options.h @@ -401,7 +401,6 @@ double opt_geometry_point_size(OPT_ARGS_NUM); double opt_geometry_point_sel_size(OPT_ARGS_NUM); double opt_geometry_point_type(OPT_ARGS_NUM); double opt_geometry_line_width(OPT_ARGS_NUM); -double opt_mesh_label_frequency(OPT_ARGS_NUM); double opt_geometry_line_sel_width(OPT_ARGS_NUM); double opt_geometry_line_type(OPT_ARGS_NUM); double opt_geometry_light(OPT_ARGS_NUM); @@ -412,10 +411,12 @@ double opt_geometry_old_circle(OPT_ARGS_NUM); double opt_geometry_old_newreg(OPT_ARGS_NUM); double opt_geometry_circle_points(OPT_ARGS_NUM); double opt_geometry_extrude_spline_points(OPT_ARGS_NUM); +double opt_geometry_extrude_return_lateral(OPT_ARGS_NUM); double opt_geometry_scaling_factor(OPT_ARGS_NUM); double opt_geometry_snap0(OPT_ARGS_NUM); double opt_geometry_snap1(OPT_ARGS_NUM); double opt_geometry_snap2(OPT_ARGS_NUM); +double opt_mesh_label_frequency(OPT_ARGS_NUM); double opt_mesh_optimize(OPT_ARGS_NUM); double opt_mesh_normals(OPT_ARGS_NUM); double opt_mesh_tangents(OPT_ARGS_NUM); diff --git a/Geo/Geo.cpp b/Geo/Geo.cpp index bafe9c87ec..10c0cf590a 100644 --- a/Geo/Geo.cpp +++ b/Geo/Geo.cpp @@ -1,4 +1,4 @@ -// $Id: Geo.cpp,v 1.87 2007-03-23 08:44:41 geuzaine Exp $ +// $Id: Geo.cpp,v 1.88 2007-04-05 12:51:28 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -2391,14 +2391,16 @@ void ExtrudeShapes(int type, List_T *list_in, body.Num = ps->Num; body.Type = ps->Typ; List_Add(list_out, &body); - for(int j = 0; j < List_Nbr(ps->Generatrices); j++){ - Curve *c; - List_Read(ps->Generatrices, j, &c); - if(abs(c->Num) != shape.Num && abs(c->Num) != top.Num){ - Shape side; - side.Num = c->Num; - side.Type = c->Typ; - List_Add(list_out, &side); + if(CTX.geom.extrude_return_lateral){ + for(int j = 0; j < List_Nbr(ps->Generatrices); j++){ + Curve *c; + List_Read(ps->Generatrices, j, &c); + if(abs(c->Num) != shape.Num && abs(c->Num) != top.Num){ + Shape side; + side.Num = c->Num; + side.Type = c->Typ; + List_Add(list_out, &side); + } } } } @@ -2422,14 +2424,16 @@ void ExtrudeShapes(int type, List_T *list_in, body.Num = pv->Num; body.Type = pv->Typ; List_Add(list_out, &body); - for(int j = 0; j < List_Nbr(pv->Surfaces); j++){ - Surface *s; - List_Read(pv->Surfaces, j, &s); - if(abs(s->Num) != shape.Num && abs(s->Num) != top.Num){ - Shape side; - side.Num = s->Num; - side.Type = s->Typ; - List_Add(list_out, &side); + if(CTX.geom.extrude_return_lateral){ + for(int j = 0; j < List_Nbr(pv->Surfaces); j++){ + Surface *s; + List_Read(pv->Surfaces, j, &s); + if(abs(s->Num) != shape.Num && abs(s->Num) != top.Num){ + Shape side; + side.Num = s->Num; + side.Type = s->Typ; + List_Add(list_out, &side); + } } } } diff --git a/doc/texinfo/opt_geometry.texi b/doc/texinfo/opt_geometry.texi index 41a23cf3d6..39bdd864d5 100644 --- a/doc/texinfo/opt_geometry.texi +++ b/doc/texinfo/opt_geometry.texi @@ -14,6 +14,11 @@ Number of points used to draw a circle/ellipse@* Default value: @code{20}@* Saved in: @code{General.OptionsFileName} +@item Geometry.ExtrudeReturnLateralEntities +Add lateral entities in lists returned by extrusion commands?@* +Default value: @code{1}@* +Saved in: @code{General.OptionsFileName} + @item Geometry.ExtrudeSplinePoints Number of control points for splines created during extrusion@* Default value: @code{5}@* diff --git a/doc/texinfo/opt_view.texi b/doc/texinfo/opt_view.texi index 1ab71ff8f2..24ab0a3388 100644 --- a/doc/texinfo/opt_view.texi +++ b/doc/texinfo/opt_view.texi @@ -396,42 +396,42 @@ Saved in: @code{General.OptionsFileName} @item View.Max Maximum value in the view (read-only)@* -Default value: @code{-2.22195e-146}@* +Default value: @code{0}@* Saved in: @code{-} @item View.MaxX Maximum view coordinate along the X-axis (read-only)@* -Default value: @code{-2.22195e-146}@* +Default value: @code{0}@* Saved in: @code{-} @item View.MaxY Maximum view coordinate along the Y-axis (read-only)@* -Default value: @code{-2.22195e-146}@* +Default value: @code{0}@* Saved in: @code{-} @item View.MaxZ Maximum view coordinate along the Z-axis (read-only)@* -Default value: @code{-2.22195e-146}@* +Default value: @code{0}@* Saved in: @code{-} @item View.Min Minimum value in the view (read-only)@* -Default value: @code{-2.22195e-146}@* +Default value: @code{0}@* Saved in: @code{-} @item View.MinX Minimum view coordinate along the X-axis (read-only)@* -Default value: @code{-2.22195e-146}@* +Default value: @code{0}@* Saved in: @code{-} @item View.MinY Minimum view coordinate along the Y-axis (read-only)@* -Default value: @code{-2.22195e-146}@* +Default value: @code{0}@* Saved in: @code{-} @item View.MinZ Minimum view coordinate along the Z-axis (read-only)@* -Default value: @code{-2.22195e-146}@* +Default value: @code{0}@* Saved in: @code{-} @item View.NbIso -- GitLab