From 7e92021f3d5dd7146ab1477fb92d40797d41dcab Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Wed, 23 Jan 2002 16:28:00 +0000
Subject: [PATCH] Fix random initial highlight if Draw() before end of
 OpenFile()

---
 Mesh/Create.cpp     | 11 ++++++++++-
 Parser/OpenFile.cpp |  8 ++++----
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/Mesh/Create.cpp b/Mesh/Create.cpp
index 323936de73..ed9a1ab9c4 100644
--- a/Mesh/Create.cpp
+++ b/Mesh/Create.cpp
@@ -1,4 +1,4 @@
-// $Id: Create.cpp,v 1.32 2001-12-04 12:06:49 geuzaine Exp $
+// $Id: Create.cpp,v 1.33 2002-01-23 16:28:00 geuzaine Exp $
 
 #include "Gmsh.h"
 #include "Numeric.h"
@@ -422,6 +422,11 @@ Curve *Create_Curve (int Num, int Typ, int Order, List_T * Liste,
   pC->Circle.n[0] = 0.0;
   pC->Circle.n[1] = 0.0;
   pC->Circle.n[2] = 1.0;
+  for(i=0;i<4;i++){
+    pC->ipar[i] = 0;
+    pC->dpar[i] = 0.0;
+  }
+
   if (Typ == MSH_SEGM_SPLN){
     for (i = 0; i < 4; i++)
       for (j = 0; j < 4; j++)
@@ -516,6 +521,7 @@ void Free_Curve(void *a, void *b){
 
 Surface * Create_Surface (int Num, int Typ){
   Surface *pS;
+  int i;
 
   pS = (Surface *) Malloc (sizeof (Surface));
   pS->Dirty = 0;
@@ -524,6 +530,7 @@ Surface * Create_Surface (int Num, int Typ){
   THEM->MaxSurfaceNum = IMAX(THEM->MaxSurfaceNum,Num);
   pS->Typ = Typ;
   pS->Method = LIBRE;
+  for(i=0;i<5;i++) pS->ipar[i] = 0;
   pS->Recombine = 0;
   pS->RecombineAngle = 30;
   pS->Simplexes = Tree_Create (sizeof (Simplex *), compareQuality);
@@ -563,6 +570,7 @@ void Free_Surface(void *a, void *b){
 
 Volume * Create_Volume (int Num, int Typ){
   Volume *pV;
+  int i;
 
   pV = (Volume *) Malloc (sizeof (Volume));
   pV->Dirty = 0;
@@ -571,6 +579,7 @@ Volume * Create_Volume (int Num, int Typ){
   THEM->MaxVolumeNum = IMAX(THEM->MaxVolumeNum,Num);
   pV->Typ = Typ;
   pV->Method = LIBRE;
+  for(i=0;i<8;i++) pV->ipar[i] = 0;
   pV->Surfaces = List_Create (1, 2, sizeof (Surface *));
   pV->Simplexes = Tree_Create (sizeof (Simplex *), compareQuality);
   pV->Vertices = Tree_Create (sizeof (Vertex *), compareVertex);
diff --git a/Parser/OpenFile.cpp b/Parser/OpenFile.cpp
index 458992efbc..be8469b8c1 100644
--- a/Parser/OpenFile.cpp
+++ b/Parser/OpenFile.cpp
@@ -1,4 +1,4 @@
-// $Id: OpenFile.cpp,v 1.26 2001-12-06 10:10:42 geuzaine Exp $
+// $Id: OpenFile.cpp,v 1.27 2002-01-23 16:28:00 geuzaine Exp $
 
 #include "Gmsh.h"
 #include "Numeric.h"
@@ -88,7 +88,6 @@ void ParseString(char *str){
 
 void MergeProblem(char *name){
   ParseFile(name,0);  
-  if (yyerrorstate) return;
 }
 
 void OpenProblem(char *name){
@@ -143,11 +142,12 @@ void OpenProblem(char *name){
     Maillage_Dimension_0(&M);
   }
 
-#ifndef _BLACKBOX
-  ZeroHighlight(&M); 
 #if _FLTK
   if(!CTX.batch) WID->reset_visibility();
 #endif
+
+#ifndef _BLACKBOX
+  ZeroHighlight(&M); 
 #endif
   
   if(List_Nbr(CTX.post.list) > nb)
-- 
GitLab