diff --git a/Common/Context.cpp b/Common/Context.cpp index 8cda494708024c63634d9af3428723a2d5ca316b..1284cc7b6e37ba47b331bc2d37493da551f5d37d 100644 --- a/Common/Context.cpp +++ b/Common/Context.cpp @@ -15,9 +15,8 @@ CTX::CTX() { - // Initialize everything that has no default value in + // initialize everything that has no default value in // DefaultOptions.h - short int word = 0x0001; char *byte = (char*)&word; bigEndian = (byte[0] ? 0 : 1); @@ -53,9 +52,9 @@ CTX::CTX() geom.draw = 1; mesh.draw = 1; post.draw = 1; - lock = 0; // very primitive locking - mesh.changed = 0; post.combineTime = 0; // try to combineTime views at startup + lock = 0; // very primitive locking + #if defined(HAVE_FLTK) glFontEnum = FL_HELVETICA; #else @@ -67,6 +66,24 @@ CTX::CTX() deltaFontSize = 0; recentFiles.resize(5); mesh.optimizeLloyd = 0; + + // need to initialize these too, since the corresponding opt_XXX + // routine uses the current value to set "mesh.changed" + mesh.changed = 0; + mesh.qualityInf = mesh.qualitySup = mesh.qualityType = 0; + mesh.radiusInf = mesh.radiusSup = 0; + mesh.lines = mesh.triangles = mesh.tetrahedra = mesh.quadrangles = 0; + mesh.prisms = mesh.pyramids = mesh.hexahedra = 0; + mesh.volumesEdges = mesh.volumesFaces = mesh.surfacesEdges = mesh.surfacesFaces = 0; + mesh.volumesFaces = mesh.surfacesEdges = mesh.surfacesFaces = 0; + mesh.smoothInternalEdges = mesh.smoothNormals = mesh.reverseAllNormals = 0; + mesh.explode = mesh.angleSmoothNormals = 0; + mesh.colorCarousel = 0; + color.mesh.tangents = color.mesh.tetrahedron = color.mesh.triangle = 0; + color.mesh.prism = color.mesh.pyramid = color.mesh.hexahedron = 0; + color.mesh.tangents = color.mesh.line = color.mesh.quadrangle = 0; + for (int i = 0; i < 20; i++) + color.mesh.carousel[i] = 0; } CTX *CTX::_instance = 0; diff --git a/Common/Options.cpp b/Common/Options.cpp index 82435f710a38c438f12359e48564fa4a98aa9db4..ebbd34799167aee012b836bea46238bde3ef67c2 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -5501,8 +5501,6 @@ double opt_mesh_aniso_max(OPT_ARGS_NUM) return CTX::instance()->mesh.anisoMax; } - - double opt_mesh_angle_smooth_normals(OPT_ARGS_NUM) { if(action & GMSH_SET) {