From 8db81dc29cb9f70c50f345c78fe7353662d849d8 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Sat, 25 Nov 2006 03:30:03 +0000
Subject: [PATCH] bidi db: phase 2 -- continued

---
 Mesh/Create.cpp     | 47 +--------------------------------------------
 Mesh/Generator.cpp  |  8 +-------
 Mesh/Mesh.h         | 23 ----------------------
 Parser/Gmsh.tab.cpp |  4 ++--
 Parser/Gmsh.y       |  4 ++--
 Parser/Gmsh.yy.cpp  |  4 ++--
 6 files changed, 8 insertions(+), 82 deletions(-)

diff --git a/Mesh/Create.cpp b/Mesh/Create.cpp
index 4f8c90826a..d09e9f5a6a 100644
--- a/Mesh/Create.cpp
+++ b/Mesh/Create.cpp
@@ -1,4 +1,4 @@
-// $Id: Create.cpp,v 1.87 2006-11-25 02:47:39 geuzaine Exp $
+// $Id: Create.cpp,v 1.88 2006-11-25 03:30:03 geuzaine Exp $
 //
 // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
 //
@@ -95,22 +95,6 @@ int comparePhysicalGroup(const void *a, const void *b)
     return (q->Num - w->Num);
 }
 
-int compareMeshPartitionNum(const void *a, const void *b)
-{
-  MeshPartition *q, *w;
-  q = *(MeshPartition **) a;
-  w = *(MeshPartition **) b;
-  return (q->Num - w->Num);
-}
-
-int compareMeshPartitionIndex(const void *a, const void *b)
-{
-  MeshPartition *q, *w;
-  q = *(MeshPartition **) a;
-  w = *(MeshPartition **) b;
-  return (q->Index - w->Index);
-}
-
 PhysicalGroup *Create_PhysicalGroup(int Num, int typ, List_T * intlist)
 {
   PhysicalGroup *p = (PhysicalGroup *) Malloc(sizeof(PhysicalGroup));
@@ -137,33 +121,6 @@ void Free_PhysicalGroup(void *a, void *b)
   }
 }
 
-int Add_MeshPartition(int Num, Mesh * M)
-{
-  MeshPartition P, *p, **pp;
-  p = &P;
-  p->Num = Num;
-  if((pp = (MeshPartition**)List_PQuery(M->Partitions, &p, compareMeshPartitionNum))){
-    return (*pp)->Index;
-  }
-  else{
-    p = (MeshPartition*)Malloc(sizeof(MeshPartition));
-    p->Num = Num;
-    p->Visible = 1;
-    p->Index = List_Nbr(M->Partitions);
-    List_Add(M->Partitions, &p);
-    return p->Index;
-  }
-}
-
-void Free_MeshPartition(void *a, void *b)
-{
-  MeshPartition *p = *(MeshPartition **) a;
-  if(p) {
-    Free(p);
-    p = NULL;
-  }
-}
-
 EdgeLoop *Create_EdgeLoop(int Num, List_T * intlist)
 {
   EdgeLoop *l = (EdgeLoop *) Malloc(sizeof(EdgeLoop));
@@ -586,7 +543,6 @@ Surface *Create_Surface(int Num, int Typ)
   pS->RecombineAngle = 75;
   pS->TrsfPoints = List_Create(4, 4, sizeof(Vertex *));
   pS->Vertices = Tree_Create(sizeof(Vertex *), compareVertex);
-  pS->TrsfVertices = List_Create(1, 10, sizeof(Vertex *));
   pS->Contours = List_Create(1, 1, sizeof(List_T *));
   pS->Orientations = List_Create(20, 2, sizeof(Vertex));
   pS->Support = pS;
@@ -604,7 +560,6 @@ void Free_Surface(void *a, void *b)
   if(pS) {
     List_Delete(pS->TrsfPoints);
     Tree_Delete(pS->Vertices);
-    List_Delete(pS->TrsfVertices);
     List_Delete(pS->Contours);
     List_Delete(pS->Orientations);
     List_Delete(pS->Control_Points);
diff --git a/Mesh/Generator.cpp b/Mesh/Generator.cpp
index db04474e1e..75a6ec9141 100644
--- a/Mesh/Generator.cpp
+++ b/Mesh/Generator.cpp
@@ -1,4 +1,4 @@
-// $Id: Generator.cpp,v 1.99 2006-11-25 02:47:40 geuzaine Exp $
+// $Id: Generator.cpp,v 1.100 2006-11-25 03:30:03 geuzaine Exp $
 //
 // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
 //
@@ -262,7 +262,6 @@ void Init_Mesh0()
   THEM->Surfaces = NULL;
   THEM->Volumes = NULL;
   THEM->PhysicalGroups = NULL;
-  THEM->Partitions = NULL;
 }
 
 void Init_Mesh()
@@ -299,9 +298,6 @@ void Init_Mesh()
   List_Action(THEM->PhysicalGroups, Free_PhysicalGroup);
   List_Delete(THEM->PhysicalGroups);
 
-  List_Action(THEM->Partitions, Free_MeshPartition);
-  List_Delete(THEM->Partitions);
-
   THEM->Vertices = Tree_Create(sizeof(Vertex *), compareVertex);
   THEM->Points = Tree_Create(sizeof(Vertex *), compareVertex);
   THEM->Curves = Tree_Create(sizeof(Curve *), compareCurve);
@@ -310,8 +306,6 @@ void Init_Mesh()
   THEM->Surfaces = Tree_Create(sizeof(Surface *), compareSurface);
   THEM->Volumes = Tree_Create(sizeof(Volume *), compareVolume);
   THEM->PhysicalGroups = List_Create(5, 5, sizeof(PhysicalGroup *));
-  THEM->Partitions = List_Create(5, 5, sizeof(MeshPartition *));
-  THEM->status = 0;
 
   CTX.mesh.bgmesh_type = WITHPOINTS;
   CTX.mesh.changed = ENT_ALL;
diff --git a/Mesh/Mesh.h b/Mesh/Mesh.h
index 049ce33bc4..139215b7b6 100644
--- a/Mesh/Mesh.h
+++ b/Mesh/Mesh.h
@@ -26,8 +26,6 @@
 #include "Vertex.h"
 #include "ExtrudeParams.h"
 
-class BDS_Mesh;
-
 typedef struct _POINT PointRecord, *PointPeek;
 typedef struct _CONTOUR ContourRecord, *ContourPeek;
 typedef struct _DOC DocRecord, *DocPeek;
@@ -124,14 +122,6 @@ struct _MAILLAGE{
   int zone;
 };
 
-typedef struct{
-  double zaxis[3];
-  double radius1;
-  double radius2;
-  double xaxis[3];
-  double center[3];
-}CylParam;
-
 class DrawingColor{
  public:
   int type;
@@ -159,11 +149,9 @@ struct _Surf{
   List_T *Orientations;
   List_T *Contours;
   Tree_T *Vertices;
-  List_T *TrsfVertices;
   int OrderU, OrderV;
   float *ku, *kv, *cp;
   struct _Surf *Support;
-  CylParam Cyl;
   ExtrudeParams *Extrude;
   DrawingColor Color;
 };
@@ -187,12 +175,6 @@ typedef struct{
   List_T *Entities;
 }PhysicalGroup;
 
-typedef struct{
-  int Index;
-  int Num;
-  char Visible;
-}MeshPartition;
-
 typedef struct {
   int Num;
   int Typ;
@@ -238,8 +220,6 @@ typedef struct{
 }Curve;
 
 struct _Mesh{
-  char name[256];
-  int status; // current state of the mesh
   Tree_T *Points;
   Tree_T *Vertices;
   Tree_T *Curves;
@@ -248,9 +228,6 @@ struct _Mesh{
   Tree_T *SurfaceLoops;
   Tree_T *EdgeLoops;
   List_T *PhysicalGroups;
-  List_T *Partitions;
-  BDS_Mesh *bds;
-  BDS_Mesh *bds_mesh;
   int MaxPointNum, MaxLineNum, MaxLineLoopNum, MaxSurfaceNum;
   int MaxSurfaceLoopNum, MaxVolumeNum, MaxPhysicalNum;
 };
diff --git a/Parser/Gmsh.tab.cpp b/Parser/Gmsh.tab.cpp
index 08ab5734f0..f8c2295b93 100644
--- a/Parser/Gmsh.tab.cpp
+++ b/Parser/Gmsh.tab.cpp
@@ -126,7 +126,7 @@
 
 #line 1 "Gmsh.y"
 
-// $Id: Gmsh.tab.cpp,v 1.277 2006-11-25 02:47:40 geuzaine Exp $
+// $Id: Gmsh.tab.cpp,v 1.278 2006-11-25 03:30:03 geuzaine Exp $
 //
 // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
 //
@@ -4659,7 +4659,7 @@ case 136:
 	yymsg(GERROR, "Mesh directives are not (yet) allowed in scripts");
       }
       else if(!strcmp(yyvsp[-2].c, "Status")){
-	THEM->status = (int)yyvsp[-1].d;
+	yymsg(GERROR, "Mesh directives are not (yet) allowed in scripts");
       }
       else{
 	yymsg(GERROR, "Unknown command '%s'", yyvsp[-2].c);
diff --git a/Parser/Gmsh.y b/Parser/Gmsh.y
index 7fe8035770..93d98a74c9 100644
--- a/Parser/Gmsh.y
+++ b/Parser/Gmsh.y
@@ -1,5 +1,5 @@
 %{
-// $Id: Gmsh.y,v 1.237 2006-11-25 02:47:40 geuzaine Exp $
+// $Id: Gmsh.y,v 1.238 2006-11-25 03:30:03 geuzaine Exp $
 //
 // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
 //
@@ -1878,7 +1878,7 @@ Command :
 	yymsg(GERROR, "Mesh directives are not (yet) allowed in scripts");
       }
       else if(!strcmp($1, "Status")){
-	THEM->status = (int)$2;
+	yymsg(GERROR, "Mesh directives are not (yet) allowed in scripts");
       }
       else{
 	yymsg(GERROR, "Unknown command '%s'", $1);
diff --git a/Parser/Gmsh.yy.cpp b/Parser/Gmsh.yy.cpp
index fee711a380..ce26e1a7c1 100644
--- a/Parser/Gmsh.yy.cpp
+++ b/Parser/Gmsh.yy.cpp
@@ -2,7 +2,7 @@
 /* A lexical scanner generated by flex */
 
 /* Scanner skeleton version:
- * $Header: /cvsroot/gmsh/Parser/Gmsh.yy.cpp,v 1.276 2006-11-25 02:47:41 geuzaine Exp $
+ * $Header: /cvsroot/gmsh/Parser/Gmsh.yy.cpp,v 1.277 2006-11-25 03:30:03 geuzaine Exp $
  */
 
 #define FLEX_SCANNER
@@ -727,7 +727,7 @@ char *yytext;
 #line 1 "Gmsh.l"
 #define INITIAL 0
 #line 2 "Gmsh.l"
-// $Id: Gmsh.yy.cpp,v 1.276 2006-11-25 02:47:41 geuzaine Exp $
+// $Id: Gmsh.yy.cpp,v 1.277 2006-11-25 03:30:03 geuzaine Exp $
 //
 // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
 //
-- 
GitLab