diff --git a/DataStr/gmshList.cpp b/Common/ListUtils.cpp similarity index 78% rename from DataStr/gmshList.cpp rename to Common/ListUtils.cpp index 40893953fc512974508b8767dcaa298a5e33cc14..9c940cd4d7e99a93fae65dcff6881bd201bf1613 100644 --- a/DataStr/gmshList.cpp +++ b/Common/ListUtils.cpp @@ -1,4 +1,4 @@ -// $Id: gmshList.cpp,v 1.1 2008-06-05 13:57:47 samtech Exp $ +// $Id: ListUtils.cpp,v 1.1 2008-06-07 17:20:44 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -26,14 +26,13 @@ #include <stdlib.h> #include <stdio.h> #include <string.h> +#include <errno.h> #include <sys/types.h> -#include "Malloc.h" -#include "gmshList.h" +#include "MallocUtils.h" +#include "ListUtils.h" +#include "TreeUtils.h" #include "Message.h" -#include "SafeIO.h" - -static char *startptr; List_T *List_Create(int n, int incr, int size) { @@ -97,32 +96,6 @@ int List_Nbr(List_T * liste) return (liste) ? liste->n : 0; } -void List_Insert(List_T * liste, void *data, - int (*fcmp) (const void *a, const void *b)) -{ - if(List_Search(liste, data, fcmp) == 0) - List_Add(liste, data); -} - -int List_Replace(List_T * liste, void *data, - int (*fcmp) (const void *a, const void *b)) -{ - void *ptr; - - if(liste->isorder != 1) - List_Sort(liste, fcmp); - liste->isorder = 1; - ptr = (void *)bsearch(data, liste->array, liste->n, liste->size, fcmp); - if(ptr == NULL) { - List_Add(liste, data); - return (0); - } - else { - memcpy(ptr, data, liste->size); - return (1); - } -} - void List_Read(List_T * liste, int index, void *data) { if((index < 0) || (index >= liste->n)) @@ -242,80 +215,6 @@ int List_ISearchSeq(List_T * liste, void *data, return i; } -int List_ISearchSeqPartial(List_T * liste, void *data, int i_Start, - int (*fcmp) (const void *a, const void *b)) -{ - int i; - - if(!liste) - return -1; - i = i_Start; - while((i < List_Nbr(liste)) && fcmp(data, (void *)List_Pointer(liste, i))) - i++; - if(i == List_Nbr(liste)) - i = -1; - return i; -} - -int List_Query(List_T * liste, void *data, - int (*fcmp) (const void *a, const void *b)) -{ - void *ptr; - - if(liste->isorder != 1) - List_Sort(liste, fcmp); - liste->isorder = 1; - ptr = (void *)bsearch(data, liste->array, liste->n, liste->size, fcmp); - if(ptr == NULL) - return (0); - - memcpy(data, ptr, liste->size); - return (1); -} - -static void *lolofind(void *data, void *array, int n, int size, - int (*fcmp) (const void *a, const void *b)) -{ - char *ptr; - int i; - - ptr = (char *)array; - for(i = 0; i < n; i++) { - if(fcmp(ptr, data) == 0) - break; - ptr += size; - } - if(i < n) - return (ptr); - return (NULL); -} - -int List_LQuery(List_T *liste, void *data, - int (*fcmp)(const void *a, const void *b), int first) -{ - char *ptr; - - if (first == 1) { - ptr = (char *) lolofind(data,liste->array,liste->n,liste->size,fcmp); - } - else { - if (startptr != NULL) - ptr = (char *) lolofind(data,startptr, - liste->n - (startptr-liste->array)/liste->size, - liste->size,fcmp); - else - return(0); - } - - if (ptr == NULL) return(0); - - startptr = ptr + liste->size; - if ( startptr >= ( liste->array + liste->n * liste->size)) - startptr = NULL; - memcpy(data,ptr,liste->size); - return (1); -} - void *List_PQuery(List_T * liste, void *data, int (*fcmp) (const void *a, const void *b)) { @@ -328,23 +227,6 @@ void *List_PQuery(List_T * liste, void *data, return (ptr); } -int List_Suppress(List_T * liste, void *data, - int (*fcmp) (const void *a, const void *b)) -{ - char *ptr; - int len; - - ptr = (char *)List_PQuery(liste, data, fcmp); - if(ptr == NULL) - return (0); - - liste->n--; - len = liste->n - (((long)ptr - (long)liste->array) / liste->size); - if(len > 0) - memmove(ptr, ptr + liste->size, len * liste->size); - return (1); -} - int List_PSuppress(List_T * liste, int index) { char *ptr; @@ -381,21 +263,8 @@ void List_Action(List_T * liste, void (*action) (void *data, void *dummy)) { int i, dummy; - for(i = 0; i < List_Nbr(liste); i++) { + for(i = 0; i < List_Nbr(liste); i++) (*action) (List_Pointer_NoChange(liste, i), &dummy); - } - -} - -void List_Action_Inverse(List_T * liste, - void (*action) (void *data, void *dummy)) -{ - int i, dummy; - - for(i = List_Nbr(liste); i > 0; i--) { - (*action) (List_Pointer_NoChange(liste, i - 1), &dummy); - } - } void List_Copy(List_T * a, List_T * b) @@ -512,6 +381,24 @@ List_T *List_CreateFromFile(int n, int incr, int size, FILE * file, int format, return liste; } +static int safe_fwrite(const void *ptr, size_t size, size_t nmemb, FILE * stream) +{ + size_t result = fwrite(ptr, size, nmemb, stream); + + if(result < nmemb) { + if(result >= 0) /* Partial write */ + Msg::Error("Disk full"); + else + Msg::Error(strerror(errno)); + if(fflush(stream) < 0) + Msg::Error("EOF reached"); + if(fclose(stream) < 0) + Msg::Error(strerror(errno)); + return 1; + } + return 0; +} + void List_WriteToFile(List_T * liste, FILE * file, int format) { int i, n; @@ -546,7 +433,7 @@ void List_WriteToFile(List_T * liste, FILE * file, int format) } } -// For backward compatibility purposes: +// For backward compatibility List_T *List_CreateFromFileOld(int n, int incr, int size, FILE * file, int format, int swap) @@ -623,3 +510,42 @@ List_T *List_CreateFromFileOld(int n, int incr, int size, FILE * file, int forma return liste; } + +// Comparison functions + +int fcmp_int(const void *a, const void *b) +{ + return (*(int *)a - *(int *)b); +} + +int fcmp_absint(const void *a, const void *b) +{ + return (abs(*(int *)a) - abs(*(int *)b)); +} + +int fcmp_double(const void *a, const void *b) +{ + double cmp; + + cmp = *(double *)a - *(double *)b; + if(cmp > 1.e-16) + return 1; + else if(cmp < -1.e-16) + return -1; + else + return 0; +} + +List_T *ListOfDouble2ListOfInt(List_T *dList) +{ + int n = List_Nbr(dList); + List_T *iList = List_Create(n, n, sizeof(int)); + for(int i = 0; i < n; i++){ + double d; + List_Read(dList, i, &d); + int j = (int)d; + List_Add(iList, &j); + } + return iList; +} + diff --git a/DataStr/gmshList.h b/Common/ListUtils.h similarity index 78% rename from DataStr/gmshList.h rename to Common/ListUtils.h index a352caa8d60541fb2f53b1c3d62c5d6b5c121815..dc76d954b4c4fd512f9891d9451bc1fa79ad2649 100644 --- a/DataStr/gmshList.h +++ b/Common/ListUtils.h @@ -1,5 +1,5 @@ -#ifndef _LIST_H_ -#define _LIST_H_ +#ifndef _LIST_UTILS_H_ +#define _LIST_UTILS_H_ // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -44,8 +44,6 @@ void List_Delete(List_T *liste); void List_Realloc(List_T *liste,int n); void List_Add(List_T *liste, void *data); int List_Nbr(List_T *liste); -void List_Insert(List_T *liste, void *data, int (*fcmp)(const void *a, const void *b)); -int List_Replace(List_T *liste, void *data, int (*fcmp)(const void *a, const void *b)); void List_Read(List_T *liste, int index, void *data); void List_Write(List_T *liste, int index, void *data); void List_Put(List_T *liste, int index, void *data); @@ -58,17 +56,11 @@ void List_Sort(List_T *liste, int (*fcmp)(const void *a, const void *b)); int List_Search(List_T *liste, void *data, int (*fcmp)(const void *a, const void *b)); int List_ISearch(List_T *liste, void *data, int (*fcmp)(const void *a, const void *b)); int List_ISearchSeq(List_T *liste, void * data, int (*fcmp)(const void *a, const void *b)); -int List_ISearchSeqPartial(List_T *liste, void * data, int i_Start, - int (*fcmp)(const void *a, const void *b)) ; -int List_Query(List_T *liste, void *data, int (*fcmp)(const void *a, const void *b)); -int List_LQuery(List_T *liste, void *data, int (*fcmp)(const void *a, const void *b), int first); void *List_PQuery(List_T *liste, void *data, int (*fcmp)(const void *a, const void *b)); -int List_Suppress(List_T *liste, void *data, int (*fcmp)(const void *a, const void *b)); int List_PSuppress(List_T *liste, int index); void List_Invert(List_T *a, List_T *b); void List_Reset(List_T *liste); void List_Action(List_T *liste, void (*action)(void *data, void *dummy)); -void List_Action_Inverse(List_T *liste, void (*action)(void *data, void *dummy)); void List_Copy(List_T *a , List_T *b); void List_Merge(List_T *a , List_T *b); List_T *List_CreateFromFile(int n, int incr, int size, FILE *file, int format, int swap); @@ -77,5 +69,11 @@ void List_WriteToFile(List_T *liste, FILE *file, int format); // for backward compatibility List_T *List_CreateFromFileOld(int n, int incr, int size, FILE *file, int format, int swap); +int fcmp_int(const void *a, const void *b); +int fcmp_absint(const void *a, const void *b); +int fcmp_double(const void *a, const void *b); + +List_T *ListOfDouble2ListOfInt(List_T *dList); + #endif diff --git a/Common/Makefile b/Common/Makefile index a23adf280e7215d112dad7ac230df20a378f861a..98d152ca0dbe1c14c85d7936dac763b145ad9ea3 100644 --- a/Common/Makefile +++ b/Common/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.176 2008-06-05 16:52:13 geuzaine Exp $ +# $Id: Makefile,v 1.177 2008-06-07 17:20:44 geuzaine Exp $ # # Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle # @@ -23,7 +23,7 @@ include ../variables LIB = ../lib/libGmshCommon${LIBEXT} -INC = ${DASH}I../Common ${DASH}I../DataStr ${DASH}I../Geo ${DASH}I../Mesh\ +INC = ${DASH}I../Common ${DASH}I../Geo ${DASH}I../Mesh\ ${DASH}I../Post ${DASH}I../Graphics ${DASH}I../Numeric ${DASH}I../Parser\ ${DASH}I../Plugin ${DASH}I../Fltk ${DASH}I../contrib/MathEval\ ${DASH}I../contrib/ANN/include @@ -42,6 +42,9 @@ SRC = Context.cpp\ VertexArray.cpp\ SmoothData.cpp\ StringUtils.cpp\ + ListUtils.cpp\ + TreeUtils.cpp\ + MallocUtils.cpp\ License.cpp OBJ = ${SRC:.cpp=${OBJEXT}} @@ -80,7 +83,7 @@ Options.o: Options.cpp GmshUI.h GmshDefines.h Message.h \ ../Mesh/Generator.h Context.h Options.h ../Post/ColorTable.h \ ../Mesh/BackgroundMesh.h ../Post/PView.h ../Post/PViewOptions.h \ ../Post/ColorTable.h ../Post/PViewData.h ../Post/adaptiveData.h \ - ../DataStr/gmshList.h ../Common/GmshMatrix.h ../Plugin/PluginManager.h \ + ../Common/ListUtils.h ../Common/GmshMatrix.h ../Plugin/PluginManager.h \ ../Plugin/Plugin.h ../Common/Options.h ../Common/Message.h \ ../Post/PViewDataList.h ../Post/PViewData.h ../Fltk/Solvers.h \ ../Fltk/GUI.h ../Fltk/Opengl_Window.h ../Fltk/Colorbar_Window.h \ @@ -89,8 +92,9 @@ Options.o: Options.cpp GmshUI.h GmshDefines.h Message.h \ ../Common/GmshDefines.h ../Geo/gmshSurface.h ../Geo/Pair.h \ ../Geo/Range.h ../Geo/SPoint2.h ../Geo/SPoint3.h ../Geo/SVector3.h \ ../Geo/SPoint3.h ../Geo/SBoundingBox3d.h ../Numeric/Numeric.h \ - ../Numeric/NumericEmbedded.h ../DataStr/Tree.h ../DataStr/avl.h \ - ../Geo/SPoint2.h ../Geo/ExtrudeParams.h ../Common/SmoothData.h + ../Numeric/NumericEmbedded.h ../Common/TreeUtils.h ../Common/avl.h \ + ../Common/ListUtils.h ../Geo/SPoint2.h ../Geo/ExtrudeParams.h \ + ../Common/SmoothData.h CommandLine.o: CommandLine.cpp GmshUI.h GmshDefines.h GmshVersion.h \ Message.h ../Parser/OpenFile.h CommandLine.h Context.h Options.h \ ../Post/ColorTable.h ../Geo/GModel.h ../Geo/GVertex.h ../Geo/GEntity.h \ @@ -109,11 +113,12 @@ Gmsh.o: Gmsh.cpp GmshDefines.h ../Geo/GModel.h ../Geo/GVertex.h \ ../Geo/GFace.h ../Geo/GEntity.h ../Geo/GPoint.h ../Geo/GEdgeLoop.h \ ../Geo/GEdge.h ../Geo/SPoint2.h ../Geo/SVector3.h ../Geo/Pair.h \ ../Geo/GRegion.h ../Geo/GEntity.h ../Geo/SBoundingBox3d.h Message.h \ - ../Parser/Parser.h ../DataStr/gmshList.h ../DataStr/Tree.h \ - ../DataStr/avl.h ../Parser/OpenFile.h ../Parser/CreateFile.h Options.h \ - ../Post/ColorTable.h CommandLine.h OS.h ../Numeric/Numeric.h \ - ../Numeric/NumericEmbedded.h ../Mesh/Generator.h ../Mesh/Field.h \ - ../Geo/Geo.h ../Common/GmshDefines.h ../Geo/gmshSurface.h ../Geo/Pair.h \ + ../Parser/Parser.h ../Common/ListUtils.h ../Common/TreeUtils.h \ + ../Common/avl.h ../Common/ListUtils.h ../Parser/OpenFile.h \ + ../Parser/CreateFile.h Options.h ../Post/ColorTable.h CommandLine.h \ + OS.h ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h \ + ../Mesh/Generator.h ../Mesh/Field.h ../Geo/Geo.h \ + ../Common/GmshDefines.h ../Geo/gmshSurface.h ../Geo/Pair.h \ ../Geo/Range.h ../Geo/SPoint2.h ../Geo/SPoint3.h ../Geo/SVector3.h \ ../Geo/SBoundingBox3d.h ../Geo/SPoint2.h ../Geo/ExtrudeParams.h \ ../Common/SmoothData.h ../Post/PView.h Context.h \ @@ -128,10 +133,10 @@ Message.o: Message.cpp Message.h Options.h ../Post/ColorTable.h Context.h \ ../Common/GmshDefines.h ../Geo/gmshSurface.h ../Geo/Pair.h \ ../Geo/Range.h ../Geo/SPoint2.h ../Geo/SPoint3.h ../Geo/SVector3.h \ ../Geo/SPoint3.h ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h \ - ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h ../DataStr/gmshList.h \ - ../DataStr/Tree.h ../DataStr/avl.h ../Geo/SPoint2.h \ - ../Geo/ExtrudeParams.h ../Common/SmoothData.h ../Post/PView.h \ - ../Fltk/GUI_Extras.h + ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h ../Common/ListUtils.h \ + ../Common/TreeUtils.h ../Common/avl.h ../Common/ListUtils.h \ + ../Geo/SPoint2.h ../Geo/ExtrudeParams.h ../Common/SmoothData.h \ + ../Post/PView.h ../Fltk/GUI_Extras.h Visibility.o: Visibility.cpp Visibility.h GmshDefines.h ../Geo/GVertex.h \ ../Geo/GEntity.h ../Geo/Range.h ../Geo/SPoint3.h \ ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Geo/GPoint.h \ @@ -144,7 +149,8 @@ Visibility.o: Visibility.cpp Visibility.h GmshDefines.h ../Geo/GVertex.h \ ../Geo/MElement.h ../Common/GmshDefines.h ../Geo/MVertex.h \ ../Geo/SPoint3.h ../Geo/MEdge.h ../Geo/MVertex.h ../Geo/SVector3.h \ ../Geo/MFace.h ../Geo/MVertex.h ../Geo/SVector3.h ../Parser/Parser.h \ - ../DataStr/gmshList.h ../DataStr/Tree.h ../DataStr/avl.h + ../Common/ListUtils.h ../Common/TreeUtils.h ../Common/avl.h \ + ../Common/ListUtils.h Trackball.o: Trackball.cpp Trackball.h VertexArray.o: VertexArray.cpp VertexArray.h ../Geo/SVector3.h \ ../Geo/SPoint3.h Context.h ../Numeric/Numeric.h \ @@ -152,4 +158,9 @@ VertexArray.o: VertexArray.cpp VertexArray.h ../Geo/SVector3.h \ SmoothData.o: SmoothData.cpp SmoothData.h ../Numeric/Numeric.h \ ../Numeric/NumericEmbedded.h StringUtils.o: StringUtils.cpp StringUtils.h +ListUtils.o: ListUtils.cpp MallocUtils.h ListUtils.h TreeUtils.h avl.h \ + Message.h +TreeUtils.o: TreeUtils.cpp MallocUtils.h TreeUtils.h avl.h ListUtils.h \ + Message.h +MallocUtils.o: MallocUtils.cpp MallocUtils.h Message.h License.o: License.cpp Message.h diff --git a/DataStr/Malloc.cpp b/Common/MallocUtils.cpp similarity index 94% rename from DataStr/Malloc.cpp rename to Common/MallocUtils.cpp index 5e40abc24d9c59aabca5542fcb88ace60ab90064..85eebeb0ecb9571bfff16af1a18cb651d28b5f3b 100644 --- a/DataStr/Malloc.cpp +++ b/Common/MallocUtils.cpp @@ -1,4 +1,4 @@ -// $Id: Malloc.cpp,v 1.23 2008-05-04 08:31:11 geuzaine Exp $ +// $Id: MallocUtils.cpp,v 1.1 2008-06-07 17:20:45 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -22,7 +22,7 @@ #include <stdio.h> #include <stdlib.h> -#include "Malloc.h" +#include "MallocUtils.h" #include "Message.h" void *Malloc(size_t size) diff --git a/DataStr/Malloc.h b/Common/MallocUtils.h similarity index 95% rename from DataStr/Malloc.h rename to Common/MallocUtils.h index 186f9e09f7e0acf161ef3b30106715d879e45f56..325dd4f141363299242f38a63c6cf78744c28dd9 100644 --- a/DataStr/Malloc.h +++ b/Common/MallocUtils.h @@ -1,5 +1,5 @@ -#ifndef _MALLOC_H_ -#define _MALLOC_H_ +#ifndef _MALLOC_UTILS_H_ +#define _MALLOC_UTILS_H_ // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // diff --git a/DataStr/Tree.cpp b/Common/TreeUtils.cpp similarity index 69% rename from DataStr/Tree.cpp rename to Common/TreeUtils.cpp index 592d434b077b2f3c86bf4f165df7f431bc75d9dc..4b7a7ceac97daacbf6baed0f0f0a1ca2629d5496 100644 --- a/DataStr/Tree.cpp +++ b/Common/TreeUtils.cpp @@ -1,4 +1,4 @@ -// $Id: Tree.cpp,v 1.24 2008-05-04 08:31:11 geuzaine Exp $ +// $Id: TreeUtils.cpp,v 1.1 2008-06-07 17:20:45 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -26,8 +26,8 @@ #include <stdlib.h> #include <string.h> -#include "Malloc.h" -#include "Tree.h" +#include "MallocUtils.h" +#include "TreeUtils.h" #include "Message.h" Tree_T *Tree_Create(int size, int (*fcmp) (const void *a, const void *b)) @@ -63,18 +63,6 @@ void Tree_Add(Tree_T * tree, void *data) } } -void *Tree_AddP(Tree_T * tree, void *data) -{ - void *ptr; - - if(!tree) - Msg::Fatal("Impossible to add in unallocated tree"); - ptr = Malloc(tree->size); - memcpy(ptr, data, tree->size); - avl_insert(tree->root, ptr, ptr); - return ptr; -} - int Tree_Nbr(Tree_T * tree) { if(!tree) @@ -93,26 +81,6 @@ int Tree_Insert(Tree_T * tree, void *data) } } -int Tree_Replace(Tree_T * tree, void *data) -{ - void *ptr; - int state; - - if(!tree) { - Msg::Error("Impossible to replace in unallocated tree"); - return (0); - } - state = avl_lookup(tree->root, data, &ptr); - if(state == 0) { - Tree_Add(tree, data); - return (0); - } - else { - memcpy(ptr, data, tree->size); - return (1); - } -} - int Tree_Search(Tree_T * tree, void *data) { void *ptr; @@ -172,46 +140,28 @@ int Tree_Suppress(Tree_T * tree, void *data) return (1); } -int Tree_Left(Tree_T * tree, void *data) +int Tree_Size(Tree_T * tree) { - void *ptr; - int state; - if(!tree) return 0; - state = avl_extremum(tree->root, AVL_MOST_LEFT, &ptr); - - if(state == 0) - return (0); - - memcpy(data, ptr, tree->size); - - return (1); + return (tree->size); } -int Tree_Right(Tree_T * tree, void *data) -{ - void *ptr; - int state; - - if(!tree) - return 0; - - state = avl_extremum(tree->root, AVL_MOST_RIGHT, &ptr); - - if(state == 0) - return (0); +static List_T *pListTransfer; - memcpy(data, ptr, tree->size); - - return (1); +void TransferList(void *a, void *b) +{ + List_Add(pListTransfer, a); } -int Tree_Size(Tree_T * tree) +List_T *Tree2List(Tree_T * pTree) { - if(!tree) - return 0; - - return (tree->size); + int Nb; + Nb = Tree_Nbr(pTree); + if(Nb == 0) + Nb = 1; + pListTransfer = List_Create(Nb, Nb, Tree_Size(pTree)); + Tree_Action(pTree, TransferList); + return (pListTransfer); } diff --git a/DataStr/Tree.h b/Common/TreeUtils.h similarity index 80% rename from DataStr/Tree.h rename to Common/TreeUtils.h index 43c6c614958849f12a92e2707e78701238437dbc..4940dcd150360ebd8015fd0442d221cf9a4bde0d 100644 --- a/DataStr/Tree.h +++ b/Common/TreeUtils.h @@ -1,5 +1,5 @@ -#ifndef _TREE_H_ -#define _TREE_H_ +#ifndef _TREE_UTILS_H_ +#define _TREE_UTILS_H_ // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -25,6 +25,7 @@ // #include "avl.h" +#include "ListUtils.h" typedef struct { int size; @@ -34,16 +35,12 @@ typedef struct { Tree_T *Tree_Create(int size, int (*fcmp)(const void *a, const void *b)); void Tree_Delete(Tree_T *Tree); void Tree_Add(Tree_T *tree, void *data); -void *Tree_AddP(Tree_T *tree, void *data); int Tree_Nbr(Tree_T *Tree); int Tree_Insert(Tree_T *Tree, void *data); -int Tree_Replace(Tree_T *Tree, void *data); int Tree_Search(Tree_T *Tree, void *data); int Tree_Query(Tree_T *Tree, void *data); void *Tree_PQuery(Tree_T *Tree, void *data); int Tree_Suppress(Tree_T *Tree, void *data); -int Tree_Left(Tree_T *tree, void *data); -int Tree_Right(Tree_T *tree, void *data); int Tree_Size(Tree_T *tree) ; inline void Tree_Action(Tree_T *tree, void (*action) (void *data, void *dummy)) @@ -53,13 +50,7 @@ inline void Tree_Action(Tree_T *tree, void (*action) (void *data, void *dummy)) avl_foreach(tree->root, action, AVL_FORWARD); } -inline void Tree_Action_Inverse(Tree_T *tree, void (*action) (void *data, void *dummy)) -{ - if(!tree) return; - - avl_foreach(tree->root, action, AVL_BACKWARD); -} - +List_T *Tree2List(Tree_T *pTree); #endif diff --git a/DataStr/Makefile b/DataStr/Makefile deleted file mode 100644 index d1135dadbdb4f38196fde98c3eb2e32b7f47156d..0000000000000000000000000000000000000000 --- a/DataStr/Makefile +++ /dev/null @@ -1,68 +0,0 @@ -# $Id: Makefile,v 1.51 2008-06-05 16:52:13 geuzaine Exp $ -# -# Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -# USA. -# -# Please report all bugs and problems to <gmsh@geuz.org>. - -include ../variables - -LIB = ../lib/libGmshDataStr${LIBEXT} - -INC = ${DASH}I../DataStr ${DASH}I../Common - -CFLAGS = ${OPTIM} ${FLAGS} ${INC} ${SYSINCLUDE} - -SRC = gmshList.cpp \ - Malloc.cpp \ - SafeIO.cpp \ - Tree.cpp \ - avl.cpp \ - Tools.cpp - -OBJ = ${SRC:.cpp=${OBJEXT}} - -.SUFFIXES: ${OBJEXT} .cpp - -${LIB}: ${OBJ} - ${AR} ${ARFLAGS}${LIB} ${OBJ} - ${RANLIB} ${LIB} - -cpobj: ${OBJ} - cp -f ${OBJ} ../lib/ - -.cpp${OBJEXT}: - ${CXX} ${CFLAGS} ${DASH}c $< - -clean: - rm -f *.o *.obj - -depend: - (sed '/^# DO NOT DELETE THIS LINE/q' Makefile && \ - ${CXX} -MM ${CFLAGS} ${SRC} \ - ) >Makefile.new - cp Makefile Makefile.bak - cp Makefile.new Makefile - rm -f Makefile.new - -# DO NOT DELETE THIS LINE -gmshList.o: gmshList.cpp Malloc.h gmshList.h ../Common/Message.h SafeIO.h -Malloc.o: Malloc.cpp Malloc.h ../Common/Message.h -SafeIO.o: SafeIO.cpp SafeIO.h ../Common/Message.h -Tree.o: Tree.cpp Malloc.h Tree.h avl.h ../Common/Message.h -avl.o: avl.cpp avl.h Malloc.h -Tools.o: Tools.cpp Tools.h gmshList.h Tree.h avl.h diff --git a/DataStr/SafeIO.cpp b/DataStr/SafeIO.cpp deleted file mode 100644 index 10da6164d115153ad38e2c5bf18cfc45e497528b..0000000000000000000000000000000000000000 --- a/DataStr/SafeIO.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// $Id: SafeIO.cpp,v 1.12 2008-05-04 08:31:11 geuzaine Exp $ -// -// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to <gmsh@geuz.org>. - -#include <stdlib.h> -#include <string.h> -#include <errno.h> -#include "SafeIO.h" -#include "Message.h" - -/* - Safe fprintf routine - - In a perfect world, one should use this routine. Unfortunately, it - is very, very slow. - - We should use a macro, i.e. - - #define gprintf(...) { fprintf(__VA_ARGS__); ... } - - but but var args don't work with all C preprocessors. - - Bottom line: don't use safe_fprintf. -*/ - -int safe_fprintf(FILE * stream, char *fmt, ...) -{ - va_list args; - - va_start(args, fmt); - vfprintf(stream, fmt, args); - va_end(args); - - if(ferror(stream)) { - Msg::Error(strerror(errno)); - clearerr(stream); - return 1; - } - - return 0; -} - -/* Safe fwrite routine */ - -int safe_fwrite(const void *ptr, size_t size, size_t nmemb, FILE * stream) -{ - size_t result = fwrite(ptr, size, nmemb, stream); - - if(result < nmemb) { - if(result >= 0) /* Partial write */ - Msg::Error("Disk full"); - else - Msg::Error(strerror(errno)); - if(fflush(stream) < 0) - Msg::Error("EOF reached"); - if(fclose(stream) < 0) - Msg::Error(strerror(errno)); - return 1; - } - return 0; -} diff --git a/DataStr/SafeIO.h b/DataStr/SafeIO.h deleted file mode 100644 index 5e631a39af48041dfe345fe26c8aca8d2b3b680b..0000000000000000000000000000000000000000 --- a/DataStr/SafeIO.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef _SAFE_IO_H_ - -// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to <gmsh@geuz.org>. - -#include <stdarg.h> -#include <stdio.h> - -int safe_fprintf(FILE *stream, char *fmt, ...); -int safe_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream); - -#endif diff --git a/DataStr/Tools.cpp b/DataStr/Tools.cpp deleted file mode 100644 index 896a302401fcb46cff82f09e8ab1190ad564ae53..0000000000000000000000000000000000000000 --- a/DataStr/Tools.cpp +++ /dev/null @@ -1,174 +0,0 @@ -// $Id: Tools.cpp,v 1.18 2008-02-17 08:47:56 geuzaine Exp $ -// -// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to <gmsh@geuz.org>. - -#include <stdlib.h> -#include <math.h> -#include "Tools.h" - -static List_T *pListeTransfert; -static Tree_T *pTreeTransfert; -static Tree_T *pTreeTransfert2; - -// Comparison functions - -int fcmp_int(const void *a, const void *b) -{ - return (*(int *)a - *(int *)b); -} - -int fcmp_absint(const void *a, const void *b) -{ - return (abs(*(int *)a) - abs(*(int *)b)); -} - -int fcmp_double(const void *a, const void *b) -{ - double cmp; - - cmp = *(double *)a - *(double *)b; - if(cmp > 1.e-16) - return 1; - else if(cmp < -1.e-16) - return -1; - else - return 0; -} - -// List utilities - -List_T *ListOfDouble2ListOfInt(List_T *dList) -{ - int n = List_Nbr(dList); - List_T *iList = List_Create(n, n, sizeof(int)); - for(int i = 0; i < n; i++){ - double d; - List_Read(dList, i, &d); - int j = (int)d; - List_Add(iList, &j); - } - return iList; -} - -// Tree -> List transfer - -void TransfereListe(void *a, void *b) -{ - List_Add(pListeTransfert, a); -} - -List_T *Tree2List(Tree_T * pTree) -{ - int Nb; - Nb = Tree_Nbr(pTree); - if(Nb == 0) - Nb = 1; - pListeTransfert = List_Create(Nb, Nb, Tree_Size(pTree)); - Tree_Action(pTree, TransfereListe); - return (pListeTransfert); -} - -// List -> Tree transfer - -void TransfereTree(void *a, void *b) -{ - Tree_Add(pTreeTransfert, a); -} - -Tree_T *List2Tree(List_T * pList, int (*fcmp) (const void *a, const void *b)) -{ - pTreeTransfert = Tree_Create(pList->size, fcmp); - List_Action(pList, TransfereTree); - return (pTreeTransfert); -} - -// Algebraic utilities - -void DupliqueArbre(void *a, void *b) -{ - Tree_Add(pTreeTransfert, a); -} - -Tree_T *Tree_Duplique(Tree_T * pTree) -{ - pTreeTransfert = Tree_Create(pTree->size, pTree->root->compar); - Tree_Action(pTree, DupliqueArbre); - return (pTreeTransfert); -} - -void UnitArbre(void *a, void *b) -{ - Tree_Replace(pTreeTransfert, a); -} - -Tree_T *Tree_Union(Tree_T * pTreeA, Tree_T * pTreeB) -{ - pTreeTransfert = Tree_Duplique(pTreeA); - Tree_Action(pTreeB, UnitArbre); - return (pTreeTransfert); -} - -void Tree_Unit(Tree_T * pTreeA, Tree_T * pTreeB) -{ - pTreeTransfert = pTreeA; - Tree_Action(pTreeB, UnitArbre); -} - -void SoustraitArbre(void *a, void *b) -{ - Tree_Suppress(pTreeTransfert, a); -} - -Tree_T *Tree_Soustraction(Tree_T * pTreeA, Tree_T * pTreeB) -{ - pTreeTransfert = Tree_Duplique(pTreeA); - Tree_Action(pTreeB, SoustraitArbre); - return (pTreeTransfert); -} - -void Tree_Soustrait(Tree_T * pTreeA, Tree_T * pTreeB) -{ - pTreeTransfert = pTreeA; - Tree_Action(pTreeB, SoustraitArbre); -} - -void IntersecteArbre(void *a, void *b) -{ - if(Tree_Query(pTreeTransfert, a)) - Tree_Add(pTreeTransfert2, a); -} - -Tree_T *Tree_Intersection(Tree_T * pTreeA, Tree_T * pTreeB) -{ - pTreeTransfert = Tree_Duplique(pTreeA); - pTreeTransfert2 = Tree_Create(pTreeA->size, pTreeA->root->compar); - Tree_Action(pTreeB, IntersecteArbre); - Tree_Delete(pTreeTransfert); - return (pTreeTransfert2); -} - -void Tree_Intersecte(Tree_T * pTreeA, Tree_T * pTreeB) -{ - pTreeTransfert2 = pTreeA; - pTreeTransfert = Tree_Create(pTreeA->size, pTreeA->root->compar); - Tree_Action(pTreeB, IntersecteArbre); - pTreeA = pTreeTransfert2; - Tree_Delete(pTreeA); -} diff --git a/DataStr/Tools.h b/DataStr/Tools.h deleted file mode 100644 index 1e11979ed051e86acf6609d87090ecfe78523af0..0000000000000000000000000000000000000000 --- a/DataStr/Tools.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef _TOOLS_H_ -#define _TOOLS_H_ - -// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to <gmsh@geuz.org>. - -#include "gmshList.h" -#include "Tree.h" - -int fcmp_int(const void *a, const void *b); -int fcmp_absint(const void *a, const void *b); -int fcmp_double(const void *a, const void *b); - -List_T *ListOfDouble2ListOfInt(List_T *dList); -List_T *Tree2List(Tree_T *pTree); -Tree_T *List2Tree(List_T * pList, int (*fcmp) (const void *a, const void *b)); - -Tree_T *Tree_Duplique(Tree_T *pTree); -Tree_T *Tree_Union(Tree_T *pTreeA, Tree_T *pTreeB); -Tree_T *Tree_Soustraction(Tree_T *pTreeA, Tree_T *pTreeB); -Tree_T *Tree_Intersection(Tree_T *pTreeA, Tree_T *pTreeB); - -void Tree_Unit(Tree_T *pTreeA, Tree_T *pTreeB); -void Tree_Soustrait(Tree_T *pTreeA, Tree_T *pTreeB); -void Tree_Intersecte(Tree_T *pTreeA, Tree_T *pTreeB); - -#endif diff --git a/DataStr/avl.cpp b/DataStr/avl.cpp deleted file mode 100644 index fdd0394f5d02f670492f48353eabd2917478c07a..0000000000000000000000000000000000000000 --- a/DataStr/avl.cpp +++ /dev/null @@ -1,412 +0,0 @@ -// $Id: avl.cpp,v 1.10 2008-03-20 11:44:02 geuzaine Exp $ - -/* - * avl package - * - * Copyright (c) 1988-1993, The Regents of the University of California. - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, provided - * that the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of the University of California not - * be used in advertising or publicity pertaining to distribution of - * the software without specific, written prior permission. The University - * of California makes no representations about the suitability of this - * software for any purpose. It is provided "as is" without express or - * implied warranty. - * - * THE UNIVERSITY OF CALIFORNIA DISCLAIMS ALL WARRANTIES WITH REGARD TO - * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS, IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE FOR - * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER - * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF - * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -// Modified for Gmsh (C++, 64 bits, ...) - -#include <stdio.h> - -#include "avl.h" -#include "Malloc.h" - -#define ALLOC(type, number) (type *) Malloc((unsigned) sizeof(type) * number) -#define FREE(item) (void) Free(item) -#define XRNMAX(a,b) ((a) > (b) ? (a) : (b)) -#define HEIGHT(node) (node == NIL(avl_node) ? -1 : (node)->height) -#define BALANCE(node) (HEIGHT((node)->right) - HEIGHT((node)->left)) - -#define compute_height(node) { \ - int x=HEIGHT(node->left), y=HEIGHT(node->right); \ - (node)->height = XRNMAX(x,y) + 1; \ -} - -#define COMPARE(key, nodekey, compare) \ - ((compare == avl_numcmp) ? \ - (long int) key - (long int) nodekey : \ - (*compare)(key, nodekey)) - -static void avl_record_gen_forward(avl_node *node, avl_generator *gen); -static void avl_record_gen_backward(avl_node *node, avl_generator *gen); -static avl_node *find_rightmost(avl_node **node_p); -static void do_rebalance(avl_node ***stack_nodep, int stack_n); -static void rotate_left(avl_node **node_p); -static void rotate_right(avl_node **node_p); -static void free_entry(avl_node *node, void (*key_free)(void *key), - void (*value_free)(void *value)); -static avl_node *new_node(void *key, void *value); -static int do_check_tree(avl_node *node, int (*compar)(const void *key1, const void *key2), - int *error); - - -avl_tree *avl_init_table(int (*compar)(const void *key1, const void *key2)) -{ - avl_tree *tree; - - tree = ALLOC(avl_tree, 1); - tree->root = NIL(avl_node); - tree->compar = compar; - tree->num_entries = 0; - return tree; -} - -int avl_lookup(avl_tree *tree, void *key, void **value_p) -{ - register avl_node *node; - register int (*compare)(const void*, const void *) = tree->compar, diff; - - node = tree->root; - while (node != NIL(avl_node)) { - diff = COMPARE(key, node->key, compare); - if (diff == 0) { - /* got a match, give the user a 'value' only if non-null */ - if (value_p != NIL(void *)) *value_p = node->value; - return 1; - } - node = (diff < 0) ? node->left : node->right; - } - return 0; -} - -int avl_insert(avl_tree *tree, void *key, void *value) -{ - register avl_node **node_p, *node; - register int stack_n = 0; - register int (*compare)(const void*, const void *) = tree->compar; - avl_node **stack_nodep[32]; - int diff, status; - - node_p = &tree->root; - - /* walk down the tree (saving the path); stop at insertion point */ - status = 0; - while ((node = *node_p) != NIL(avl_node)) { - stack_nodep[stack_n++] = node_p; - diff = COMPARE(key, node->key, compare); - if (diff == 0) status = 1; - node_p = (diff < 0) ? &node->left : &node->right; - } - - /* insert the item and re-balance the tree */ - *node_p = new_node(key, value); - do_rebalance(stack_nodep, stack_n); - tree->num_entries++; - tree->modified = 1; - return status; -} - -int avl_delete(avl_tree *tree, void **key_p, void **value_p) -{ - register avl_node **node_p, *node, *rightmost; - register int stack_n = 0; - void *key = *key_p; - int (*compare)(const void*, const void*) = tree->compar, diff; - avl_node **stack_nodep[32]; - - node_p = &tree->root; - - /* Walk down the tree saving the path; return if not found */ - while ((node = *node_p) != NIL(avl_node)) { - diff = COMPARE(key, node->key, compare); - if (diff == 0) goto delete_item; - stack_nodep[stack_n++] = node_p; - node_p = (diff < 0) ? &node->left : &node->right; - } - return 0; /* not found */ - - /* prepare to delete node and replace it with rightmost of left tree */ - delete_item: - *key_p = node->key; - if (value_p != 0) *value_p = node->value; - if (node->left == NIL(avl_node)) { - *node_p = node->right; - } else { - rightmost = find_rightmost(&node->left); - rightmost->left = node->left; - rightmost->right = node->right; - rightmost->height = -2; /* mark bogus height for do_rebal */ - *node_p = rightmost; - stack_nodep[stack_n++] = node_p; - } - FREE(node); - - /* work our way back up, re-balancing the tree */ - do_rebalance(stack_nodep, stack_n); - tree->num_entries--; - tree->modified = 1; - return 1; -} - -static void avl_record_gen_forward(avl_node *node, avl_generator *gen) -{ - if (node != NIL(avl_node)) { - avl_record_gen_forward(node->left, gen); - gen->nodelist[gen->count++] = node; - avl_record_gen_forward(node->right, gen); - } -} - -static void avl_record_gen_backward(avl_node *node, avl_generator *gen) -{ - if (node != NIL(avl_node)) { - avl_record_gen_backward(node->right, gen); - gen->nodelist[gen->count++] = node; - avl_record_gen_backward(node->left, gen); - } -} - -avl_generator *avl_init_gen(avl_tree *tree, int dir) -{ - avl_generator *gen; - - /* what a hack */ - gen = ALLOC(avl_generator, 1); - gen->tree = tree; - gen->nodelist = ALLOC(avl_node *, avl_count(tree)); - gen->count = 0; - if (dir == AVL_FORWARD) { - avl_record_gen_forward(tree->root, gen); - } else { - avl_record_gen_backward(tree->root, gen); - } - gen->count = 0; - - /* catch any attempt to modify the tree while we generate */ - tree->modified = 0; - return gen; -} - -int avl_gen(avl_generator *gen, void **key_p, void **value_p) -{ - avl_node *node; - - if (gen->count == gen->tree->num_entries) { - return 0; - } else { - node = gen->nodelist[gen->count++]; - if (key_p != NIL(void *)) *key_p = node->key; - if (value_p != NIL(void *)) *value_p = node->value; - return 1; - } -} - -void avl_free_gen(avl_generator *gen) -{ - FREE(gen->nodelist); - FREE(gen); -} - -static avl_node *find_rightmost(avl_node **node_p) -{ - register avl_node *node; - register int stack_n = 0; - avl_node **stack_nodep[32]; - - node = *node_p; - while (node->right != NIL(avl_node)) { - stack_nodep[stack_n++] = node_p; - node_p = &node->right; - node = *node_p; - } - *node_p = node->left; - - do_rebalance(stack_nodep, stack_n); - return node; -} - -static void do_rebalance(avl_node ***stack_nodep, int stack_n) -{ - register avl_node **node_p, *node; - register int hl, hr; - int height; - - /* work our way back up, re-balancing the tree */ - while (--stack_n >= 0) { - node_p = stack_nodep[stack_n]; - node = *node_p; - hl = HEIGHT(node->left); /* watch for NIL */ - hr = HEIGHT(node->right); /* watch for NIL */ - if ((hr - hl) < -1) { - rotate_right(node_p); - } else if ((hr - hl) > 1) { - rotate_left(node_p); - } else { - height = XRNMAX(hl, hr) + 1; - if (height == node->height) break; - node->height = height; - } - } -} - -static void rotate_left(avl_node **node_p) -{ - register avl_node *old_root = *node_p, *new_root, *new_right; - - if (BALANCE(old_root->right) >= 0) { - *node_p = new_root = old_root->right; - old_root->right = new_root->left; - new_root->left = old_root; - } else { - new_right = old_root->right; - *node_p = new_root = new_right->left; - old_root->right = new_root->left; - new_right->left = new_root->right; - new_root->right = new_right; - new_root->left = old_root; - compute_height(new_right); - } - compute_height(old_root); - compute_height(new_root); -} - -static void rotate_right(avl_node **node_p) -{ - register avl_node *old_root = *node_p, *new_root, *new_left; - - if (BALANCE(old_root->left) <= 0) { - *node_p = new_root = old_root->left; - old_root->left = new_root->right; - new_root->right = old_root; - } else { - new_left = old_root->left; - *node_p = new_root = new_left->right; - old_root->left = new_root->right; - new_left->right = new_root->left; - new_root->left = new_left; - new_root->right = old_root; - compute_height(new_left); - } - compute_height(old_root); - compute_height(new_root); -} - - -int avl_extremum(avl_tree *tree, int side, void **value_p) -{ - register avl_node *node; - - node = tree->root; - if (node == NIL(avl_node)) return 0; - - if (side == AVL_MOST_LEFT) - while (node->left != NIL(avl_node)) node = node->left; - else - while (node->right != NIL(avl_node)) node = node->right; - - if (value_p != NIL(void *)) { - *value_p = node->value; - return 1; - } - return 0; -} - -static void free_entry(avl_node *node, void (*key_free)(void *key), void (*value_free)(void *value)) -{ - if (node != NIL(avl_node)) { - free_entry(node->left, key_free, value_free); - free_entry(node->right, key_free, value_free); - if (key_free != 0) (*key_free)(node->key); - if (value_free != 0) (*value_free)(node->value); - FREE(node); - } -} - -void avl_free_table(avl_tree *tree, void (*key_free)(void *key), void (*value_free)(void *value)) -{ - free_entry(tree->root, key_free, value_free); - FREE(tree); -} - -int avl_count(avl_tree *tree) -{ - return tree->num_entries; -} - -static avl_node *new_node(void *key, void *value) -{ - register avl_node *newn; - - newn = ALLOC(avl_node, 1); - newn->key = key; - newn->value = value; - newn->height = 0; - newn->left = newn->right = NIL(avl_node); - return newn; -} -int avl_numcmp(const void *x, const void*y) -{ - return (long int) x - (long int) y; -} - -int avl_check_tree(avl_tree *tree) -{ - int error = 0; - (void) do_check_tree(tree->root, tree->compar, &error); - return error; -} - -static int do_check_tree(avl_node *node, - int (*compar)(const void *key1, const void *key2), int *error) -{ - int l_height, r_height, comp_height, bal; - - if (node == NIL(avl_node)) { - return -1; - } - - r_height = do_check_tree(node->right, compar, error); - l_height = do_check_tree(node->left, compar, error); - - comp_height = XRNMAX(l_height, r_height) + 1; - bal = r_height - l_height; - - if (comp_height != node->height) { - (void) printf("Bad height for %p: computed=%d stored=%d\n", - (void*)node, comp_height, node->height); - ++*error; - } - - if (bal > 1 || bal < -1) { - (void) printf("Out of balance at node %p, balance = %d\n", - (void*)node, bal); - ++*error; - } - - if (node->left != NIL(avl_node) && - (*compar)(node->left->key, node->key) > 0) { - (void) printf("Bad ordering between %p and %p", - (void*)node, (void*)node->left); - ++*error; - } - - if (node->right != NIL(avl_node) && - (*compar)(node->key, node->right->key) > 0) { - (void) printf("Bad ordering between %p and %p", - (void*)node, (void*)node->right); - ++*error; - } - - return comp_height; -} diff --git a/DataStr/avl.h b/DataStr/avl.h deleted file mode 100644 index 2265f2401520c0f5dd3d3c00087352231c73af4c..0000000000000000000000000000000000000000 --- a/DataStr/avl.h +++ /dev/null @@ -1,113 +0,0 @@ -#ifndef _AVL_H_ -#define _AVL_H_ - -/* - * avl package - * - * Copyright (c) 1988-1993, The Regents of the University of California. - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, provided - * that the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of the University of California not - * be used in advertising or publicity pertaining to distribution of - * the software without specific, written prior permission. The University - * of California makes no representations about the suitability of this - * software for any purpose. It is provided "as is" without express or - * implied warranty. - * - * THE UNIVERSITY OF CALIFORNIA DISCLAIMS ALL WARRANTIES WITH REGARD TO - * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS, IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE FOR - * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER - * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF - * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -// Modified for Gmsh (C++, 64 bits, ...) - -typedef struct avl_node_struct avl_node; -struct avl_node_struct { - avl_node *left, *right; - void *key; - void *value; - int height; -}; - - -typedef struct avl_tree_struct avl_tree; -struct avl_tree_struct { - avl_node *root; - int (*compar)(const void *key1, const void *key2); - int num_entries; - int modified; -}; - - -typedef struct avl_generator_struct avl_generator; -struct avl_generator_struct { - avl_tree *tree; - avl_node **nodelist; - int count; -}; - - -#define AVL_FORWARD 0 -#define AVL_BACKWARD 1 - -#define AVL_MOST_LEFT 0 -#define AVL_MOST_RIGHT 1 - -#define avl_is_member(tree, key) avl_lookup(tree, key, (void **) 0) -#define NIL(type) (type *) 0 - -#define avl_foreach_item(table, gen, dir, key_p, value_p) \ - for(gen = avl_init_gen(table, dir); \ - avl_gen(gen, key_p, value_p) || (avl_free_gen(gen),0);) - - -inline void avl_walk_forward(avl_node *node, void (*func)(void *key, void *value)) -{ - if (node != NIL(avl_node)) { - avl_walk_forward(node->left, func); - (*func)(node->key, node->value); - avl_walk_forward(node->right, func); - } -} - -inline void avl_walk_backward(avl_node *node, void (*func)(void *key, void *value)) -{ - if (node != NIL(avl_node)) { - avl_walk_backward(node->right, func); - (*func)(node->key, node->value); - avl_walk_backward(node->left, func); - } -} - -inline void avl_foreach(avl_tree *tree, void (*func)(void *key, void *value), int direction) -{ - if (direction == AVL_FORWARD) { - avl_walk_forward(tree->root, func); - } else { - avl_walk_backward(tree->root, func); - } -} - -avl_tree *avl_init_table(int (*compar)(const void *key1, const void *key2)); -int avl_lookup(avl_tree *tree, void *key, void **value_p); -int avl_insert(avl_tree *tree, void *key, void *value); -int avl_delete(avl_tree *tree, void **key_p, void **value_p); -void avl_free_table(avl_tree *tree, void (*key_free)(void *key), void (*value_free)(void *value)); -int avl_count(avl_tree *tree); -int avl_check_tree(avl_tree *tree); -int avl_extremum(avl_tree *tree, int side, void **value_p); - -avl_generator *avl_init_gen(avl_tree *tree, int dir); -int avl_gen(avl_generator *gen, void **key_p, void **value_p); -void avl_free_gen(avl_generator *gen); - -int avl_numcmp(const void *x, const void*y); - -#endif diff --git a/Fltk/Callbacks.cpp b/Fltk/Callbacks.cpp index 4f7b05ac77e84bab83e61e507af66676a72722c1..b1c1053dd15ea27b950b90cdbb55ba4cb8d089d7 100644 --- a/Fltk/Callbacks.cpp +++ b/Fltk/Callbacks.cpp @@ -1,4 +1,4 @@ -// $Id: Callbacks.cpp,v 1.583 2008-05-06 21:11:46 geuzaine Exp $ +// $Id: Callbacks.cpp,v 1.584 2008-06-07 17:20:45 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -28,8 +28,8 @@ #include "GmshUI.h" #include "Message.h" -#include "Malloc.h" -#include "Tools.h" +#include "MallocUtils.h" +#include "ListUtils.h" #include "GModel.h" #include "MElement.h" #include "GeoStringInterface.h" diff --git a/Fltk/Makefile b/Fltk/Makefile index cffbff0ce9f692c328648233fa13223a8ced9b76..554268b5cc23d8493f553da5908a7c5cc57fd5f9 100644 --- a/Fltk/Makefile +++ b/Fltk/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.187 2008-06-05 16:52:13 geuzaine Exp $ +# $Id: Makefile,v 1.188 2008-06-07 17:20:45 geuzaine Exp $ # # Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle # @@ -23,7 +23,7 @@ include ../variables LIB = ../lib/libGmshFltk${LIBEXT} -INC = ${DASH}I../Common ${DASH}I../DataStr ${DASH}I../Graphics\ +INC = ${DASH}I../Common ${DASH}I../Graphics\ ${DASH}I../Geo ${DASH}I../Mesh ${DASH}I../Post ${DASH}I../Numeric\ ${DASH}I../Parser ${DASH}I../Fltk ${DASH}I../Plugin ${DASH}I../utils/solvers\ ${DASH}I../contrib/ANN/include ${DASH}I../contrib/NativeFileChooser @@ -76,10 +76,10 @@ Main.o: Main.cpp GUI.h Opengl_Window.h Colorbar_Window.h \ ../Common/GmshDefines.h ../Geo/gmshSurface.h ../Geo/Pair.h \ ../Geo/Range.h ../Geo/SPoint2.h ../Geo/SPoint3.h ../Geo/SVector3.h \ ../Geo/SPoint3.h ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h \ - ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h ../DataStr/gmshList.h \ - ../DataStr/Tree.h ../DataStr/avl.h ../Geo/SPoint2.h \ - ../Geo/ExtrudeParams.h ../Common/SmoothData.h ../Post/PView.h \ - ../Common/Gmsh.h ../Common/Message.h ../Graphics/Draw.h \ + ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h ../Common/ListUtils.h \ + ../Common/TreeUtils.h ../Common/avl.h ../Common/ListUtils.h \ + ../Geo/SPoint2.h ../Geo/ExtrudeParams.h ../Common/SmoothData.h \ + ../Post/PView.h ../Common/Gmsh.h ../Common/Message.h ../Graphics/Draw.h \ ../Common/Context.h ../Common/Options.h ../Parser/Parser.h \ ../Parser/OpenFile.h ../Common/CommandLine.h Solvers.h \ ../Plugin/PluginManager.h ../Plugin/Plugin.h ../Post/PViewDataList.h \ @@ -99,15 +99,15 @@ GUI.o: GUI.cpp ../Common/GmshUI.h ../Common/GmshDefines.h \ SpherePosition_Widget.h ../Mesh/Field.h ../Geo/Geo.h \ ../Geo/gmshSurface.h ../Geo/Pair.h ../Geo/Range.h ../Geo/SPoint2.h \ ../Geo/SPoint3.h ../Geo/SVector3.h ../Geo/SPoint3.h \ - ../Geo/SBoundingBox3d.h ../DataStr/gmshList.h ../DataStr/Tree.h \ - ../DataStr/avl.h ../Geo/SPoint2.h ../Geo/ExtrudeParams.h \ - ../Common/SmoothData.h ../Post/PView.h Callbacks.h Win32Icon.h \ - ../Parser/OpenFile.h ../Common/CommandLine.h ../Mesh/Generator.h \ - Solvers.h ../Plugin/PluginManager.h ../Plugin/Plugin.h \ - ../Post/PViewDataList.h ../Post/PViewData.h ../Common/GmshMatrix.h \ - Shortcut_Window.h ../Post/PViewOptions.h ../Post/ColorTable.h \ - ../Geo/GModel.h ../Geo/GVertex.h ../Geo/GEntity.h ../Geo/Range.h \ - ../Geo/SPoint3.h ../Geo/SBoundingBox3d.h ../Geo/GPoint.h \ + ../Geo/SBoundingBox3d.h ../Common/ListUtils.h ../Common/TreeUtils.h \ + ../Common/avl.h ../Common/ListUtils.h ../Geo/SPoint2.h \ + ../Geo/ExtrudeParams.h ../Common/SmoothData.h ../Post/PView.h \ + Callbacks.h Win32Icon.h ../Parser/OpenFile.h ../Common/CommandLine.h \ + ../Mesh/Generator.h Solvers.h ../Plugin/PluginManager.h \ + ../Plugin/Plugin.h ../Post/PViewDataList.h ../Post/PViewData.h \ + ../Common/GmshMatrix.h Shortcut_Window.h ../Post/PViewOptions.h \ + ../Post/ColorTable.h ../Geo/GModel.h ../Geo/GVertex.h ../Geo/GEntity.h \ + ../Geo/Range.h ../Geo/SPoint3.h ../Geo/SBoundingBox3d.h ../Geo/GPoint.h \ ../Geo/SPoint2.h ../Geo/GEdge.h ../Geo/GEntity.h ../Geo/GVertex.h \ ../Geo/SVector3.h ../Geo/SPoint3.h ../Geo/SPoint2.h ../Geo/GFace.h \ ../Geo/GEntity.h ../Geo/GPoint.h ../Geo/GEdgeLoop.h ../Geo/GEdge.h \ @@ -121,16 +121,17 @@ GUI_Extras.o: GUI_Extras.cpp ../Common/GmshUI.h ../Common/GmshDefines.h \ ../Geo/gmshSurface.h ../Geo/Pair.h ../Geo/Range.h ../Geo/SPoint2.h \ ../Geo/SPoint3.h ../Geo/SVector3.h ../Geo/SPoint3.h \ ../Geo/SBoundingBox3d.h ../Numeric/Numeric.h \ - ../Numeric/NumericEmbedded.h ../DataStr/gmshList.h ../DataStr/Tree.h \ - ../DataStr/avl.h ../Geo/SPoint2.h ../Geo/ExtrudeParams.h \ - ../Common/SmoothData.h ../Post/PView.h Shortcut_Window.h \ - ../Geo/GModel.h ../Geo/GVertex.h ../Geo/GEntity.h ../Geo/Range.h \ - ../Geo/SPoint3.h ../Geo/SBoundingBox3d.h ../Geo/GPoint.h \ - ../Geo/SPoint2.h ../Geo/GEdge.h ../Geo/GEntity.h ../Geo/GVertex.h \ - ../Geo/SVector3.h ../Geo/SPoint3.h ../Geo/SPoint2.h ../Geo/GFace.h \ - ../Geo/GEntity.h ../Geo/GPoint.h ../Geo/GEdgeLoop.h ../Geo/GEdge.h \ - ../Geo/SPoint2.h ../Geo/SVector3.h ../Geo/Pair.h ../Geo/GRegion.h \ - ../Geo/GEntity.h ../Geo/SBoundingBox3d.h File_Picker.h + ../Numeric/NumericEmbedded.h ../Common/ListUtils.h \ + ../Common/TreeUtils.h ../Common/avl.h ../Common/ListUtils.h \ + ../Geo/SPoint2.h ../Geo/ExtrudeParams.h ../Common/SmoothData.h \ + ../Post/PView.h Shortcut_Window.h ../Geo/GModel.h ../Geo/GVertex.h \ + ../Geo/GEntity.h ../Geo/Range.h ../Geo/SPoint3.h \ + ../Geo/SBoundingBox3d.h ../Geo/GPoint.h ../Geo/SPoint2.h ../Geo/GEdge.h \ + ../Geo/GEntity.h ../Geo/GVertex.h ../Geo/SVector3.h ../Geo/SPoint3.h \ + ../Geo/SPoint2.h ../Geo/GFace.h ../Geo/GEntity.h ../Geo/GPoint.h \ + ../Geo/GEdgeLoop.h ../Geo/GEdge.h ../Geo/SPoint2.h ../Geo/SVector3.h \ + ../Geo/Pair.h ../Geo/GRegion.h ../Geo/GEntity.h ../Geo/SBoundingBox3d.h \ + File_Picker.h GUI_Projection.o: GUI_Projection.cpp ../Geo/GModelIO_Fourier.h \ ../Geo/GModel.h ../Geo/GVertex.h ../Geo/GEntity.h ../Geo/Range.h \ ../Geo/SPoint3.h ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h \ @@ -149,13 +150,13 @@ GUI_Projection.o: GUI_Projection.cpp ../Geo/GModelIO_Fourier.h \ SpherePosition_Widget.h ../Mesh/Field.h ../Geo/Geo.h \ ../Geo/gmshSurface.h ../Geo/Pair.h ../Geo/Range.h ../Geo/SPoint2.h \ ../Geo/SPoint3.h ../Geo/SVector3.h ../Geo/SBoundingBox3d.h \ - ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h ../DataStr/gmshList.h \ - ../DataStr/Tree.h ../DataStr/avl.h ../Geo/SPoint2.h \ - ../Geo/ExtrudeParams.h ../Common/SmoothData.h ../Post/PView.h \ - Shortcut_Window.h GUI_Extras.h ../Geo/fourierFace.h ../Geo/GFace.h \ - ../Geo/GModel.h ../Geo/Range.h ../Geo/fourierEdge.h ../Geo/GEdge.h \ - ../Geo/GModel.h ../Geo/fourierVertex.h ../Geo/GModel.h ../Geo/GVertex.h \ - ../Geo/MVertex.h ../Common/Message.h + ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h ../Common/ListUtils.h \ + ../Common/TreeUtils.h ../Common/avl.h ../Common/ListUtils.h \ + ../Geo/SPoint2.h ../Geo/ExtrudeParams.h ../Common/SmoothData.h \ + ../Post/PView.h Shortcut_Window.h GUI_Extras.h ../Geo/fourierFace.h \ + ../Geo/GFace.h ../Geo/GModel.h ../Geo/Range.h ../Geo/fourierEdge.h \ + ../Geo/GEdge.h ../Geo/GModel.h ../Geo/fourierVertex.h ../Geo/GModel.h \ + ../Geo/GVertex.h ../Geo/MVertex.h ../Common/Message.h GUI_Classifier.o: GUI_Classifier.cpp GUI_Classifier.h ../Common/GmshUI.h \ ../Geo/GModel.h ../Geo/GVertex.h ../Geo/GEntity.h ../Geo/Range.h \ ../Geo/SPoint3.h ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h \ @@ -171,20 +172,20 @@ GUI_Classifier.o: GUI_Classifier.cpp GUI_Classifier.h ../Common/GmshUI.h \ SpherePosition_Widget.h ../Mesh/Field.h ../Geo/Geo.h \ ../Geo/gmshSurface.h ../Geo/Pair.h ../Geo/Range.h ../Geo/SPoint2.h \ ../Geo/SPoint3.h ../Geo/SVector3.h ../Geo/SBoundingBox3d.h \ - ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h ../DataStr/gmshList.h \ - ../DataStr/Tree.h ../DataStr/avl.h ../Geo/SPoint2.h \ - ../Geo/ExtrudeParams.h ../Common/SmoothData.h ../Post/PView.h \ - Shortcut_Window.h ../Graphics/Draw.h ../Common/Options.h \ - ../Common/Context.h ../Graphics/SelectBuffer.h GUI_Projection.h \ - ../Geo/fourierProjectionFace.h ../Geo/GModel.h ../Geo/Range.h \ - GUI_Extras.h ../Common/Message.h ../Mesh/meshGFaceDelaunayInsertion.h \ - ../Mesh/meshGFaceOptimize.h ../Mesh/meshGFaceDelaunayInsertion.h \ - ../Geo/discreteEdge.h ../Geo/GModel.h ../Geo/GEdge.h \ - ../Geo/discreteFace.h ../Geo/GModel.h ../Geo/GFace.h + ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h ../Common/ListUtils.h \ + ../Common/TreeUtils.h ../Common/avl.h ../Common/ListUtils.h \ + ../Geo/SPoint2.h ../Geo/ExtrudeParams.h ../Common/SmoothData.h \ + ../Post/PView.h Shortcut_Window.h ../Graphics/Draw.h \ + ../Common/Options.h ../Common/Context.h ../Graphics/SelectBuffer.h \ + GUI_Projection.h ../Geo/fourierProjectionFace.h ../Geo/GModel.h \ + ../Geo/Range.h GUI_Extras.h ../Common/Message.h \ + ../Mesh/meshGFaceDelaunayInsertion.h ../Mesh/meshGFaceOptimize.h \ + ../Mesh/meshGFaceDelaunayInsertion.h ../Geo/discreteEdge.h \ + ../Geo/GModel.h ../Geo/GEdge.h ../Geo/discreteFace.h ../Geo/GModel.h \ + ../Geo/GFace.h Callbacks.o: Callbacks.cpp ../Common/GmshUI.h ../Common/Message.h \ - ../DataStr/Malloc.h ../DataStr/Tools.h ../DataStr/gmshList.h \ - ../DataStr/Tree.h ../DataStr/avl.h ../Geo/GModel.h ../Geo/GVertex.h \ - ../Geo/GEntity.h ../Geo/Range.h ../Geo/SPoint3.h \ + ../Common/MallocUtils.h ../Common/ListUtils.h ../Geo/GModel.h \ + ../Geo/GVertex.h ../Geo/GEntity.h ../Geo/Range.h ../Geo/SPoint3.h \ ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Geo/GPoint.h \ ../Geo/SPoint2.h ../Geo/GEdge.h ../Geo/GEntity.h ../Geo/GVertex.h \ ../Geo/SVector3.h ../Geo/SPoint3.h ../Geo/SPoint3.h ../Geo/SPoint2.h \ @@ -203,7 +204,8 @@ Callbacks.o: Callbacks.cpp ../Common/GmshUI.h ../Common/Message.h \ SpherePosition_Widget.h ../Mesh/Field.h ../Geo/Geo.h \ ../Geo/gmshSurface.h ../Geo/Pair.h ../Geo/Range.h ../Geo/SPoint2.h \ ../Geo/SPoint3.h ../Geo/SVector3.h ../Geo/SBoundingBox3d.h \ - ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h ../Geo/SPoint2.h \ + ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h ../Common/TreeUtils.h \ + ../Common/avl.h ../Common/ListUtils.h ../Geo/SPoint2.h \ ../Geo/ExtrudeParams.h ../Common/SmoothData.h GUI_Extras.h Callbacks.h \ ../Plugin/Plugin.h ../Post/PViewDataList.h ../Post/PViewData.h \ ../Common/GmshMatrix.h ../Plugin/PluginManager.h ../Plugin/Plugin.h \ @@ -223,9 +225,9 @@ Opengl.o: Opengl.cpp ../Common/GmshUI.h ../Common/GmshDefines.h \ SpherePosition_Widget.h ../Mesh/Field.h ../Geo/Geo.h \ ../Geo/gmshSurface.h ../Geo/Pair.h ../Geo/Range.h ../Geo/SPoint2.h \ ../Geo/SPoint3.h ../Geo/SVector3.h ../Geo/SBoundingBox3d.h \ - ../DataStr/gmshList.h ../DataStr/Tree.h ../DataStr/avl.h \ - ../Geo/SPoint2.h ../Geo/ExtrudeParams.h ../Common/SmoothData.h \ - ../Post/PView.h ../Graphics/gl2ps.h + ../Common/ListUtils.h ../Common/TreeUtils.h ../Common/avl.h \ + ../Common/ListUtils.h ../Geo/SPoint2.h ../Geo/ExtrudeParams.h \ + ../Common/SmoothData.h ../Post/PView.h ../Graphics/gl2ps.h Opengl_Window.o: Opengl_Window.cpp ../Common/GmshUI.h \ ../Common/GmshDefines.h ../Common/Message.h ../Numeric/Numeric.h \ ../Numeric/NumericEmbedded.h ../Common/Context.h ../Graphics/Draw.h \ @@ -240,21 +242,21 @@ Opengl_Window.o: Opengl_Window.cpp ../Common/GmshUI.h \ SpherePosition_Widget.h ../Mesh/Field.h ../Geo/Geo.h \ ../Geo/gmshSurface.h ../Geo/Pair.h ../Geo/Range.h ../Geo/SPoint2.h \ ../Geo/SPoint3.h ../Geo/SVector3.h ../Geo/SBoundingBox3d.h \ - ../DataStr/gmshList.h ../DataStr/Tree.h ../DataStr/avl.h \ - ../Geo/SPoint2.h ../Geo/ExtrudeParams.h ../Common/SmoothData.h \ - ../Post/PView.h ../Geo/MElement.h ../Geo/MVertex.h ../Geo/SPoint3.h \ - ../Geo/MEdge.h ../Geo/MVertex.h ../Geo/SVector3.h ../Geo/MFace.h \ - ../Geo/MVertex.h ../Geo/SVector3.h + ../Common/ListUtils.h ../Common/TreeUtils.h ../Common/avl.h \ + ../Common/ListUtils.h ../Geo/SPoint2.h ../Geo/ExtrudeParams.h \ + ../Common/SmoothData.h ../Post/PView.h ../Geo/MElement.h \ + ../Geo/MVertex.h ../Geo/SPoint3.h ../Geo/MEdge.h ../Geo/MVertex.h \ + ../Geo/SVector3.h ../Geo/MFace.h ../Geo/MVertex.h ../Geo/SVector3.h Colorbar_Window.o: Colorbar_Window.cpp ../Common/GmshUI.h GUI.h \ Opengl_Window.h Colorbar_Window.h ../Post/ColorTable.h Popup_Button.h \ SpherePosition_Widget.h ../Mesh/Field.h ../Geo/Geo.h \ ../Common/GmshDefines.h ../Geo/gmshSurface.h ../Geo/Pair.h \ ../Geo/Range.h ../Geo/SPoint2.h ../Geo/SPoint3.h ../Geo/SVector3.h \ ../Geo/SPoint3.h ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h \ - ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h ../DataStr/gmshList.h \ - ../DataStr/Tree.h ../DataStr/avl.h ../Geo/SPoint2.h \ - ../Geo/ExtrudeParams.h ../Common/SmoothData.h ../Post/PView.h \ - ../Common/Context.h + ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h ../Common/ListUtils.h \ + ../Common/TreeUtils.h ../Common/avl.h ../Common/ListUtils.h \ + ../Geo/SPoint2.h ../Geo/ExtrudeParams.h ../Common/SmoothData.h \ + ../Post/PView.h ../Common/Context.h Solvers.o: Solvers.cpp ../Common/Message.h Solvers.h GmshServer.h \ ../Parser/OpenFile.h ../Common/GmshUI.h GUI.h Opengl_Window.h \ Colorbar_Window.h ../Post/ColorTable.h Popup_Button.h \ @@ -262,7 +264,7 @@ Solvers.o: Solvers.cpp ../Common/Message.h Solvers.h GmshServer.h \ ../Common/GmshDefines.h ../Geo/gmshSurface.h ../Geo/Pair.h \ ../Geo/Range.h ../Geo/SPoint2.h ../Geo/SPoint3.h ../Geo/SVector3.h \ ../Geo/SPoint3.h ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h \ - ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h ../DataStr/gmshList.h \ - ../DataStr/Tree.h ../DataStr/avl.h ../Geo/SPoint2.h \ - ../Geo/ExtrudeParams.h ../Common/SmoothData.h ../Post/PView.h \ - ../Graphics/Draw.h ../Common/Context.h + ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h ../Common/ListUtils.h \ + ../Common/TreeUtils.h ../Common/avl.h ../Common/ListUtils.h \ + ../Geo/SPoint2.h ../Geo/ExtrudeParams.h ../Common/SmoothData.h \ + ../Post/PView.h ../Graphics/Draw.h ../Common/Context.h diff --git a/Geo/GModelIO_Fourier.cpp b/Geo/GModelIO_Fourier.cpp index d4a836a0b3f57682e25664f8072e591d79dc5b41..2e9f0e2279894f293b1922602aebcf87f27241ff 100644 --- a/Geo/GModelIO_Fourier.cpp +++ b/Geo/GModelIO_Fourier.cpp @@ -109,6 +109,7 @@ int GModel::readFourier() { _createFMInternals(); getFMInternals()->loadFM(); + return 1; } int GModel::readFourier(const std::string &filename) @@ -122,7 +123,7 @@ int GModel::readFourier(const std::string &filename) int GModel::writeFourier(const std::string &filename) { - FILE *fp = fopen(filename.c_str(), "w"); + return 0; } #else diff --git a/Geo/GModelIO_Geo.cpp b/Geo/GModelIO_Geo.cpp index 2678e14afd6269e91ec6c65a6070f3db297a902c..4cb3e19a5e6e3da1012aff87312b54074d5c03ea 100644 --- a/Geo/GModelIO_Geo.cpp +++ b/Geo/GModelIO_Geo.cpp @@ -1,4 +1,4 @@ -// $Id: GModelIO_Geo.cpp,v 1.23 2008-06-05 11:52:49 samtech Exp $ +// $Id: GModelIO_Geo.cpp,v 1.24 2008-06-07 17:20:46 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -23,8 +23,8 @@ #include "GModel.h" #include "Geo.h" #include "OpenFile.h" -#include "Tools.h" #include "Numeric.h" +#include "ListUtils.h" #include "Message.h" #include "gmshVertex.h" #include "gmshFace.h" diff --git a/Geo/GModelIO_Mesh.cpp b/Geo/GModelIO_Mesh.cpp index 91073a7b51ed827319effd8b5d67729cba6c00cc..94d6715e4cc0bd7958ab3cf1b708ff7eca286f4b 100644 --- a/Geo/GModelIO_Mesh.cpp +++ b/Geo/GModelIO_Mesh.cpp @@ -1,4 +1,4 @@ -// $Id: GModelIO_Mesh.cpp,v 1.54 2008-06-05 11:52:49 samtech Exp $ +// $Id: GModelIO_Mesh.cpp,v 1.55 2008-06-07 17:20:46 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -2117,7 +2117,7 @@ int GModel::writeVTK(const std::string &name, bool binary, bool saveAll, for(unsigned int i = 0; i < entities.size(); i++){ if(entities[i]->physicals.size() || saveAll){ numElements += entities[i]->getNumMeshElements(); - for(int j = 0; j < entities[i]->getNumMeshElements(); j++){ + for(unsigned int j = 0; j < entities[i]->getNumMeshElements(); j++){ if(entities[i]->getMeshElement(j)->getTypeForVTK()) totalNumInt += entities[i]->getMeshElement(j)->getNumVertices() + 1; } diff --git a/Geo/Geo.cpp b/Geo/Geo.cpp index 559a1d76a816e137676b7985765499b1a0b05bd9..a068b31f59daa9593df6d4a6c2aebbbce416f502 100644 --- a/Geo/Geo.cpp +++ b/Geo/Geo.cpp @@ -1,4 +1,4 @@ -// $Id: Geo.cpp,v 1.111 2008-05-04 08:31:13 geuzaine Exp $ +// $Id: Geo.cpp,v 1.112 2008-06-07 17:20:46 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -22,8 +22,7 @@ #include <string.h> #include "Message.h" #include "Numeric.h" -#include "Malloc.h" -#include "Tools.h" +#include "MallocUtils.h" #include "Geo.h" #include "GModel.h" #include "GeoInterpolation.h" diff --git a/Geo/Geo.h b/Geo/Geo.h index d27e1ae5ed67adc305a33ddf3e5d6db25dbe99bd..c9339ac0586da23018edd7b115900fffc26054e2 100644 --- a/Geo/Geo.h +++ b/Geo/Geo.h @@ -24,8 +24,8 @@ #include <math.h> #include "GmshDefines.h" #include "gmshSurface.h" -#include "gmshList.h" -#include "Tree.h" +#include "ListUtils.h" +#include "TreeUtils.h" #include "SPoint2.h" #include "ExtrudeParams.h" diff --git a/Geo/GeoStringInterface.cpp b/Geo/GeoStringInterface.cpp index 75a5685350a3b3829af1383c4e2926f37ed6787f..fc6f82626728adcbd9bd99698bd5a004c8437225 100644 --- a/Geo/GeoStringInterface.cpp +++ b/Geo/GeoStringInterface.cpp @@ -1,4 +1,4 @@ -// $Id: GeoStringInterface.cpp,v 1.22 2008-05-06 21:11:47 geuzaine Exp $ +// $Id: GeoStringInterface.cpp,v 1.23 2008-06-07 17:20:46 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -23,7 +23,7 @@ #include <sstream> #include "Message.h" #include "Numeric.h" -#include "Malloc.h" +#include "MallocUtils.h" #include "Geo.h" #include "GeoStringInterface.h" #include "Parser.h" diff --git a/Geo/GeoStringInterface.h b/Geo/GeoStringInterface.h index cf820c675089a49f614419f6ed9b0f2f18956088..677e2977b9abd411a07c5a8d270dcf5993743fa7 100644 --- a/Geo/GeoStringInterface.h +++ b/Geo/GeoStringInterface.h @@ -20,7 +20,7 @@ // // Please report all bugs and problems to <gmsh@geuz.org>. -#include "gmshList.h" +#include "ListUtils.h" double evaluate_scalarfunction(const char *var, double val, const char *funct); diff --git a/Geo/Makefile b/Geo/Makefile index ba60d87b7b979df096806f6e4da2cf3190b93f40..0572e42d00758a29c6cf13fea9b3be665157d283 100644 --- a/Geo/Makefile +++ b/Geo/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.212 2008-06-05 16:52:14 geuzaine Exp $ +# $Id: Makefile,v 1.213 2008-06-07 17:20:46 geuzaine Exp $ # # Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle # @@ -23,7 +23,7 @@ include ../variables LIB = ../lib/libGmshGeo${LIBEXT} -INC = ${DASH}I../Common ${DASH}I../DataStr ${DASH}I../Geo ${DASH}I../Mesh\ +INC = ${DASH}I../Common ${DASH}I../Geo ${DASH}I../Mesh\ ${DASH}I../Post ${DASH}I../Numeric ${DASH}I../Parser ${DASH}I../Fltk\ ${DASH}I../contrib/NR ${DASH}I../contrib/ANN/include\ ${DASH}I../contrib/MathEval @@ -110,30 +110,30 @@ gmshVertex.o: gmshVertex.cpp GFace.h GEntity.h Range.h SPoint3.h \ SBoundingBox3d.h GPoint.h GEdgeLoop.h GEdge.h GVertex.h SPoint2.h \ SVector3.h Pair.h gmshVertex.h Geo.h ../Common/GmshDefines.h \ gmshSurface.h ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h \ - ../DataStr/gmshList.h ../DataStr/Tree.h ../DataStr/avl.h \ - ExtrudeParams.h ../Common/SmoothData.h MVertex.h GeoInterpolation.h \ - ../Common/Message.h + ../Common/ListUtils.h ../Common/TreeUtils.h ../Common/avl.h \ + ../Common/ListUtils.h ExtrudeParams.h ../Common/SmoothData.h MVertex.h \ + GeoInterpolation.h ../Common/Message.h gmshEdge.o: gmshEdge.cpp GModel.h GVertex.h GEntity.h Range.h SPoint3.h \ SBoundingBox3d.h GPoint.h SPoint2.h GEdge.h SVector3.h GFace.h \ GEdgeLoop.h Pair.h GRegion.h gmshEdge.h Geo.h ../Common/GmshDefines.h \ gmshSurface.h ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h \ - ../DataStr/gmshList.h ../DataStr/Tree.h ../DataStr/avl.h \ - ExtrudeParams.h ../Common/SmoothData.h GeoInterpolation.h \ - ../Common/Message.h ../Common/Context.h + ../Common/ListUtils.h ../Common/TreeUtils.h ../Common/avl.h \ + ../Common/ListUtils.h ExtrudeParams.h ../Common/SmoothData.h \ + GeoInterpolation.h ../Common/Message.h ../Common/Context.h gmshFace.o: gmshFace.cpp GModel.h GVertex.h GEntity.h Range.h SPoint3.h \ SBoundingBox3d.h GPoint.h SPoint2.h GEdge.h SVector3.h GFace.h \ GEdgeLoop.h Pair.h GRegion.h gmshFace.h Geo.h ../Common/GmshDefines.h \ gmshSurface.h ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h \ - ../DataStr/gmshList.h ../DataStr/Tree.h ../DataStr/avl.h \ - ExtrudeParams.h ../Common/SmoothData.h GeoInterpolation.h \ - ../Common/Message.h + ../Common/ListUtils.h ../Common/TreeUtils.h ../Common/avl.h \ + ../Common/ListUtils.h ExtrudeParams.h ../Common/SmoothData.h \ + GeoInterpolation.h ../Common/Message.h gmshRegion.o: gmshRegion.cpp GModel.h GVertex.h GEntity.h Range.h \ SPoint3.h SBoundingBox3d.h GPoint.h SPoint2.h GEdge.h SVector3.h \ GFace.h GEdgeLoop.h Pair.h GRegion.h gmshRegion.h Geo.h \ ../Common/GmshDefines.h gmshSurface.h ../Numeric/Numeric.h \ - ../Numeric/NumericEmbedded.h ../DataStr/gmshList.h ../DataStr/Tree.h \ - ../DataStr/avl.h ExtrudeParams.h ../Common/SmoothData.h \ - ../Common/Message.h + ../Numeric/NumericEmbedded.h ../Common/ListUtils.h \ + ../Common/TreeUtils.h ../Common/avl.h ../Common/ListUtils.h \ + ExtrudeParams.h ../Common/SmoothData.h ../Common/Message.h gmshSurface.o: gmshSurface.cpp gmshSurface.h Pair.h Range.h SPoint2.h \ SPoint3.h SVector3.h SBoundingBox3d.h ../Numeric/Numeric.h \ ../Numeric/NumericEmbedded.h ../Common/Message.h @@ -159,20 +159,23 @@ discreteEdge.o: discreteEdge.cpp discreteEdge.h GModel.h GVertex.h \ GEntity.h Range.h SPoint3.h SBoundingBox3d.h GPoint.h SPoint2.h GEdge.h \ SVector3.h GFace.h GEdgeLoop.h Pair.h GRegion.h Geo.h \ ../Common/GmshDefines.h gmshSurface.h ../Numeric/Numeric.h \ - ../Numeric/NumericEmbedded.h ../DataStr/gmshList.h ../DataStr/Tree.h \ - ../DataStr/avl.h ExtrudeParams.h ../Common/SmoothData.h + ../Numeric/NumericEmbedded.h ../Common/ListUtils.h \ + ../Common/TreeUtils.h ../Common/avl.h ../Common/ListUtils.h \ + ExtrudeParams.h ../Common/SmoothData.h discreteFace.o: discreteFace.cpp discreteFace.h GModel.h GVertex.h \ GEntity.h Range.h SPoint3.h SBoundingBox3d.h GPoint.h SPoint2.h GEdge.h \ SVector3.h GFace.h GEdgeLoop.h Pair.h GRegion.h Geo.h \ ../Common/GmshDefines.h gmshSurface.h ../Numeric/Numeric.h \ - ../Numeric/NumericEmbedded.h ../DataStr/gmshList.h ../DataStr/Tree.h \ - ../DataStr/avl.h ExtrudeParams.h ../Common/SmoothData.h + ../Numeric/NumericEmbedded.h ../Common/ListUtils.h \ + ../Common/TreeUtils.h ../Common/avl.h ../Common/ListUtils.h \ + ExtrudeParams.h ../Common/SmoothData.h discreteRegion.o: discreteRegion.cpp discreteRegion.h GModel.h GVertex.h \ GEntity.h Range.h SPoint3.h SBoundingBox3d.h GPoint.h SPoint2.h GEdge.h \ SVector3.h GFace.h GEdgeLoop.h Pair.h GRegion.h Geo.h \ ../Common/GmshDefines.h gmshSurface.h ../Numeric/Numeric.h \ - ../Numeric/NumericEmbedded.h ../DataStr/gmshList.h ../DataStr/Tree.h \ - ../DataStr/avl.h ExtrudeParams.h ../Common/SmoothData.h + ../Numeric/NumericEmbedded.h ../Common/ListUtils.h \ + ../Common/TreeUtils.h ../Common/avl.h ../Common/ListUtils.h \ + ExtrudeParams.h ../Common/SmoothData.h fourierEdge.o: fourierEdge.cpp fourierEdge.h GEdge.h GEntity.h Range.h \ SPoint3.h SBoundingBox3d.h GVertex.h GPoint.h SPoint2.h SVector3.h \ GModel.h GFace.h GEdgeLoop.h Pair.h GRegion.h fourierVertex.h MVertex.h \ @@ -192,20 +195,20 @@ GModel.o: GModel.cpp GModel.h GVertex.h GEntity.h Range.h SPoint3.h \ MVertex.h MEdge.h MFace.h discreteRegion.h discreteFace.h \ discreteEdge.h discreteVertex.h ../Common/Message.h gmshSurface.h \ ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h ../Mesh/Field.h \ - ../Geo/Geo.h ../Geo/gmshSurface.h ../DataStr/gmshList.h \ - ../DataStr/Tree.h ../DataStr/avl.h ../Geo/SPoint2.h \ - ../Geo/ExtrudeParams.h ../Common/SmoothData.h ../Post/PView.h \ - ../Geo/SPoint3.h ../Mesh/Generator.h ../Common/Context.h + ../Geo/Geo.h ../Geo/gmshSurface.h ../Common/ListUtils.h \ + ../Common/TreeUtils.h ../Common/avl.h ../Common/ListUtils.h \ + ../Geo/SPoint2.h ../Geo/ExtrudeParams.h ../Common/SmoothData.h \ + ../Post/PView.h ../Geo/SPoint3.h ../Mesh/Generator.h \ + ../Common/Context.h GModelIO_Geo.o: GModelIO_Geo.cpp GModel.h GVertex.h GEntity.h Range.h \ SPoint3.h SBoundingBox3d.h GPoint.h SPoint2.h GEdge.h SVector3.h \ GFace.h GEdgeLoop.h Pair.h GRegion.h Geo.h ../Common/GmshDefines.h \ gmshSurface.h ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h \ - ../DataStr/gmshList.h ../DataStr/Tree.h ../DataStr/avl.h \ - ExtrudeParams.h ../Common/SmoothData.h ../Parser/OpenFile.h \ - ../DataStr/Tools.h ../DataStr/gmshList.h ../DataStr/Tree.h \ - ../Common/Message.h gmshVertex.h MVertex.h gmshFace.h gmshEdge.h \ - gmshRegion.h ../Parser/Parser.h ../Mesh/Field.h ../Geo/Geo.h \ - ../Post/PView.h ../Geo/SPoint3.h + ../Common/ListUtils.h ../Common/TreeUtils.h ../Common/avl.h \ + ../Common/ListUtils.h ExtrudeParams.h ../Common/SmoothData.h \ + ../Parser/OpenFile.h ../Common/Message.h gmshVertex.h MVertex.h \ + gmshFace.h gmshEdge.h gmshRegion.h ../Parser/Parser.h ../Mesh/Field.h \ + ../Geo/Geo.h ../Post/PView.h ../Geo/SPoint3.h GModelIO_Mesh.o: GModelIO_Mesh.cpp GModel.h GVertex.h GEntity.h Range.h \ SPoint3.h SBoundingBox3d.h GPoint.h SPoint2.h GEdge.h SVector3.h \ GFace.h GEdgeLoop.h Pair.h GRegion.h ../Common/GmshDefines.h MElement.h \ @@ -233,36 +236,38 @@ GModelIO_MED.o: GModelIO_MED.cpp GModel.h GVertex.h GEntity.h Range.h \ ExtrudeParams.o: ExtrudeParams.cpp ../Common/Message.h Geo.h \ ../Common/GmshDefines.h gmshSurface.h Pair.h Range.h SPoint2.h \ SPoint3.h SVector3.h SBoundingBox3d.h ../Numeric/Numeric.h \ - ../Numeric/NumericEmbedded.h ../DataStr/gmshList.h ../DataStr/Tree.h \ - ../DataStr/avl.h ExtrudeParams.h ../Common/SmoothData.h + ../Numeric/NumericEmbedded.h ../Common/ListUtils.h \ + ../Common/TreeUtils.h ../Common/avl.h ../Common/ListUtils.h \ + ExtrudeParams.h ../Common/SmoothData.h Geo.o: Geo.cpp ../Common/Message.h ../Numeric/Numeric.h \ - ../Numeric/NumericEmbedded.h ../DataStr/Malloc.h ../DataStr/Tools.h \ - ../DataStr/gmshList.h ../DataStr/Tree.h ../DataStr/avl.h Geo.h \ + ../Numeric/NumericEmbedded.h ../Common/MallocUtils.h Geo.h \ ../Common/GmshDefines.h gmshSurface.h Pair.h Range.h SPoint2.h \ - SPoint3.h SVector3.h SBoundingBox3d.h ExtrudeParams.h \ - ../Common/SmoothData.h GModel.h GVertex.h GEntity.h GPoint.h GEdge.h \ - GFace.h GEdgeLoop.h GRegion.h GeoInterpolation.h ../Parser/Parser.h \ - ../Mesh/Field.h ../Geo/Geo.h ../Post/PView.h ../Geo/SPoint3.h \ - ../Common/Context.h + SPoint3.h SVector3.h SBoundingBox3d.h ../Common/ListUtils.h \ + ../Common/TreeUtils.h ../Common/avl.h ../Common/ListUtils.h \ + ExtrudeParams.h ../Common/SmoothData.h GModel.h GVertex.h GEntity.h \ + GPoint.h GEdge.h GFace.h GEdgeLoop.h GRegion.h GeoInterpolation.h \ + ../Parser/Parser.h ../Mesh/Field.h ../Geo/Geo.h ../Post/PView.h \ + ../Geo/SPoint3.h ../Common/Context.h GeoStringInterface.o: GeoStringInterface.cpp ../Common/Message.h \ - ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h ../DataStr/Malloc.h \ - Geo.h ../Common/GmshDefines.h gmshSurface.h Pair.h Range.h SPoint2.h \ - SPoint3.h SVector3.h SBoundingBox3d.h ../DataStr/gmshList.h \ - ../DataStr/Tree.h ../DataStr/avl.h ExtrudeParams.h \ - ../Common/SmoothData.h GeoStringInterface.h ../Parser/Parser.h \ - ../Parser/OpenFile.h ../Common/Context.h GModel.h GVertex.h GEntity.h \ - GPoint.h GEdge.h GFace.h GEdgeLoop.h GRegion.h + ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h \ + ../Common/MallocUtils.h Geo.h ../Common/GmshDefines.h gmshSurface.h \ + Pair.h Range.h SPoint2.h SPoint3.h SVector3.h SBoundingBox3d.h \ + ../Common/ListUtils.h ../Common/TreeUtils.h ../Common/avl.h \ + ../Common/ListUtils.h ExtrudeParams.h ../Common/SmoothData.h \ + GeoStringInterface.h ../Parser/Parser.h ../Parser/OpenFile.h \ + ../Common/Context.h GModel.h GVertex.h GEntity.h GPoint.h GEdge.h \ + GFace.h GEdgeLoop.h GRegion.h GeoInterpolation.o: GeoInterpolation.cpp ../Common/Message.h Geo.h \ ../Common/GmshDefines.h gmshSurface.h Pair.h Range.h SPoint2.h \ SPoint3.h SVector3.h SBoundingBox3d.h ../Numeric/Numeric.h \ - ../Numeric/NumericEmbedded.h ../DataStr/gmshList.h ../DataStr/Tree.h \ - ../DataStr/avl.h ExtrudeParams.h ../Common/SmoothData.h \ - GeoInterpolation.h GeoStringInterface.h + ../Numeric/NumericEmbedded.h ../Common/ListUtils.h \ + ../Common/TreeUtils.h ../Common/avl.h ../Common/ListUtils.h \ + ExtrudeParams.h ../Common/SmoothData.h GeoInterpolation.h \ + GeoStringInterface.h findLinks.o: findLinks.cpp ../Common/Message.h GModel.h GVertex.h \ GEntity.h Range.h SPoint3.h SBoundingBox3d.h GPoint.h SPoint2.h GEdge.h \ - SVector3.h GFace.h GEdgeLoop.h Pair.h GRegion.h ../DataStr/Tree.h \ - ../DataStr/avl.h ../DataStr/gmshList.h ../DataStr/Tools.h \ - ../DataStr/gmshList.h ../DataStr/Tree.h + SVector3.h GFace.h GEdgeLoop.h Pair.h GRegion.h ../Common/TreeUtils.h \ + ../Common/avl.h ../Common/ListUtils.h MVertex.o: MVertex.cpp MVertex.h SPoint3.h GEdge.h GEntity.h Range.h \ SBoundingBox3d.h GVertex.h GPoint.h SPoint2.h SVector3.h GFace.h \ GEdgeLoop.h Pair.h ../Common/Message.h diff --git a/Geo/findLinks.cpp b/Geo/findLinks.cpp index 02ed3e7030f5944a574f3bfa560078d9caddba2a..989f1603bb4ba4753735fbf98b0f28462c7c691e 100644 --- a/Geo/findLinks.cpp +++ b/Geo/findLinks.cpp @@ -1,4 +1,4 @@ -// $Id: findLinks.cpp,v 1.10 2008-06-05 13:57:47 samtech Exp $ +// $Id: findLinks.cpp,v 1.11 2008-06-07 17:20:46 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -22,9 +22,8 @@ #include <stdlib.h> #include "Message.h" #include "GModel.h" -#include "Tree.h" -#include "gmshList.h" -#include "Tools.h" +#include "TreeUtils.h" +#include "ListUtils.h" typedef struct{ int n, a; diff --git a/Geo/findLinks.h b/Geo/findLinks.h index 314d2f4bdc2f4c1e9776e7bfa1af73cc65ab6e93..871662cc315be1788487ce1160d5234dbc15e609 100644 --- a/Geo/findLinks.h +++ b/Geo/findLinks.h @@ -20,7 +20,7 @@ // // Please report all bugs and problems to <gmsh@geuz.org>. -#include "gmshList.h" +#include "ListUtils.h" int allEdgesLinked(int ed, List_T *edges); int allFacesLinked(int fac, List_T *faces); diff --git a/Graphics/Makefile b/Graphics/Makefile index 89be38390125a242a22cb78d1ea9e282a32af481..5dc9dde12ec204038e375b67419ea94507899237 100644 --- a/Graphics/Makefile +++ b/Graphics/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.154 2008-06-05 16:52:14 geuzaine Exp $ +# $Id: Makefile,v 1.155 2008-06-07 17:20:47 geuzaine Exp $ # # Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle # @@ -23,7 +23,7 @@ include ../variables LIB = ../lib/libGmshGraphics${LIBEXT} -INC = ${DASH}I../Common ${DASH}I../DataStr ${DASH}I../Geo ${DASH}I../Mesh\ +INC = ${DASH}I../Common ${DASH}I../Geo ${DASH}I../Mesh\ ${DASH}I../Post ${DASH}I../Graphics ${DASH}I../Fltk ${DASH}I../Numeric\ ${DASH}I../Parser ${DASH}I../Plugin ${DASH}I../contrib/MathEval\ ${DASH}I../contrib/ANN/include @@ -133,7 +133,7 @@ Entity.o: Entity.cpp ../Common/GmshUI.h ../Numeric/Numeric.h \ ReadImg.o: ReadImg.cpp ReadImg.h ../Common/Message.h ../Common/GmshUI.h \ ../Post/PView.h ../Geo/SPoint3.h ../Post/PViewDataList.h \ ../Post/PViewData.h ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h \ - ../DataStr/gmshList.h + ../Common/ListUtils.h Scale.o: Scale.cpp ../Common/GmshUI.h Draw.h ../Geo/SBoundingBox3d.h \ ../Geo/SPoint3.h ../Post/PView.h ../Post/PViewOptions.h \ ../Post/ColorTable.h ../Post/PViewData.h ../Common/Context.h gl2ps.h @@ -142,18 +142,18 @@ Graph2D.o: Graph2D.cpp ../Common/GmshUI.h Draw.h ../Geo/SBoundingBox3d.h \ ../Post/ColorTable.h ../Post/PViewData.h gl2ps.h ../Common/Context.h \ ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h gl2ps.o: gl2ps.cpp gl2ps.h -gl2gif.o: gl2gif.cpp gl2gif.h PixelBuffer.h ../Common/GmshUI.h \ - ../Common/Message.h ../DataStr/Malloc.h Draw.h ../Geo/SBoundingBox3d.h \ +gl2gif.o: gl2gif.cpp ../Common/MallocUtils.h gl2gif.h PixelBuffer.h \ + ../Common/GmshUI.h ../Common/Message.h Draw.h ../Geo/SBoundingBox3d.h \ ../Geo/SPoint3.h gl2jpeg.o: gl2jpeg.cpp gl2jpeg.h PixelBuffer.h ../Common/GmshUI.h \ - ../Common/Message.h ../DataStr/Malloc.h Draw.h ../Geo/SBoundingBox3d.h \ - ../Geo/SPoint3.h + ../Common/Message.h ../Common/MallocUtils.h Draw.h \ + ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h gl2png.o: gl2png.cpp gl2png.h PixelBuffer.h ../Common/GmshUI.h \ - ../Common/Message.h ../DataStr/Malloc.h Draw.h ../Geo/SBoundingBox3d.h \ - ../Geo/SPoint3.h + ../Common/Message.h ../Common/MallocUtils.h Draw.h \ + ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h gl2ppm.o: gl2ppm.cpp gl2ppm.h PixelBuffer.h ../Common/GmshUI.h \ - ../Common/Message.h ../DataStr/Malloc.h Draw.h ../Geo/SBoundingBox3d.h \ - ../Geo/SPoint3.h -gl2yuv.o: gl2yuv.cpp gl2yuv.h PixelBuffer.h ../Common/GmshUI.h \ - ../Common/Message.h ../DataStr/Malloc.h Draw.h ../Geo/SBoundingBox3d.h \ + ../Common/Message.h ../Common/MallocUtils.h Draw.h \ + ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h +gl2yuv.o: gl2yuv.cpp ../Common/MallocUtils.h gl2yuv.h PixelBuffer.h \ + ../Common/GmshUI.h ../Common/Message.h Draw.h ../Geo/SBoundingBox3d.h \ ../Geo/SPoint3.h diff --git a/Graphics/PixelBuffer.h b/Graphics/PixelBuffer.h index f3f4a667afab0d5213cec752e7e9acc277fa9677..d12387b494bdf066c873b6aa31c87a428dbd7a1e 100644 --- a/Graphics/PixelBuffer.h +++ b/Graphics/PixelBuffer.h @@ -22,7 +22,7 @@ #include "GmshUI.h" #include "Message.h" -#include "Malloc.h" +#include "MallocUtils.h" #include "Draw.h" #if defined(HAVE_OSMESA) diff --git a/Graphics/Post.cpp b/Graphics/Post.cpp index 1060efe8d982da12939d9e0b0faf6275a15c9d47..4d07ee1d0a4e8585434941185f4b6738a1e91858 100644 --- a/Graphics/Post.cpp +++ b/Graphics/Post.cpp @@ -1,4 +1,4 @@ -// $Id: Post.cpp,v 1.167 2008-05-21 10:59:04 geuzaine Exp $ +// $Id: Post.cpp,v 1.168 2008-06-07 17:20:47 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -1017,7 +1017,7 @@ void drawVectorArray(PView *p, VertexArray *va) double l = sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); double lmax = opt->ArrowSizeProportional ? opt->TmpMax : l; if(l && lmax){ - double scale = scale = opt->ArrowSize / lmax; + double scale = opt->ArrowSize / lmax; // log scaling if(opt->ScaleType == PViewOptions::Logarithmic && opt->ArrowSizeProportional && opt->TmpMin > 0 && diff --git a/Graphics/gl2gif.cpp b/Graphics/gl2gif.cpp index 84409e415c9f3e3002db02cdc9e1691dc9c2e7bb..9930412e9683ab403a369fbfae18420864778d3f 100644 --- a/Graphics/gl2gif.cpp +++ b/Graphics/gl2gif.cpp @@ -1,4 +1,4 @@ -// $Id: gl2gif.cpp,v 1.25 2008-05-04 08:31:15 geuzaine Exp $ +// $Id: gl2gif.cpp,v 1.26 2008-06-07 17:20:47 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -61,6 +61,7 @@ * */ +#include "MallocUtils.h" #include "gl2gif.h" /* PPM colormap routines */ diff --git a/Graphics/gl2yuv.cpp b/Graphics/gl2yuv.cpp index e16291f72fa7153a932ea452d5746259606a549a..bdeabba936d261a964fdd6544d86336d24538ed7 100644 --- a/Graphics/gl2yuv.cpp +++ b/Graphics/gl2yuv.cpp @@ -1,4 +1,4 @@ -// $Id: gl2yuv.cpp,v 1.15 2008-05-04 08:31:15 geuzaine Exp $ +// $Id: gl2yuv.cpp,v 1.16 2008-06-07 17:20:47 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -45,7 +45,7 @@ * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ - +#include "MallocUtils.h" #include "gl2yuv.h" void create_yuv(FILE * outfile, PixelBuffer *buffer) diff --git a/Mesh/DivideAndConquer.cpp b/Mesh/DivideAndConquer.cpp index 44bc0ba7ad8e5bcefb8e25c89cb19ff59b25e6bb..2e5699da12931f7f9f88f8ad1287fa59868b52b2 100644 --- a/Mesh/DivideAndConquer.cpp +++ b/Mesh/DivideAndConquer.cpp @@ -1,4 +1,4 @@ -// $Id: DivideAndConquer.cpp,v 1.18 2008-05-04 08:31:15 geuzaine Exp $ +// $Id: DivideAndConquer.cpp,v 1.19 2008-06-07 17:20:48 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -34,7 +34,7 @@ #include "Message.h" #include "Numeric.h" #include "DivideAndConquer.h" -#include "Malloc.h" +#include "MallocUtils.h" #define Pred(x) ((x)->prev) #define Succ(x) ((x)->next) diff --git a/Mesh/Makefile b/Mesh/Makefile index df8c4004b4ceaa965e213eb0fd2697382303d9c0..97582f8029be44b6521a2b6fbd74daf0a6512c98 100644 --- a/Mesh/Makefile +++ b/Mesh/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.223 2008-06-05 16:52:14 geuzaine Exp $ +# $Id: Makefile,v 1.224 2008-06-07 17:20:48 geuzaine Exp $ # # Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle # @@ -23,7 +23,7 @@ include ../variables LIB = ../lib/libGmshMesh${LIBEXT} -INC = ${DASH}I../Numeric ${DASH}I../Common ${DASH}I../DataStr ${DASH}I../Geo\ +INC = ${DASH}I../Numeric ${DASH}I../Common ${DASH}I../Geo\ ${DASH}I../Mesh ${DASH}I../Post ${DASH}I../Graphics ${DASH}I../Parser\ ${DASH}I../Fltk ${DASH}I../contrib/NR ${DASH}I../contrib/Triangle\ ${DASH}I../contrib/Tetgen ${DASH}I../contrib/Netgen\ @@ -105,11 +105,11 @@ Field.o: Field.cpp ../Common/Context.h Field.h ../Geo/Geo.h \ ../Common/GmshDefines.h ../Geo/gmshSurface.h ../Geo/Pair.h \ ../Geo/Range.h ../Geo/SPoint2.h ../Geo/SPoint3.h ../Geo/SVector3.h \ ../Geo/SPoint3.h ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h \ - ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h ../DataStr/gmshList.h \ - ../DataStr/Tree.h ../DataStr/avl.h ../Geo/SPoint2.h \ - ../Geo/ExtrudeParams.h ../Common/SmoothData.h ../Post/PView.h \ - ../Geo/GeoInterpolation.h ../Geo/Geo.h ../Geo/GModel.h ../Geo/GVertex.h \ - ../Geo/GEntity.h ../Geo/Range.h ../Geo/SPoint3.h \ + ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h ../Common/ListUtils.h \ + ../Common/TreeUtils.h ../Common/avl.h ../Common/ListUtils.h \ + ../Geo/SPoint2.h ../Geo/ExtrudeParams.h ../Common/SmoothData.h \ + ../Post/PView.h ../Geo/GeoInterpolation.h ../Geo/Geo.h ../Geo/GModel.h \ + ../Geo/GVertex.h ../Geo/GEntity.h ../Geo/Range.h ../Geo/SPoint3.h \ ../Geo/SBoundingBox3d.h ../Geo/GPoint.h ../Geo/SPoint2.h ../Geo/GEdge.h \ ../Geo/GEntity.h ../Geo/GVertex.h ../Geo/SVector3.h ../Geo/SPoint3.h \ ../Geo/SPoint2.h ../Geo/GFace.h ../Geo/GEntity.h ../Geo/GPoint.h \ @@ -125,7 +125,7 @@ meshGEdge.o: meshGEdge.cpp meshGEdge.h ../Geo/GEdge.h ../Geo/GEntity.h \ ../Geo/MVertex.h ../Geo/SPoint3.h ../Geo/MEdge.h ../Geo/MVertex.h \ ../Geo/SVector3.h ../Geo/MFace.h ../Geo/MVertex.h ../Geo/SVector3.h \ BackgroundMesh.h ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h \ - ../Common/Message.h ../DataStr/gmshList.h ../Common/Context.h \ + ../Common/Message.h ../Common/ListUtils.h ../Common/Context.h \ ../Geo/GModel.h ../Geo/GVertex.h ../Geo/GEdge.h ../Geo/GFace.h \ ../Geo/GEntity.h ../Geo/GPoint.h ../Geo/GEdgeLoop.h ../Geo/GEdge.h \ ../Geo/SPoint2.h ../Geo/SVector3.h ../Geo/Pair.h ../Geo/GRegion.h \ @@ -159,9 +159,9 @@ meshGFace.o: meshGFace.cpp meshGFace.h meshGFaceBDS.h \ ../Numeric/NumericEmbedded.h BDS.h ../Post/PView.h qualityMeasures.h \ Field.h ../Geo/Geo.h ../Geo/gmshSurface.h ../Geo/Pair.h ../Geo/Range.h \ ../Geo/SPoint2.h ../Geo/SPoint3.h ../Geo/SVector3.h \ - ../Geo/SBoundingBox3d.h ../DataStr/gmshList.h ../DataStr/Tree.h \ - ../DataStr/avl.h ../Geo/SPoint2.h ../Geo/ExtrudeParams.h \ - ../Common/SmoothData.h ../Common/OS.h + ../Geo/SBoundingBox3d.h ../Common/ListUtils.h ../Common/TreeUtils.h \ + ../Common/avl.h ../Common/ListUtils.h ../Geo/SPoint2.h \ + ../Geo/ExtrudeParams.h ../Common/SmoothData.h ../Common/OS.h meshGFaceTransfinite.o: meshGFaceTransfinite.cpp meshGFace.h \ ../Geo/GVertex.h ../Geo/GEntity.h ../Geo/Range.h ../Geo/SPoint3.h \ ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Geo/GPoint.h \ @@ -204,9 +204,9 @@ meshGFaceBDS.o: meshGFaceBDS.cpp meshGFace.h meshGFaceOptimize.h \ BDS.h ../Post/PView.h qualityMeasures.h Field.h ../Geo/Geo.h \ ../Geo/gmshSurface.h ../Geo/Pair.h ../Geo/Range.h ../Geo/SPoint2.h \ ../Geo/SPoint3.h ../Geo/SVector3.h ../Geo/SBoundingBox3d.h \ - ../DataStr/gmshList.h ../DataStr/Tree.h ../DataStr/avl.h \ - ../Geo/SPoint2.h ../Geo/ExtrudeParams.h ../Common/SmoothData.h \ - ../Common/OS.h + ../Common/ListUtils.h ../Common/TreeUtils.h ../Common/avl.h \ + ../Common/ListUtils.h ../Geo/SPoint2.h ../Geo/ExtrudeParams.h \ + ../Common/SmoothData.h ../Common/OS.h meshGFaceDelaunayInsertion.o: meshGFaceDelaunayInsertion.cpp BDS.h \ ../Geo/GFace.h ../Geo/GEntity.h ../Geo/Range.h ../Geo/SPoint3.h \ ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Geo/GPoint.h \ @@ -245,10 +245,10 @@ meshGRegion.o: meshGRegion.cpp meshGRegion.h \ ../Geo/GRegion.h ../Geo/GEntity.h ../Geo/SBoundingBox3d.h \ ../Geo/gmshRegion.h ../Geo/Geo.h ../Geo/gmshSurface.h ../Geo/Pair.h \ ../Geo/Range.h ../Geo/SPoint2.h ../Geo/SPoint3.h ../Geo/SVector3.h \ - ../Geo/SBoundingBox3d.h ../DataStr/gmshList.h ../DataStr/Tree.h \ - ../DataStr/avl.h ../Geo/SPoint2.h ../Geo/ExtrudeParams.h \ - ../Common/SmoothData.h ../Geo/GRegion.h BDS.h ../Post/PView.h \ - ../Common/Message.h ../Common/Context.h + ../Geo/SBoundingBox3d.h ../Common/ListUtils.h ../Common/TreeUtils.h \ + ../Common/avl.h ../Common/ListUtils.h ../Geo/SPoint2.h \ + ../Geo/ExtrudeParams.h ../Common/SmoothData.h ../Geo/GRegion.h BDS.h \ + ../Post/PView.h ../Common/Message.h ../Common/Context.h meshGRegionDelaunayInsertion.o: meshGRegionDelaunayInsertion.cpp \ ../Common/OS.h BackgroundMesh.h meshGRegion.h meshGRegionLocalMeshMod.h \ meshGRegionDelaunayInsertion.h ../Geo/MElement.h \ @@ -309,7 +309,7 @@ meshGRegionLocalMeshMod.o: meshGRegionLocalMeshMod.cpp \ ../Geo/GEntity.h ../Common/Message.h DivideAndConquer.o: DivideAndConquer.cpp ../Common/Message.h \ ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h DivideAndConquer.h \ - ../DataStr/Malloc.h + ../Common/MallocUtils.h BackgroundMesh.o: BackgroundMesh.cpp ../Common/Message.h BackgroundMesh.h \ ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h ../Common/Context.h \ ../Geo/GVertex.h ../Geo/GEntity.h ../Geo/Range.h ../Geo/SPoint3.h \ @@ -322,9 +322,9 @@ BackgroundMesh.o: BackgroundMesh.cpp ../Common/Message.h BackgroundMesh.h \ ../Geo/GRegion.h ../Geo/GEntity.h ../Geo/SBoundingBox3d.h Field.h \ ../Geo/Geo.h ../Common/GmshDefines.h ../Geo/gmshSurface.h ../Geo/Pair.h \ ../Geo/Range.h ../Geo/SPoint2.h ../Geo/SPoint3.h ../Geo/SVector3.h \ - ../Geo/SBoundingBox3d.h ../DataStr/gmshList.h ../DataStr/Tree.h \ - ../DataStr/avl.h ../Geo/SPoint2.h ../Geo/ExtrudeParams.h \ - ../Common/SmoothData.h ../Post/PView.h + ../Geo/SBoundingBox3d.h ../Common/ListUtils.h ../Common/TreeUtils.h \ + ../Common/avl.h ../Common/ListUtils.h ../Geo/SPoint2.h \ + ../Geo/ExtrudeParams.h ../Common/SmoothData.h ../Post/PView.h qualityMeasures.o: qualityMeasures.cpp qualityMeasures.h BDS.h \ ../Geo/GFace.h ../Geo/GEntity.h ../Geo/Range.h ../Geo/SPoint3.h \ ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Geo/GPoint.h \ diff --git a/Mesh/meshGEdge.cpp b/Mesh/meshGEdge.cpp index 66285167b99bc2d8993ecb1454637190c25e1972..df13f58c60c9ca10ee41ff845c5e2f64b8d32677 100644 --- a/Mesh/meshGEdge.cpp +++ b/Mesh/meshGEdge.cpp @@ -1,4 +1,4 @@ -// $Id: meshGEdge.cpp,v 1.63 2008-06-05 13:57:47 samtech Exp $ +// $Id: meshGEdge.cpp,v 1.64 2008-06-07 17:20:48 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -26,7 +26,7 @@ #include "BackgroundMesh.h" #include "Numeric.h" #include "Message.h" -#include "gmshList.h" +#include "ListUtils.h" #include "Context.h" #include "GModel.h" diff --git a/Numeric/Makefile b/Numeric/Makefile index 3b0b7c8f1a3ee7a148e511adff81fec7736f3c32..86f342170cc48c2feb809ca048be5929e0e5d902 100644 --- a/Numeric/Makefile +++ b/Numeric/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.55 2008-06-05 16:52:14 geuzaine Exp $ +# $Id: Makefile,v 1.56 2008-06-07 17:20:48 geuzaine Exp $ # # Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle # @@ -23,7 +23,7 @@ include ../variables LIB = ../lib/libGmshNumeric${LIBEXT} -INC = ${DASH}I../Common ${DASH}I../DataStr ${DASH}I../Numeric ${DASH}I../contrib/NR +INC = ${DASH}I../Common ${DASH}I../Numeric ${DASH}I../contrib/NR CFLAGS = ${OPTIM} ${FLAGS} ${INC} ${SYSINCLUDE} diff --git a/Parser/Gmsh.tab.cpp b/Parser/Gmsh.tab.cpp index 80acf7ec551d46768fb49fe9d9ea0195b492dc4b..096fc2495486eab04fb82e90b96f5dc937180bb7 100644 --- a/Parser/Gmsh.tab.cpp +++ b/Parser/Gmsh.tab.cpp @@ -324,7 +324,7 @@ /* Copy the first part of user declarations. */ #line 1 "Gmsh.y" -// $Id: Gmsh.tab.cpp,v 1.366 2008-06-07 07:35:41 geuzaine Exp $ +// $Id: Gmsh.tab.cpp,v 1.367 2008-06-07 17:20:48 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -349,8 +349,9 @@ #include <stdarg.h> #include <time.h> #include "Message.h" -#include "Malloc.h" -#include "Tools.h" +#include "MallocUtils.h" +#include "ListUtils.h" +#include "TreeUtils.h" #include "Numeric.h" #include "Context.h" #include "GModel.h" @@ -423,7 +424,7 @@ int PrintListOfDouble(char *format, List_T *list, char *buffer); #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 81 "Gmsh.y" +#line 82 "Gmsh.y" { char *c; int i; @@ -434,7 +435,7 @@ typedef union YYSTYPE List_T *l; } /* Line 193 of yacc.c. */ -#line 438 "Gmsh.tab.cpp" +#line 439 "Gmsh.tab.cpp" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 @@ -447,7 +448,7 @@ typedef union YYSTYPE /* Line 216 of yacc.c. */ -#line 451 "Gmsh.tab.cpp" +#line 452 "Gmsh.tab.cpp" #ifdef short # undef short @@ -982,42 +983,42 @@ static const yytype_int16 yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 147, 147, 148, 153, 155, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 176, 180, 187, 192, 207, 220, 249, 263, 274, 289, - 294, 295, 296, 297, 298, 302, 304, 309, 311, 317, - 463, 316, 481, 488, 499, 498, 517, 524, 535, 534, - 552, 566, 586, 585, 599, 600, 601, 602, 603, 607, - 608, 615, 646, 685, 739, 756, 774, 785, 802, 809, - 824, 842, 868, 895, 909, 926, 941, 959, 979, 1002, - 1011, 1016, 1035, 1054, 1078, 1090, 1107, 1111, 1121, 1124, - 1142, 1164, 1180, 1202, 1220, 1238, 1256, 1282, 1300, 1326, - 1346, 1364, 1382, 1408, 1425, 1444, 1462, 1501, 1507, 1513, - 1520, 1545, 1570, 1586, 1606, 1624, 1641, 1662, 1667, 1672, - 1677, 1682, 1693, 1699, 1708, 1709, 1714, 1717, 1721, 1744, - 1767, 1790, 1818, 1827, 1831, 1846, 1862, 1879, 1893, 1899, - 1905, 1914, 1928, 1976, 1994, 2009, 2031, 2043, 2067, 2071, - 2076, 2081, 2093, 2110, 2127, 2154, 2181, 2212, 2220, 2226, - 2233, 2237, 2246, 2254, 2262, 2271, 2270, 2283, 2282, 2295, - 2294, 2307, 2306, 2318, 2317, 2333, 2340, 2347, 2354, 2361, - 2368, 2375, 2382, 2389, 2397, 2396, 2408, 2407, 2419, 2418, - 2430, 2429, 2441, 2440, 2452, 2451, 2463, 2462, 2474, 2473, - 2485, 2484, 2499, 2502, 2508, 2517, 2537, 2560, 2564, 2588, - 2606, 2624, 2642, 2671, 2706, 2711, 2738, 2752, 2765, 2782, - 2788, 2794, 2797, 2806, 2816, 2817, 2818, 2819, 2820, 2821, - 2822, 2823, 2824, 2831, 2832, 2833, 2834, 2835, 2836, 2837, - 2838, 2839, 2840, 2841, 2842, 2843, 2844, 2845, 2846, 2847, - 2848, 2849, 2850, 2851, 2852, 2853, 2854, 2855, 2856, 2857, - 2858, 2859, 2860, 2861, 2862, 2864, 2865, 2866, 2867, 2868, - 2869, 2870, 2871, 2872, 2873, 2874, 2875, 2876, 2877, 2878, - 2879, 2880, 2881, 2882, 2883, 2884, 2893, 2894, 2895, 2896, - 2897, 2898, 2899, 2903, 2919, 2934, 2954, 2967, 2980, 3003, - 3021, 3039, 3057, 3075, 3083, 3087, 3091, 3095, 3099, 3106, - 3110, 3114, 3118, 3125, 3130, 3138, 3143, 3147, 3152, 3156, - 3164, 3175, 3183, 3191, 3197, 3208, 3228, 3238, 3248, 3265, - 3292, 3297, 3301, 3305, 3318, 3322, 3334, 3341, 3362, 3366, - 3381, 3386, 3393, 3397, 3404, 3408, 3416, 3424, 3438, 3452, - 3456, 3475, 3498 + 0, 148, 148, 149, 154, 156, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 177, 181, 188, 193, 208, 221, 250, 264, 275, 290, + 295, 296, 297, 298, 299, 303, 305, 310, 312, 318, + 464, 317, 482, 489, 500, 499, 518, 525, 536, 535, + 553, 567, 587, 586, 600, 601, 602, 603, 604, 608, + 609, 616, 647, 686, 740, 757, 775, 786, 803, 810, + 825, 843, 869, 896, 910, 927, 942, 960, 980, 1003, + 1012, 1017, 1036, 1055, 1079, 1091, 1108, 1112, 1122, 1125, + 1143, 1165, 1181, 1203, 1221, 1239, 1257, 1283, 1301, 1327, + 1347, 1365, 1383, 1409, 1426, 1445, 1463, 1502, 1508, 1514, + 1521, 1546, 1571, 1587, 1607, 1625, 1642, 1663, 1668, 1673, + 1678, 1683, 1694, 1700, 1709, 1710, 1715, 1718, 1722, 1745, + 1768, 1791, 1819, 1828, 1832, 1847, 1863, 1880, 1894, 1900, + 1906, 1915, 1929, 1977, 1995, 2010, 2032, 2044, 2068, 2072, + 2077, 2082, 2094, 2111, 2128, 2155, 2182, 2213, 2221, 2227, + 2234, 2238, 2247, 2255, 2263, 2272, 2271, 2284, 2283, 2296, + 2295, 2308, 2307, 2319, 2318, 2334, 2341, 2348, 2355, 2362, + 2369, 2376, 2383, 2390, 2398, 2397, 2409, 2408, 2420, 2419, + 2431, 2430, 2442, 2441, 2453, 2452, 2464, 2463, 2475, 2474, + 2486, 2485, 2500, 2503, 2509, 2518, 2538, 2561, 2565, 2589, + 2607, 2625, 2643, 2672, 2707, 2712, 2739, 2753, 2766, 2783, + 2789, 2795, 2798, 2807, 2817, 2818, 2819, 2820, 2821, 2822, + 2823, 2824, 2825, 2832, 2833, 2834, 2835, 2836, 2837, 2838, + 2839, 2840, 2841, 2842, 2843, 2844, 2845, 2846, 2847, 2848, + 2849, 2850, 2851, 2852, 2853, 2854, 2855, 2856, 2857, 2858, + 2859, 2860, 2861, 2862, 2863, 2865, 2866, 2867, 2868, 2869, + 2870, 2871, 2872, 2873, 2874, 2875, 2876, 2877, 2878, 2879, + 2880, 2881, 2882, 2883, 2884, 2885, 2894, 2895, 2896, 2897, + 2898, 2899, 2900, 2904, 2920, 2935, 2955, 2968, 2981, 3004, + 3022, 3040, 3058, 3076, 3084, 3088, 3092, 3096, 3100, 3107, + 3111, 3115, 3119, 3126, 3131, 3139, 3144, 3148, 3153, 3157, + 3165, 3176, 3184, 3192, 3198, 3209, 3229, 3239, 3249, 3266, + 3293, 3298, 3302, 3306, 3319, 3323, 3335, 3342, 3363, 3367, + 3382, 3387, 3394, 3398, 3405, 3409, 3417, 3425, 3439, 3453, + 3457, 3476, 3499 }; #endif @@ -3658,96 +3659,96 @@ yyreduce: switch (yyn) { case 3: -#line 148 "Gmsh.y" +#line 149 "Gmsh.y" { yyerrok; return 1; ;} break; case 6: -#line 159 "Gmsh.y" +#line 160 "Gmsh.y" { return 1; ;} break; case 7: -#line 160 "Gmsh.y" +#line 161 "Gmsh.y" { return 1; ;} break; case 8: -#line 161 "Gmsh.y" +#line 162 "Gmsh.y" { return 1; ;} break; case 9: -#line 162 "Gmsh.y" +#line 163 "Gmsh.y" { return 1; ;} break; case 10: -#line 163 "Gmsh.y" +#line 164 "Gmsh.y" { List_Delete((yyvsp[(1) - (1)].l)); return 1; ;} break; case 11: -#line 164 "Gmsh.y" +#line 165 "Gmsh.y" { return 1; ;} break; case 12: -#line 165 "Gmsh.y" +#line 166 "Gmsh.y" { return 1; ;} break; case 13: -#line 166 "Gmsh.y" +#line 167 "Gmsh.y" { return 1; ;} break; case 14: -#line 167 "Gmsh.y" +#line 168 "Gmsh.y" { List_Delete((yyvsp[(1) - (1)].l)); return 1; ;} break; case 15: -#line 168 "Gmsh.y" +#line 169 "Gmsh.y" { return 1; ;} break; case 16: -#line 169 "Gmsh.y" +#line 170 "Gmsh.y" { return 1; ;} break; case 17: -#line 170 "Gmsh.y" +#line 171 "Gmsh.y" { return 1; ;} break; case 18: -#line 171 "Gmsh.y" +#line 172 "Gmsh.y" { return 1; ;} break; case 19: -#line 172 "Gmsh.y" +#line 173 "Gmsh.y" { return 1; ;} break; case 20: -#line 177 "Gmsh.y" +#line 178 "Gmsh.y" { (yyval.c) = (char*)"w"; ;} break; case 21: -#line 181 "Gmsh.y" +#line 182 "Gmsh.y" { (yyval.c) = (char*)"a"; ;} break; case 22: -#line 188 "Gmsh.y" +#line 189 "Gmsh.y" { Msg::Direct((yyvsp[(3) - (5)].c)); Free((yyvsp[(3) - (5)].c)); @@ -3755,7 +3756,7 @@ yyreduce: break; case 23: -#line 193 "Gmsh.y" +#line 194 "Gmsh.y" { char tmpstring[1024]; FixRelativePath((yyvsp[(6) - (7)].c), tmpstring); @@ -3773,7 +3774,7 @@ yyreduce: break; case 24: -#line 208 "Gmsh.y" +#line 209 "Gmsh.y" { char tmpstring[1024]; int i = PrintListOfDouble((yyvsp[(3) - (7)].c), (yyvsp[(5) - (7)].l), tmpstring); @@ -3789,7 +3790,7 @@ yyreduce: break; case 25: -#line 221 "Gmsh.y" +#line 222 "Gmsh.y" { char tmpstring[1024]; int i = PrintListOfDouble((yyvsp[(3) - (9)].c), (yyvsp[(5) - (9)].l), tmpstring); @@ -3816,7 +3817,7 @@ yyreduce: break; case 26: -#line 250 "Gmsh.y" +#line 251 "Gmsh.y" { #if !defined(HAVE_NO_POST) if(!strcmp((yyvsp[(1) - (6)].c), "View") && ViewData->finalize()){ @@ -3833,7 +3834,7 @@ yyreduce: break; case 27: -#line 264 "Gmsh.y" +#line 265 "Gmsh.y" { #if !defined(HAVE_NO_POST) if(!strcmp((yyvsp[(2) - (6)].c), "View")){ @@ -3847,7 +3848,7 @@ yyreduce: break; case 28: -#line 275 "Gmsh.y" +#line 276 "Gmsh.y" { #if !defined(HAVE_NO_POST) if(!strcmp((yyvsp[(2) - (6)].c), "View")){ @@ -3861,7 +3862,7 @@ yyreduce: break; case 29: -#line 289 "Gmsh.y" +#line 290 "Gmsh.y" { #if !defined(HAVE_NO_POST) ViewData = new PViewDataList(true); @@ -3870,27 +3871,27 @@ yyreduce: break; case 35: -#line 303 "Gmsh.y" +#line 304 "Gmsh.y" { ViewCoord[ViewCoordIdx++] = (yyvsp[(1) - (1)].d); ;} break; case 36: -#line 305 "Gmsh.y" +#line 306 "Gmsh.y" { ViewCoord[ViewCoordIdx++] = (yyvsp[(3) - (3)].d); ;} break; case 37: -#line 310 "Gmsh.y" +#line 311 "Gmsh.y" { if(ViewValueList) List_Add(ViewValueList, &(yyvsp[(1) - (1)].d)); ;} break; case 38: -#line 312 "Gmsh.y" +#line 313 "Gmsh.y" { if(ViewValueList) List_Add(ViewValueList, &(yyvsp[(3) - (3)].d)); ;} break; case 39: -#line 317 "Gmsh.y" +#line 318 "Gmsh.y" { #if !defined(HAVE_NO_POST) if(!strcmp((yyvsp[(1) - (1)].c), "SP")){ @@ -4039,7 +4040,7 @@ yyreduce: break; case 40: -#line 463 "Gmsh.y" +#line 464 "Gmsh.y" { #if !defined(HAVE_NO_POST) if(ViewValueList){ @@ -4052,7 +4053,7 @@ yyreduce: break; case 41: -#line 473 "Gmsh.y" +#line 474 "Gmsh.y" { #if !defined(HAVE_NO_POST) if(ViewValueList) (*ViewNumList)++; @@ -4061,7 +4062,7 @@ yyreduce: break; case 42: -#line 482 "Gmsh.y" +#line 483 "Gmsh.y" { #if !defined(HAVE_NO_POST) for(int i = 0; i < (int)strlen((yyvsp[(1) - (1)].c))+1; i++) List_Add(ViewData->T2C, &(yyvsp[(1) - (1)].c)[i]); @@ -4071,7 +4072,7 @@ yyreduce: break; case 43: -#line 489 "Gmsh.y" +#line 490 "Gmsh.y" { #if !defined(HAVE_NO_POST) for(int i = 0; i < (int)strlen((yyvsp[(3) - (3)].c))+1; i++) List_Add(ViewData->T2C, &(yyvsp[(3) - (3)].c)[i]); @@ -4081,7 +4082,7 @@ yyreduce: break; case 44: -#line 499 "Gmsh.y" +#line 500 "Gmsh.y" { #if !defined(HAVE_NO_POST) List_Add(ViewData->T2D, &(yyvsp[(3) - (8)].d)); @@ -4094,7 +4095,7 @@ yyreduce: break; case 45: -#line 509 "Gmsh.y" +#line 510 "Gmsh.y" { #if !defined(HAVE_NO_POST) ViewData->NbT2++; @@ -4103,7 +4104,7 @@ yyreduce: break; case 46: -#line 518 "Gmsh.y" +#line 519 "Gmsh.y" { #if !defined(HAVE_NO_POST) for(int i = 0; i < (int)strlen((yyvsp[(1) - (1)].c))+1; i++) List_Add(ViewData->T3C, &(yyvsp[(1) - (1)].c)[i]); @@ -4113,7 +4114,7 @@ yyreduce: break; case 47: -#line 525 "Gmsh.y" +#line 526 "Gmsh.y" { #if !defined(HAVE_NO_POST) for(int i = 0; i < (int)strlen((yyvsp[(3) - (3)].c))+1; i++) List_Add(ViewData->T3C, &(yyvsp[(3) - (3)].c)[i]); @@ -4123,7 +4124,7 @@ yyreduce: break; case 48: -#line 535 "Gmsh.y" +#line 536 "Gmsh.y" { #if !defined(HAVE_NO_POST) List_Add(ViewData->T3D, &(yyvsp[(3) - (10)].d)); List_Add(ViewData->T3D, &(yyvsp[(5) - (10)].d)); @@ -4135,7 +4136,7 @@ yyreduce: break; case 49: -#line 544 "Gmsh.y" +#line 545 "Gmsh.y" { #if !defined(HAVE_NO_POST) ViewData->NbT3++; @@ -4144,7 +4145,7 @@ yyreduce: break; case 50: -#line 554 "Gmsh.y" +#line 555 "Gmsh.y" { #if !defined(HAVE_NO_POST) int type = @@ -4160,7 +4161,7 @@ yyreduce: break; case 51: -#line 570 "Gmsh.y" +#line 571 "Gmsh.y" { #if !defined(HAVE_NO_POST) int type = @@ -4176,7 +4177,7 @@ yyreduce: break; case 52: -#line 586 "Gmsh.y" +#line 587 "Gmsh.y" { #if !defined(HAVE_NO_POST) ViewValueList = ViewData->Time; @@ -4185,48 +4186,48 @@ yyreduce: break; case 53: -#line 592 "Gmsh.y" +#line 593 "Gmsh.y" { ;} break; case 54: -#line 599 "Gmsh.y" +#line 600 "Gmsh.y" { (yyval.i) = 0; ;} break; case 55: -#line 600 "Gmsh.y" +#line 601 "Gmsh.y" { (yyval.i) = 1; ;} break; case 56: -#line 601 "Gmsh.y" +#line 602 "Gmsh.y" { (yyval.i) = 2; ;} break; case 57: -#line 602 "Gmsh.y" +#line 603 "Gmsh.y" { (yyval.i) = 3; ;} break; case 58: -#line 603 "Gmsh.y" +#line 604 "Gmsh.y" { (yyval.i) = 4; ;} break; case 59: -#line 607 "Gmsh.y" +#line 608 "Gmsh.y" { (yyval.i) = 1; ;} break; case 60: -#line 608 "Gmsh.y" +#line 609 "Gmsh.y" { (yyval.i) = -1; ;} break; case 61: -#line 616 "Gmsh.y" +#line 617 "Gmsh.y" { Symbol TheSymbol; TheSymbol.Name = (yyvsp[(1) - (4)].c); @@ -4260,7 +4261,7 @@ yyreduce: break; case 62: -#line 647 "Gmsh.y" +#line 648 "Gmsh.y" { Symbol TheSymbol; TheSymbol.Name = (yyvsp[(1) - (7)].c); @@ -4302,7 +4303,7 @@ yyreduce: break; case 63: -#line 686 "Gmsh.y" +#line 687 "Gmsh.y" { if(List_Nbr((yyvsp[(4) - (9)].l)) != List_Nbr((yyvsp[(8) - (9)].l))){ yymsg(0, "Incompatible array dimensions in affectation"); @@ -4359,7 +4360,7 @@ yyreduce: break; case 64: -#line 740 "Gmsh.y" +#line 741 "Gmsh.y" { Symbol TheSymbol; TheSymbol.Name = (yyvsp[(1) - (6)].c); @@ -4379,7 +4380,7 @@ yyreduce: break; case 65: -#line 757 "Gmsh.y" +#line 758 "Gmsh.y" { // appends to the list Symbol TheSymbol; @@ -4400,7 +4401,7 @@ yyreduce: break; case 66: -#line 775 "Gmsh.y" +#line 776 "Gmsh.y" { Symbol TheSymbol; TheSymbol.Name = (yyvsp[(1) - (3)].c); @@ -4414,7 +4415,7 @@ yyreduce: break; case 67: -#line 786 "Gmsh.y" +#line 787 "Gmsh.y" { Symbol TheSymbol; TheSymbol.Name = (yyvsp[(1) - (6)].c); @@ -4433,14 +4434,14 @@ yyreduce: break; case 68: -#line 803 "Gmsh.y" +#line 804 "Gmsh.y" { Msg::Warning("Named string expressions not implemented yet"); ;} break; case 69: -#line 810 "Gmsh.y" +#line 811 "Gmsh.y" { const char* (*pStrOpt)(int num, int action, const char *value); StringXString *pStrCat; @@ -4458,7 +4459,7 @@ yyreduce: break; case 70: -#line 825 "Gmsh.y" +#line 826 "Gmsh.y" { const char* (*pStrOpt)(int num, int action, const char *value); StringXString *pStrCat; @@ -4476,7 +4477,7 @@ yyreduce: break; case 71: -#line 843 "Gmsh.y" +#line 844 "Gmsh.y" { double (*pNumOpt)(int num, int action, double value); StringXNumber *pNumCat; @@ -4505,7 +4506,7 @@ yyreduce: break; case 72: -#line 869 "Gmsh.y" +#line 870 "Gmsh.y" { double (*pNumOpt)(int num, int action, double value); StringXNumber *pNumCat; @@ -4535,7 +4536,7 @@ yyreduce: break; case 73: -#line 896 "Gmsh.y" +#line 897 "Gmsh.y" { double (*pNumOpt)(int num, int action, double value); StringXNumber *pNumCat; @@ -4552,7 +4553,7 @@ yyreduce: break; case 74: -#line 910 "Gmsh.y" +#line 911 "Gmsh.y" { double (*pNumOpt)(int num, int action, double value); StringXNumber *pNumCat; @@ -4569,7 +4570,7 @@ yyreduce: break; case 75: -#line 927 "Gmsh.y" +#line 928 "Gmsh.y" { unsigned int (*pColOpt)(int num, int action, unsigned int value); StringXColor *pColCat; @@ -4587,7 +4588,7 @@ yyreduce: break; case 76: -#line 942 "Gmsh.y" +#line 943 "Gmsh.y" { unsigned int (*pColOpt)(int num, int action, unsigned int value); StringXColor *pColCat; @@ -4605,7 +4606,7 @@ yyreduce: break; case 77: -#line 960 "Gmsh.y" +#line 961 "Gmsh.y" { GmshColorTable *ct = Get_ColorTable(0); if(!ct) @@ -4628,7 +4629,7 @@ yyreduce: break; case 78: -#line 980 "Gmsh.y" +#line 981 "Gmsh.y" { GmshColorTable *ct = Get_ColorTable((int)(yyvsp[(3) - (9)].d)); if(!ct) @@ -4651,7 +4652,7 @@ yyreduce: break; case 79: -#line 1003 "Gmsh.y" +#line 1004 "Gmsh.y" { if(!strcmp((yyvsp[(1) - (5)].c),"Background")){ GModel::current()->getFields()->background_field = (int)(yyvsp[(4) - (5)].d); @@ -4663,7 +4664,7 @@ yyreduce: break; case 80: -#line 1012 "Gmsh.y" +#line 1013 "Gmsh.y" { if(!GModel::current()->getFields()->new_field((int)(yyvsp[(3) - (7)].d), (yyvsp[(6) - (7)].c))) yymsg(0, "Cannot create field %i of type '%s'", (int)(yyvsp[(3) - (7)].d), (yyvsp[(6) - (7)].c)); @@ -4671,7 +4672,7 @@ yyreduce: break; case 81: -#line 1017 "Gmsh.y" +#line 1018 "Gmsh.y" { Field *field = GModel::current()->getFields()->get((int)(yyvsp[(3) - (9)].d)); if(field){ @@ -4693,7 +4694,7 @@ yyreduce: break; case 82: -#line 1036 "Gmsh.y" +#line 1037 "Gmsh.y" { Field *field = GModel::current()->getFields()->get((int)(yyvsp[(3) - (9)].d)); if(field){ @@ -4715,7 +4716,7 @@ yyreduce: break; case 83: -#line 1055 "Gmsh.y" +#line 1056 "Gmsh.y" { Field *field = GModel::current()->getFields()->get((int)(yyvsp[(3) - (11)].d)); if(field){ @@ -4739,7 +4740,7 @@ yyreduce: break; case 84: -#line 1079 "Gmsh.y" +#line 1080 "Gmsh.y" { #if !defined(HAVE_NO_POST) try { @@ -4754,7 +4755,7 @@ yyreduce: break; case 85: -#line 1091 "Gmsh.y" +#line 1092 "Gmsh.y" { #if !defined(HAVE_NO_POST) try { @@ -4769,14 +4770,14 @@ yyreduce: break; case 86: -#line 1108 "Gmsh.y" +#line 1109 "Gmsh.y" { (yyval.i) = (int)(yyvsp[(1) - (1)].d); ;} break; case 87: -#line 1112 "Gmsh.y" +#line 1113 "Gmsh.y" { (yyval.i) = GModel::current()->setPhysicalName (std::string((yyvsp[(1) - (1)].c)), ++GModel::current()->getGEOInternals()->MaxPhysicalNum); @@ -4785,14 +4786,14 @@ yyreduce: break; case 88: -#line 1121 "Gmsh.y" +#line 1122 "Gmsh.y" { (yyval.l) = 0; ;} break; case 89: -#line 1125 "Gmsh.y" +#line 1126 "Gmsh.y" { (yyval.l) = List_Create(4, 4, sizeof(double)); Vertex *v = FindPoint((int)(yyvsp[(4) - (5)].d)); @@ -4807,7 +4808,7 @@ yyreduce: break; case 90: -#line 1143 "Gmsh.y" +#line 1144 "Gmsh.y" { int num = (int)(yyvsp[(3) - (7)].d); if(FindPoint(num)){ @@ -4832,7 +4833,7 @@ yyreduce: break; case 91: -#line 1165 "Gmsh.y" +#line 1166 "Gmsh.y" { int num = (int)(yyvsp[(4) - (8)].i); if(FindPhysicalGroup(num, MSH_PHYSICAL_POINT)){ @@ -4851,7 +4852,7 @@ yyreduce: break; case 92: -#line 1181 "Gmsh.y" +#line 1182 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(3) - (6)].l)); i++){ double d; @@ -4873,7 +4874,7 @@ yyreduce: break; case 93: -#line 1203 "Gmsh.y" +#line 1204 "Gmsh.y" { int num = (int)(yyvsp[(3) - (7)].d); if(FindCurve(num)){ @@ -4894,7 +4895,7 @@ yyreduce: break; case 94: -#line 1221 "Gmsh.y" +#line 1222 "Gmsh.y" { int num = (int)(yyvsp[(3) - (7)].d); if(FindCurve(num)){ @@ -4915,7 +4916,7 @@ yyreduce: break; case 95: -#line 1239 "Gmsh.y" +#line 1240 "Gmsh.y" { int num = (int)(yyvsp[(3) - (7)].d); if(FindCurve(num)){ @@ -4936,7 +4937,7 @@ yyreduce: break; case 96: -#line 1257 "Gmsh.y" +#line 1258 "Gmsh.y" { int num = (int)(yyvsp[(3) - (9)].d); if(FindCurve(num)){ @@ -4965,7 +4966,7 @@ yyreduce: break; case 97: -#line 1283 "Gmsh.y" +#line 1284 "Gmsh.y" { int num = (int)(yyvsp[(3) - (7)].d); if(FindCurve(num)){ @@ -4986,7 +4987,7 @@ yyreduce: break; case 98: -#line 1301 "Gmsh.y" +#line 1302 "Gmsh.y" { int num = (int)(yyvsp[(3) - (9)].d); if(FindCurve(num)){ @@ -5015,7 +5016,7 @@ yyreduce: break; case 99: -#line 1328 "Gmsh.y" +#line 1329 "Gmsh.y" { int num = (int)(yyvsp[(3) - (17)].d); if(FindCurve(num)){ @@ -5037,7 +5038,7 @@ yyreduce: break; case 100: -#line 1347 "Gmsh.y" +#line 1348 "Gmsh.y" { int num = (int)(yyvsp[(3) - (7)].d); if(FindCurve(num)){ @@ -5058,7 +5059,7 @@ yyreduce: break; case 101: -#line 1365 "Gmsh.y" +#line 1366 "Gmsh.y" { int num = (int)(yyvsp[(3) - (7)].d); if(FindCurve(num)){ @@ -5079,7 +5080,7 @@ yyreduce: break; case 102: -#line 1383 "Gmsh.y" +#line 1384 "Gmsh.y" { int num = (int)(yyvsp[(3) - (11)].d); if(List_Nbr((yyvsp[(6) - (11)].l)) + (int)(yyvsp[(10) - (11)].d) + 1 != List_Nbr((yyvsp[(8) - (11)].l))){ @@ -5108,7 +5109,7 @@ yyreduce: break; case 103: -#line 1409 "Gmsh.y" +#line 1410 "Gmsh.y" { int num = (int)(yyvsp[(4) - (8)].d); if(FindEdgeLoop(num)){ @@ -5128,7 +5129,7 @@ yyreduce: break; case 104: -#line 1426 "Gmsh.y" +#line 1427 "Gmsh.y" { int num = (int)(yyvsp[(4) - (8)].i); if(FindPhysicalGroup(num, MSH_PHYSICAL_LINE)){ @@ -5147,7 +5148,7 @@ yyreduce: break; case 105: -#line 1445 "Gmsh.y" +#line 1446 "Gmsh.y" { int num = (int)(yyvsp[(4) - (8)].d); if(FindSurface(num)){ @@ -5168,7 +5169,7 @@ yyreduce: break; case 106: -#line 1463 "Gmsh.y" +#line 1464 "Gmsh.y" { int num = (int)(yyvsp[(4) - (9)].d), type = 0; if(FindSurface(num)){ @@ -5210,7 +5211,7 @@ yyreduce: break; case 107: -#line 1502 "Gmsh.y" +#line 1503 "Gmsh.y" { myGmshSurface = 0; (yyval.s).Type = 0; @@ -5219,7 +5220,7 @@ yyreduce: break; case 108: -#line 1508 "Gmsh.y" +#line 1509 "Gmsh.y" { myGmshSurface = gmshSurface::getSurface((int)(yyvsp[(3) - (4)].d)); (yyval.s).Type = 0; @@ -5228,7 +5229,7 @@ yyreduce: break; case 109: -#line 1514 "Gmsh.y" +#line 1515 "Gmsh.y" { int num = (int)(yyvsp[(4) - (10)].d); myGmshSurface = gmshParametricSurface::NewParametricSurface(num, (yyvsp[(7) - (10)].c), (yyvsp[(8) - (10)].c), (yyvsp[(9) - (10)].c)); @@ -5238,7 +5239,7 @@ yyreduce: break; case 110: -#line 1521 "Gmsh.y" +#line 1522 "Gmsh.y" { int num = (int)(yyvsp[(3) - (7)].d); if (List_Nbr((yyvsp[(6) - (7)].l)) != 2){ @@ -5266,7 +5267,7 @@ yyreduce: break; case 111: -#line 1546 "Gmsh.y" +#line 1547 "Gmsh.y" { int num = (int)(yyvsp[(3) - (7)].d); if (List_Nbr((yyvsp[(6) - (7)].l)) != 2){ @@ -5294,7 +5295,7 @@ yyreduce: break; case 112: -#line 1571 "Gmsh.y" +#line 1572 "Gmsh.y" { int num = (int)(yyvsp[(4) - (8)].d); if(FindSurfaceLoop(num)){ @@ -5313,7 +5314,7 @@ yyreduce: break; case 113: -#line 1587 "Gmsh.y" +#line 1588 "Gmsh.y" { int num = (int)(yyvsp[(4) - (8)].i); if(FindPhysicalGroup(num, MSH_PHYSICAL_SURFACE)){ @@ -5332,7 +5333,7 @@ yyreduce: break; case 114: -#line 1607 "Gmsh.y" +#line 1608 "Gmsh.y" { yymsg(0, "'Complex Volume' command is deprecated: use 'Volume' instead"); int num = (int)(yyvsp[(4) - (8)].d); @@ -5353,7 +5354,7 @@ yyreduce: break; case 115: -#line 1625 "Gmsh.y" +#line 1626 "Gmsh.y" { int num = (int)(yyvsp[(3) - (7)].d); if(FindVolume(num)){ @@ -5373,7 +5374,7 @@ yyreduce: break; case 116: -#line 1642 "Gmsh.y" +#line 1643 "Gmsh.y" { int num = (int)(yyvsp[(4) - (8)].i); if(FindPhysicalGroup(num, MSH_PHYSICAL_VOLUME)){ @@ -5392,7 +5393,7 @@ yyreduce: break; case 117: -#line 1663 "Gmsh.y" +#line 1664 "Gmsh.y" { TranslateShapes((yyvsp[(2) - (5)].v)[0], (yyvsp[(2) - (5)].v)[1], (yyvsp[(2) - (5)].v)[2], (yyvsp[(4) - (5)].l)); (yyval.l) = (yyvsp[(4) - (5)].l); @@ -5400,7 +5401,7 @@ yyreduce: break; case 118: -#line 1668 "Gmsh.y" +#line 1669 "Gmsh.y" { RotateShapes((yyvsp[(3) - (11)].v)[0], (yyvsp[(3) - (11)].v)[1], (yyvsp[(3) - (11)].v)[2], (yyvsp[(5) - (11)].v)[0], (yyvsp[(5) - (11)].v)[1], (yyvsp[(5) - (11)].v)[2], (yyvsp[(7) - (11)].d), (yyvsp[(10) - (11)].l)); (yyval.l) = (yyvsp[(10) - (11)].l); @@ -5408,7 +5409,7 @@ yyreduce: break; case 119: -#line 1673 "Gmsh.y" +#line 1674 "Gmsh.y" { SymmetryShapes((yyvsp[(2) - (5)].v)[0], (yyvsp[(2) - (5)].v)[1], (yyvsp[(2) - (5)].v)[2], (yyvsp[(2) - (5)].v)[3], (yyvsp[(4) - (5)].l)); (yyval.l) = (yyvsp[(4) - (5)].l); @@ -5416,7 +5417,7 @@ yyreduce: break; case 120: -#line 1678 "Gmsh.y" +#line 1679 "Gmsh.y" { DilatShapes((yyvsp[(3) - (9)].v)[0], (yyvsp[(3) - (9)].v)[1], (yyvsp[(3) - (9)].v)[2], (yyvsp[(5) - (9)].d), (yyvsp[(8) - (9)].l)); (yyval.l) = (yyvsp[(8) - (9)].l); @@ -5424,7 +5425,7 @@ yyreduce: break; case 121: -#line 1683 "Gmsh.y" +#line 1684 "Gmsh.y" { (yyval.l) = List_Create(3, 3, sizeof(Shape)); for(int i = 0; i < List_Nbr((yyvsp[(3) - (4)].l)); i++){ @@ -5438,7 +5439,7 @@ yyreduce: break; case 122: -#line 1694 "Gmsh.y" +#line 1695 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); IntersectCurvesWithSurface((yyvsp[(4) - (9)].l), (int)(yyvsp[(8) - (9)].d), (yyval.l)); @@ -5447,7 +5448,7 @@ yyreduce: break; case 123: -#line 1700 "Gmsh.y" +#line 1701 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); BoundaryShapes((yyvsp[(3) - (4)].l), (yyval.l)); @@ -5456,31 +5457,31 @@ yyreduce: break; case 124: -#line 1708 "Gmsh.y" +#line 1709 "Gmsh.y" { (yyval.l) = (yyvsp[(1) - (1)].l); ;} break; case 125: -#line 1709 "Gmsh.y" +#line 1710 "Gmsh.y" { (yyval.l) = (yyvsp[(1) - (1)].l); ;} break; case 126: -#line 1714 "Gmsh.y" +#line 1715 "Gmsh.y" { (yyval.l) = List_Create(3, 3, sizeof(Shape)); ;} break; case 127: -#line 1718 "Gmsh.y" +#line 1719 "Gmsh.y" { List_Add((yyval.l), &(yyvsp[(2) - (2)].s)); ;} break; case 128: -#line 1722 "Gmsh.y" +#line 1723 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(4) - (6)].l)); i++){ double d; @@ -5506,7 +5507,7 @@ yyreduce: break; case 129: -#line 1745 "Gmsh.y" +#line 1746 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(4) - (6)].l)); i++){ double d; @@ -5532,7 +5533,7 @@ yyreduce: break; case 130: -#line 1768 "Gmsh.y" +#line 1769 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(4) - (6)].l)); i++){ double d; @@ -5558,7 +5559,7 @@ yyreduce: break; case 131: -#line 1791 "Gmsh.y" +#line 1792 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(4) - (6)].l)); i++){ double d; @@ -5584,7 +5585,7 @@ yyreduce: break; case 132: -#line 1819 "Gmsh.y" +#line 1820 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(3) - (4)].l)); i++){ Shape TheShape; @@ -5596,14 +5597,14 @@ yyreduce: break; case 133: -#line 1828 "Gmsh.y" +#line 1829 "Gmsh.y" { GModel::current()->getFields()->delete_field((int)(yyvsp[(4) - (6)].d)); ;} break; case 134: -#line 1832 "Gmsh.y" +#line 1833 "Gmsh.y" { #if !defined(HAVE_NO_POST) if(!strcmp((yyvsp[(2) - (6)].c), "View")){ @@ -5621,7 +5622,7 @@ yyreduce: break; case 135: -#line 1847 "Gmsh.y" +#line 1848 "Gmsh.y" { if(!strcmp((yyvsp[(2) - (3)].c), "Meshes") || !strcmp((yyvsp[(2) - (3)].c), "All")){ GModel::current()->destroy(); @@ -5640,7 +5641,7 @@ yyreduce: break; case 136: -#line 1863 "Gmsh.y" +#line 1864 "Gmsh.y" { #if !defined(HAVE_NO_POST) if(!strcmp((yyvsp[(2) - (4)].c), "Empty") && !strcmp((yyvsp[(3) - (4)].c), "Views")){ @@ -5655,7 +5656,7 @@ yyreduce: break; case 137: -#line 1880 "Gmsh.y" +#line 1881 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(4) - (5)].l)); i++){ Shape TheShape; @@ -5667,7 +5668,7 @@ yyreduce: break; case 138: -#line 1894 "Gmsh.y" +#line 1895 "Gmsh.y" { for(int i = 0; i < 4; i++) VisibilityShape((yyvsp[(2) - (3)].c), i, 1); @@ -5676,7 +5677,7 @@ yyreduce: break; case 139: -#line 1900 "Gmsh.y" +#line 1901 "Gmsh.y" { for(int i = 0; i < 4; i++) VisibilityShape((yyvsp[(2) - (3)].c), i, 0); @@ -5685,7 +5686,7 @@ yyreduce: break; case 140: -#line 1906 "Gmsh.y" +#line 1907 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(3) - (4)].l)); i++){ Shape TheShape; @@ -5697,7 +5698,7 @@ yyreduce: break; case 141: -#line 1915 "Gmsh.y" +#line 1916 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(3) - (4)].l)); i++){ Shape TheShape; @@ -5709,7 +5710,7 @@ yyreduce: break; case 142: -#line 1929 "Gmsh.y" +#line 1930 "Gmsh.y" { if(!strcmp((yyvsp[(1) - (3)].c), "Include")){ char tmpstring[1024]; @@ -5760,7 +5761,7 @@ yyreduce: break; case 143: -#line 1977 "Gmsh.y" +#line 1978 "Gmsh.y" { #if !defined(HAVE_NO_POST) if(!strcmp((yyvsp[(1) - (7)].c), "Save") && !strcmp((yyvsp[(2) - (7)].c), "View")){ @@ -5781,7 +5782,7 @@ yyreduce: break; case 144: -#line 1995 "Gmsh.y" +#line 1996 "Gmsh.y" { #if !defined(HAVE_NO_POST) if(!strcmp((yyvsp[(1) - (7)].c), "Background") && !strcmp((yyvsp[(2) - (7)].c), "Mesh") && !strcmp((yyvsp[(3) - (7)].c), "View")){ @@ -5799,7 +5800,7 @@ yyreduce: break; case 145: -#line 2010 "Gmsh.y" +#line 2011 "Gmsh.y" { if(!strcmp((yyvsp[(1) - (3)].c), "Sleep")){ SleepInSeconds((yyvsp[(2) - (3)].d)); @@ -5824,7 +5825,7 @@ yyreduce: break; case 146: -#line 2032 "Gmsh.y" +#line 2033 "Gmsh.y" { #if !defined(HAVE_NO_POST) try { @@ -5839,7 +5840,7 @@ yyreduce: break; case 147: -#line 2044 "Gmsh.y" +#line 2045 "Gmsh.y" { #if !defined(HAVE_NO_POST) if(!strcmp((yyvsp[(2) - (3)].c), "ElementsFromAllViews")) @@ -5866,14 +5867,14 @@ yyreduce: break; case 148: -#line 2068 "Gmsh.y" +#line 2069 "Gmsh.y" { exit(0); ;} break; case 149: -#line 2072 "Gmsh.y" +#line 2073 "Gmsh.y" { CTX.forced_bbox = 0; SetBoundingBox(); @@ -5881,7 +5882,7 @@ yyreduce: break; case 150: -#line 2077 "Gmsh.y" +#line 2078 "Gmsh.y" { CTX.forced_bbox = 1; SetBoundingBox((yyvsp[(3) - (15)].d), (yyvsp[(5) - (15)].d), (yyvsp[(7) - (15)].d), (yyvsp[(9) - (15)].d), (yyvsp[(11) - (15)].d), (yyvsp[(13) - (15)].d)); @@ -5889,7 +5890,7 @@ yyreduce: break; case 151: -#line 2082 "Gmsh.y" +#line 2083 "Gmsh.y" { #if defined(HAVE_FLTK) Draw(); @@ -5898,7 +5899,7 @@ yyreduce: break; case 152: -#line 2094 "Gmsh.y" +#line 2095 "Gmsh.y" { LoopControlVariablesTab[ImbricatedLoop][0] = (yyvsp[(3) - (6)].d); LoopControlVariablesTab[ImbricatedLoop][1] = (yyvsp[(5) - (6)].d); @@ -5918,7 +5919,7 @@ yyreduce: break; case 153: -#line 2111 "Gmsh.y" +#line 2112 "Gmsh.y" { LoopControlVariablesTab[ImbricatedLoop][0] = (yyvsp[(3) - (8)].d); LoopControlVariablesTab[ImbricatedLoop][1] = (yyvsp[(5) - (8)].d); @@ -5938,7 +5939,7 @@ yyreduce: break; case 154: -#line 2128 "Gmsh.y" +#line 2129 "Gmsh.y" { LoopControlVariablesTab[ImbricatedLoop][0] = (yyvsp[(5) - (8)].d); LoopControlVariablesTab[ImbricatedLoop][1] = (yyvsp[(7) - (8)].d); @@ -5968,7 +5969,7 @@ yyreduce: break; case 155: -#line 2155 "Gmsh.y" +#line 2156 "Gmsh.y" { LoopControlVariablesTab[ImbricatedLoop][0] = (yyvsp[(5) - (10)].d); LoopControlVariablesTab[ImbricatedLoop][1] = (yyvsp[(7) - (10)].d); @@ -5998,7 +5999,7 @@ yyreduce: break; case 156: -#line 2182 "Gmsh.y" +#line 2183 "Gmsh.y" { if(ImbricatedLoop <= 0){ yymsg(0, "Invalid For/EndFor loop"); @@ -6032,7 +6033,7 @@ yyreduce: break; case 157: -#line 2213 "Gmsh.y" +#line 2214 "Gmsh.y" { if(!FunctionManager::Instance()->createFunction((yyvsp[(2) - (2)].c), gmsh_yyin, gmsh_yyname, gmsh_yylineno)) @@ -6043,7 +6044,7 @@ yyreduce: break; case 158: -#line 2221 "Gmsh.y" +#line 2222 "Gmsh.y" { if(!FunctionManager::Instance()->leaveFunction(&gmsh_yyin, gmsh_yyname, gmsh_yylineno)) @@ -6052,7 +6053,7 @@ yyreduce: break; case 159: -#line 2227 "Gmsh.y" +#line 2228 "Gmsh.y" { if(!FunctionManager::Instance()->enterFunction((yyvsp[(2) - (3)].c), &gmsh_yyin, gmsh_yyname, gmsh_yylineno)) @@ -6062,20 +6063,20 @@ yyreduce: break; case 160: -#line 2234 "Gmsh.y" +#line 2235 "Gmsh.y" { if(!(yyvsp[(3) - (4)].d)) skip_until("If", "EndIf"); ;} break; case 161: -#line 2238 "Gmsh.y" +#line 2239 "Gmsh.y" { ;} break; case 162: -#line 2247 "Gmsh.y" +#line 2248 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShapes(TRANSLATE, (yyvsp[(4) - (5)].l), @@ -6086,7 +6087,7 @@ yyreduce: break; case 163: -#line 2255 "Gmsh.y" +#line 2256 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShapes(ROTATE, (yyvsp[(10) - (11)].l), @@ -6097,7 +6098,7 @@ yyreduce: break; case 164: -#line 2263 "Gmsh.y" +#line 2264 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShapes(TRANSLATE_ROTATE, (yyvsp[(12) - (13)].l), @@ -6108,14 +6109,14 @@ yyreduce: break; case 165: -#line 2271 "Gmsh.y" +#line 2272 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 166: -#line 2275 "Gmsh.y" +#line 2276 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShapes(TRANSLATE, (yyvsp[(4) - (7)].l), @@ -6126,14 +6127,14 @@ yyreduce: break; case 167: -#line 2283 "Gmsh.y" +#line 2284 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 168: -#line 2287 "Gmsh.y" +#line 2288 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShapes(ROTATE, (yyvsp[(10) - (13)].l), @@ -6144,14 +6145,14 @@ yyreduce: break; case 169: -#line 2295 "Gmsh.y" +#line 2296 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 170: -#line 2299 "Gmsh.y" +#line 2300 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShapes(TRANSLATE_ROTATE, (yyvsp[(12) - (15)].l), @@ -6162,14 +6163,14 @@ yyreduce: break; case 171: -#line 2307 "Gmsh.y" +#line 2308 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 172: -#line 2311 "Gmsh.y" +#line 2312 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShapes(BOUNDARY_LAYER, (yyvsp[(3) - (6)].l), 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., @@ -6179,14 +6180,14 @@ yyreduce: break; case 173: -#line 2318 "Gmsh.y" +#line 2319 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 174: -#line 2322 "Gmsh.y" +#line 2323 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); extr.mesh.ViewIndex = (int)(yyvsp[(4) - (10)].d); @@ -6199,7 +6200,7 @@ yyreduce: break; case 175: -#line 2334 "Gmsh.y" +#line 2335 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE, MSH_POINT, (int)(yyvsp[(4) - (8)].d), @@ -6209,7 +6210,7 @@ yyreduce: break; case 176: -#line 2341 "Gmsh.y" +#line 2342 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE, MSH_SEGM_LINE, (int)(yyvsp[(4) - (8)].d), @@ -6219,7 +6220,7 @@ yyreduce: break; case 177: -#line 2348 "Gmsh.y" +#line 2349 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE, MSH_SURF_PLAN, (int)(yyvsp[(4) - (8)].d), @@ -6229,7 +6230,7 @@ yyreduce: break; case 178: -#line 2355 "Gmsh.y" +#line 2356 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(ROTATE, MSH_POINT, (int)(yyvsp[(4) - (12)].d), @@ -6239,7 +6240,7 @@ yyreduce: break; case 179: -#line 2362 "Gmsh.y" +#line 2363 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(ROTATE, MSH_SEGM_LINE, (int)(yyvsp[(4) - (12)].d), @@ -6249,7 +6250,7 @@ yyreduce: break; case 180: -#line 2369 "Gmsh.y" +#line 2370 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(ROTATE, MSH_SURF_PLAN, (int)(yyvsp[(4) - (12)].d), @@ -6259,7 +6260,7 @@ yyreduce: break; case 181: -#line 2376 "Gmsh.y" +#line 2377 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE_ROTATE, MSH_POINT, (int)(yyvsp[(4) - (14)].d), @@ -6269,7 +6270,7 @@ yyreduce: break; case 182: -#line 2383 "Gmsh.y" +#line 2384 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE_ROTATE, MSH_SEGM_LINE, (int)(yyvsp[(4) - (14)].d), @@ -6279,7 +6280,7 @@ yyreduce: break; case 183: -#line 2390 "Gmsh.y" +#line 2391 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE_ROTATE, MSH_SURF_PLAN, (int)(yyvsp[(4) - (14)].d), @@ -6289,14 +6290,14 @@ yyreduce: break; case 184: -#line 2397 "Gmsh.y" +#line 2398 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 185: -#line 2401 "Gmsh.y" +#line 2402 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE, MSH_POINT, (int)(yyvsp[(4) - (12)].d), @@ -6306,14 +6307,14 @@ yyreduce: break; case 186: -#line 2408 "Gmsh.y" +#line 2409 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 187: -#line 2412 "Gmsh.y" +#line 2413 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE, MSH_SEGM_LINE, (int)(yyvsp[(4) - (12)].d), @@ -6323,14 +6324,14 @@ yyreduce: break; case 188: -#line 2419 "Gmsh.y" +#line 2420 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 189: -#line 2423 "Gmsh.y" +#line 2424 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE, MSH_SURF_PLAN, (int)(yyvsp[(4) - (12)].d), @@ -6340,14 +6341,14 @@ yyreduce: break; case 190: -#line 2430 "Gmsh.y" +#line 2431 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 191: -#line 2434 "Gmsh.y" +#line 2435 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(ROTATE, MSH_POINT, (int)(yyvsp[(4) - (16)].d), @@ -6357,14 +6358,14 @@ yyreduce: break; case 192: -#line 2441 "Gmsh.y" +#line 2442 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 193: -#line 2445 "Gmsh.y" +#line 2446 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(ROTATE, MSH_SEGM_LINE, (int)(yyvsp[(4) - (16)].d), @@ -6374,14 +6375,14 @@ yyreduce: break; case 194: -#line 2452 "Gmsh.y" +#line 2453 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 195: -#line 2456 "Gmsh.y" +#line 2457 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(ROTATE, MSH_SURF_PLAN, (int)(yyvsp[(4) - (16)].d), @@ -6391,14 +6392,14 @@ yyreduce: break; case 196: -#line 2463 "Gmsh.y" +#line 2464 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 197: -#line 2467 "Gmsh.y" +#line 2468 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE_ROTATE, MSH_POINT, (int)(yyvsp[(4) - (18)].d), @@ -6408,14 +6409,14 @@ yyreduce: break; case 198: -#line 2474 "Gmsh.y" +#line 2475 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 199: -#line 2478 "Gmsh.y" +#line 2479 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE_ROTATE, MSH_SEGM_LINE, (int)(yyvsp[(4) - (18)].d), @@ -6425,14 +6426,14 @@ yyreduce: break; case 200: -#line 2485 "Gmsh.y" +#line 2486 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 201: -#line 2489 "Gmsh.y" +#line 2490 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE_ROTATE, MSH_SURF_PLAN, (int)(yyvsp[(4) - (18)].d), @@ -6442,19 +6443,19 @@ yyreduce: break; case 202: -#line 2500 "Gmsh.y" +#line 2501 "Gmsh.y" { ;} break; case 203: -#line 2503 "Gmsh.y" +#line 2504 "Gmsh.y" { ;} break; case 204: -#line 2509 "Gmsh.y" +#line 2510 "Gmsh.y" { extr.mesh.ExtrudeMesh = true; extr.mesh.NbLayer = 1; @@ -6466,7 +6467,7 @@ yyreduce: break; case 205: -#line 2518 "Gmsh.y" +#line 2519 "Gmsh.y" { double d; extr.mesh.ExtrudeMesh = true; @@ -6489,7 +6490,7 @@ yyreduce: break; case 206: -#line 2538 "Gmsh.y" +#line 2539 "Gmsh.y" { yymsg(0, "Explicit region numbers in layers are deprecated"); double d; @@ -6515,14 +6516,14 @@ yyreduce: break; case 207: -#line 2561 "Gmsh.y" +#line 2562 "Gmsh.y" { extr.mesh.Recombine = true; ;} break; case 208: -#line 2565 "Gmsh.y" +#line 2566 "Gmsh.y" { int num = (int)(yyvsp[(3) - (9)].d); if(FindSurface(num)){ @@ -6544,7 +6545,7 @@ yyreduce: break; case 209: -#line 2589 "Gmsh.y" +#line 2590 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(3) - (6)].l)); i++){ double d; @@ -6565,7 +6566,7 @@ yyreduce: break; case 210: -#line 2607 "Gmsh.y" +#line 2608 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(3) - (9)].l)); i++){ double d; @@ -6586,7 +6587,7 @@ yyreduce: break; case 211: -#line 2625 "Gmsh.y" +#line 2626 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(3) - (9)].l)); i++){ double d; @@ -6607,7 +6608,7 @@ yyreduce: break; case 212: -#line 2643 "Gmsh.y" +#line 2644 "Gmsh.y" { Surface *s = FindSurface((int)(yyvsp[(4) - (8)].d)); if(!s) @@ -6639,7 +6640,7 @@ yyreduce: break; case 213: -#line 2672 "Gmsh.y" +#line 2673 "Gmsh.y" { Surface *s = FindSurface((int)(yyvsp[(4) - (9)].d)); if(!s) @@ -6677,7 +6678,7 @@ yyreduce: break; case 214: -#line 2707 "Gmsh.y" +#line 2708 "Gmsh.y" { yymsg(1, "Elliptic Surface is deprecated: use Transfinite instead (with smoothing)"); List_Delete((yyvsp[(7) - (8)].l)); @@ -6685,7 +6686,7 @@ yyreduce: break; case 215: -#line 2712 "Gmsh.y" +#line 2713 "Gmsh.y" { Volume *v = FindVolume((int)(yyvsp[(4) - (8)].d)); if(!v) @@ -6715,7 +6716,7 @@ yyreduce: break; case 216: -#line 2739 "Gmsh.y" +#line 2740 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(3) - (6)].l)); i++){ double d; @@ -6732,7 +6733,7 @@ yyreduce: break; case 217: -#line 2753 "Gmsh.y" +#line 2754 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(3) - (4)].l)); i++){ double d; @@ -6748,7 +6749,7 @@ yyreduce: break; case 218: -#line 2766 "Gmsh.y" +#line 2767 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(3) - (6)].l)); i++){ double d; @@ -6762,7 +6763,7 @@ yyreduce: break; case 219: -#line 2783 "Gmsh.y" +#line 2784 "Gmsh.y" { Surface *s = FindSurface((int)(yyvsp[(8) - (10)].d)); if(s) @@ -6771,7 +6772,7 @@ yyreduce: break; case 220: -#line 2789 "Gmsh.y" +#line 2790 "Gmsh.y" { Surface *s = FindSurface((int)(yyvsp[(8) - (10)].d)); if(s) @@ -6780,66 +6781,66 @@ yyreduce: break; case 221: -#line 2795 "Gmsh.y" +#line 2796 "Gmsh.y" { ;} break; case 222: -#line 2798 "Gmsh.y" +#line 2799 "Gmsh.y" { ;} break; case 223: -#line 2807 "Gmsh.y" +#line 2808 "Gmsh.y" { ReplaceAllDuplicates(); ;} break; case 224: -#line 2816 "Gmsh.y" +#line 2817 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (1)].d); ;} break; case 225: -#line 2817 "Gmsh.y" +#line 2818 "Gmsh.y" { (yyval.d) = (yyvsp[(2) - (3)].d); ;} break; case 226: -#line 2818 "Gmsh.y" +#line 2819 "Gmsh.y" { (yyval.d) = -(yyvsp[(2) - (2)].d); ;} break; case 227: -#line 2819 "Gmsh.y" +#line 2820 "Gmsh.y" { (yyval.d) = (yyvsp[(2) - (2)].d); ;} break; case 228: -#line 2820 "Gmsh.y" +#line 2821 "Gmsh.y" { (yyval.d) = !(yyvsp[(2) - (2)].d); ;} break; case 229: -#line 2821 "Gmsh.y" +#line 2822 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (3)].d) - (yyvsp[(3) - (3)].d); ;} break; case 230: -#line 2822 "Gmsh.y" +#line 2823 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (3)].d) + (yyvsp[(3) - (3)].d); ;} break; case 231: -#line 2823 "Gmsh.y" +#line 2824 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (3)].d) * (yyvsp[(3) - (3)].d); ;} break; case 232: -#line 2825 "Gmsh.y" +#line 2826 "Gmsh.y" { if(!(yyvsp[(3) - (3)].d)) yymsg(0, "Division by zero in '%g / %g'", (yyvsp[(1) - (3)].d), (yyvsp[(3) - (3)].d)); @@ -6849,307 +6850,307 @@ yyreduce: break; case 233: -#line 2831 "Gmsh.y" +#line 2832 "Gmsh.y" { (yyval.d) = (int)(yyvsp[(1) - (3)].d) % (int)(yyvsp[(3) - (3)].d); ;} break; case 234: -#line 2832 "Gmsh.y" +#line 2833 "Gmsh.y" { (yyval.d) = pow((yyvsp[(1) - (3)].d), (yyvsp[(3) - (3)].d)); ;} break; case 235: -#line 2833 "Gmsh.y" +#line 2834 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (3)].d) < (yyvsp[(3) - (3)].d); ;} break; case 236: -#line 2834 "Gmsh.y" +#line 2835 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (3)].d) > (yyvsp[(3) - (3)].d); ;} break; case 237: -#line 2835 "Gmsh.y" +#line 2836 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (3)].d) <= (yyvsp[(3) - (3)].d); ;} break; case 238: -#line 2836 "Gmsh.y" +#line 2837 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (3)].d) >= (yyvsp[(3) - (3)].d); ;} break; case 239: -#line 2837 "Gmsh.y" +#line 2838 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (3)].d) == (yyvsp[(3) - (3)].d); ;} break; case 240: -#line 2838 "Gmsh.y" +#line 2839 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (3)].d) != (yyvsp[(3) - (3)].d); ;} break; case 241: -#line 2839 "Gmsh.y" +#line 2840 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (3)].d) && (yyvsp[(3) - (3)].d); ;} break; case 242: -#line 2840 "Gmsh.y" +#line 2841 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (3)].d) || (yyvsp[(3) - (3)].d); ;} break; case 243: -#line 2841 "Gmsh.y" +#line 2842 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (5)].d)? (yyvsp[(3) - (5)].d) : (yyvsp[(5) - (5)].d); ;} break; case 244: -#line 2842 "Gmsh.y" +#line 2843 "Gmsh.y" { (yyval.d) = exp((yyvsp[(3) - (4)].d)); ;} break; case 245: -#line 2843 "Gmsh.y" +#line 2844 "Gmsh.y" { (yyval.d) = log((yyvsp[(3) - (4)].d)); ;} break; case 246: -#line 2844 "Gmsh.y" +#line 2845 "Gmsh.y" { (yyval.d) = log10((yyvsp[(3) - (4)].d)); ;} break; case 247: -#line 2845 "Gmsh.y" +#line 2846 "Gmsh.y" { (yyval.d) = sqrt((yyvsp[(3) - (4)].d)); ;} break; case 248: -#line 2846 "Gmsh.y" +#line 2847 "Gmsh.y" { (yyval.d) = sin((yyvsp[(3) - (4)].d)); ;} break; case 249: -#line 2847 "Gmsh.y" +#line 2848 "Gmsh.y" { (yyval.d) = asin((yyvsp[(3) - (4)].d)); ;} break; case 250: -#line 2848 "Gmsh.y" +#line 2849 "Gmsh.y" { (yyval.d) = cos((yyvsp[(3) - (4)].d)); ;} break; case 251: -#line 2849 "Gmsh.y" +#line 2850 "Gmsh.y" { (yyval.d) = acos((yyvsp[(3) - (4)].d)); ;} break; case 252: -#line 2850 "Gmsh.y" +#line 2851 "Gmsh.y" { (yyval.d) = tan((yyvsp[(3) - (4)].d)); ;} break; case 253: -#line 2851 "Gmsh.y" +#line 2852 "Gmsh.y" { (yyval.d) = atan((yyvsp[(3) - (4)].d)); ;} break; case 254: -#line 2852 "Gmsh.y" +#line 2853 "Gmsh.y" { (yyval.d) = atan2((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d));;} break; case 255: -#line 2853 "Gmsh.y" +#line 2854 "Gmsh.y" { (yyval.d) = sinh((yyvsp[(3) - (4)].d)); ;} break; case 256: -#line 2854 "Gmsh.y" +#line 2855 "Gmsh.y" { (yyval.d) = cosh((yyvsp[(3) - (4)].d)); ;} break; case 257: -#line 2855 "Gmsh.y" +#line 2856 "Gmsh.y" { (yyval.d) = tanh((yyvsp[(3) - (4)].d)); ;} break; case 258: -#line 2856 "Gmsh.y" +#line 2857 "Gmsh.y" { (yyval.d) = fabs((yyvsp[(3) - (4)].d)); ;} break; case 259: -#line 2857 "Gmsh.y" +#line 2858 "Gmsh.y" { (yyval.d) = floor((yyvsp[(3) - (4)].d)); ;} break; case 260: -#line 2858 "Gmsh.y" +#line 2859 "Gmsh.y" { (yyval.d) = ceil((yyvsp[(3) - (4)].d)); ;} break; case 261: -#line 2859 "Gmsh.y" +#line 2860 "Gmsh.y" { (yyval.d) = fmod((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d)); ;} break; case 262: -#line 2860 "Gmsh.y" +#line 2861 "Gmsh.y" { (yyval.d) = fmod((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d)); ;} break; case 263: -#line 2861 "Gmsh.y" +#line 2862 "Gmsh.y" { (yyval.d) = sqrt((yyvsp[(3) - (6)].d)*(yyvsp[(3) - (6)].d)+(yyvsp[(5) - (6)].d)*(yyvsp[(5) - (6)].d)); ;} break; case 264: -#line 2862 "Gmsh.y" +#line 2863 "Gmsh.y" { (yyval.d) = (yyvsp[(3) - (4)].d)*(double)rand()/(double)RAND_MAX; ;} break; case 265: -#line 2864 "Gmsh.y" +#line 2865 "Gmsh.y" { (yyval.d) = exp((yyvsp[(3) - (4)].d)); ;} break; case 266: -#line 2865 "Gmsh.y" +#line 2866 "Gmsh.y" { (yyval.d) = log((yyvsp[(3) - (4)].d)); ;} break; case 267: -#line 2866 "Gmsh.y" +#line 2867 "Gmsh.y" { (yyval.d) = log10((yyvsp[(3) - (4)].d)); ;} break; case 268: -#line 2867 "Gmsh.y" +#line 2868 "Gmsh.y" { (yyval.d) = sqrt((yyvsp[(3) - (4)].d)); ;} break; case 269: -#line 2868 "Gmsh.y" +#line 2869 "Gmsh.y" { (yyval.d) = sin((yyvsp[(3) - (4)].d)); ;} break; case 270: -#line 2869 "Gmsh.y" +#line 2870 "Gmsh.y" { (yyval.d) = asin((yyvsp[(3) - (4)].d)); ;} break; case 271: -#line 2870 "Gmsh.y" +#line 2871 "Gmsh.y" { (yyval.d) = cos((yyvsp[(3) - (4)].d)); ;} break; case 272: -#line 2871 "Gmsh.y" +#line 2872 "Gmsh.y" { (yyval.d) = acos((yyvsp[(3) - (4)].d)); ;} break; case 273: -#line 2872 "Gmsh.y" +#line 2873 "Gmsh.y" { (yyval.d) = tan((yyvsp[(3) - (4)].d)); ;} break; case 274: -#line 2873 "Gmsh.y" +#line 2874 "Gmsh.y" { (yyval.d) = atan((yyvsp[(3) - (4)].d)); ;} break; case 275: -#line 2874 "Gmsh.y" +#line 2875 "Gmsh.y" { (yyval.d) = atan2((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d));;} break; case 276: -#line 2875 "Gmsh.y" +#line 2876 "Gmsh.y" { (yyval.d) = sinh((yyvsp[(3) - (4)].d)); ;} break; case 277: -#line 2876 "Gmsh.y" +#line 2877 "Gmsh.y" { (yyval.d) = cosh((yyvsp[(3) - (4)].d)); ;} break; case 278: -#line 2877 "Gmsh.y" +#line 2878 "Gmsh.y" { (yyval.d) = tanh((yyvsp[(3) - (4)].d)); ;} break; case 279: -#line 2878 "Gmsh.y" +#line 2879 "Gmsh.y" { (yyval.d) = fabs((yyvsp[(3) - (4)].d)); ;} break; case 280: -#line 2879 "Gmsh.y" +#line 2880 "Gmsh.y" { (yyval.d) = floor((yyvsp[(3) - (4)].d)); ;} break; case 281: -#line 2880 "Gmsh.y" +#line 2881 "Gmsh.y" { (yyval.d) = ceil((yyvsp[(3) - (4)].d)); ;} break; case 282: -#line 2881 "Gmsh.y" +#line 2882 "Gmsh.y" { (yyval.d) = fmod((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d)); ;} break; case 283: -#line 2882 "Gmsh.y" +#line 2883 "Gmsh.y" { (yyval.d) = fmod((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d)); ;} break; case 284: -#line 2883 "Gmsh.y" +#line 2884 "Gmsh.y" { (yyval.d) = sqrt((yyvsp[(3) - (6)].d)*(yyvsp[(3) - (6)].d)+(yyvsp[(5) - (6)].d)*(yyvsp[(5) - (6)].d)); ;} break; case 285: -#line 2884 "Gmsh.y" +#line 2885 "Gmsh.y" { (yyval.d) = (yyvsp[(3) - (4)].d)*(double)rand()/(double)RAND_MAX; ;} break; case 286: -#line 2893 "Gmsh.y" +#line 2894 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (1)].d); ;} break; case 287: -#line 2894 "Gmsh.y" +#line 2895 "Gmsh.y" { (yyval.d) = 3.141592653589793; ;} break; case 288: -#line 2895 "Gmsh.y" +#line 2896 "Gmsh.y" { (yyval.d) = Msg::GetCommRank(); ;} break; case 289: -#line 2896 "Gmsh.y" +#line 2897 "Gmsh.y" { (yyval.d) = Msg::GetCommSize(); ;} break; case 290: -#line 2897 "Gmsh.y" +#line 2898 "Gmsh.y" { (yyval.d) = Get_GmshMajorVersion(); ;} break; case 291: -#line 2898 "Gmsh.y" +#line 2899 "Gmsh.y" { (yyval.d) = Get_GmshMinorVersion(); ;} break; case 292: -#line 2899 "Gmsh.y" +#line 2900 "Gmsh.y" { (yyval.d) = Get_GmshPatchVersion(); ;} break; case 293: -#line 2904 "Gmsh.y" +#line 2905 "Gmsh.y" { Symbol TheSymbol; TheSymbol.Name = (yyvsp[(1) - (1)].c); @@ -7165,7 +7166,7 @@ yyreduce: break; case 294: -#line 2920 "Gmsh.y" +#line 2921 "Gmsh.y" { char tmpstring[1024]; sprintf(tmpstring, "%s_%d", (yyvsp[(1) - (5)].c), (int)(yyvsp[(4) - (5)].d)) ; @@ -7183,7 +7184,7 @@ yyreduce: break; case 295: -#line 2935 "Gmsh.y" +#line 2936 "Gmsh.y" { Symbol TheSymbol; TheSymbol.Name = (yyvsp[(1) - (4)].c); @@ -7206,7 +7207,7 @@ yyreduce: break; case 296: -#line 2955 "Gmsh.y" +#line 2956 "Gmsh.y" { Symbol TheSymbol; TheSymbol.Name = (yyvsp[(2) - (4)].c); @@ -7222,7 +7223,7 @@ yyreduce: break; case 297: -#line 2968 "Gmsh.y" +#line 2969 "Gmsh.y" { Symbol TheSymbol; TheSymbol.Name = (yyvsp[(1) - (2)].c); @@ -7238,7 +7239,7 @@ yyreduce: break; case 298: -#line 2981 "Gmsh.y" +#line 2982 "Gmsh.y" { Symbol TheSymbol; TheSymbol.Name = (yyvsp[(1) - (5)].c); @@ -7261,7 +7262,7 @@ yyreduce: break; case 299: -#line 3004 "Gmsh.y" +#line 3005 "Gmsh.y" { double (*pNumOpt)(int num, int action, double value); StringXNumber *pNumCat; @@ -7282,7 +7283,7 @@ yyreduce: break; case 300: -#line 3022 "Gmsh.y" +#line 3023 "Gmsh.y" { double (*pNumOpt)(int num, int action, double value); StringXNumber *pNumCat; @@ -7303,7 +7304,7 @@ yyreduce: break; case 301: -#line 3040 "Gmsh.y" +#line 3041 "Gmsh.y" { double (*pNumOpt)(int num, int action, double value); StringXNumber *pNumCat; @@ -7324,7 +7325,7 @@ yyreduce: break; case 302: -#line 3058 "Gmsh.y" +#line 3059 "Gmsh.y" { double (*pNumOpt)(int num, int action, double value); StringXNumber *pNumCat; @@ -7345,7 +7346,7 @@ yyreduce: break; case 303: -#line 3076 "Gmsh.y" +#line 3077 "Gmsh.y" { (yyval.d) = Msg::GetValue((yyvsp[(3) - (6)].c), (yyvsp[(5) - (6)].d)); Free((yyvsp[(3) - (6)].c)); @@ -7353,70 +7354,70 @@ yyreduce: break; case 304: -#line 3084 "Gmsh.y" +#line 3085 "Gmsh.y" { memcpy((yyval.v), (yyvsp[(1) - (1)].v), 5*sizeof(double)); ;} break; case 305: -#line 3088 "Gmsh.y" +#line 3089 "Gmsh.y" { for(int i = 0; i < 5; i++) (yyval.v)[i] = -(yyvsp[(2) - (2)].v)[i]; ;} break; case 306: -#line 3092 "Gmsh.y" +#line 3093 "Gmsh.y" { for(int i = 0; i < 5; i++) (yyval.v)[i] = (yyvsp[(2) - (2)].v)[i]; ;} break; case 307: -#line 3096 "Gmsh.y" +#line 3097 "Gmsh.y" { for(int i = 0; i < 5; i++) (yyval.v)[i] = (yyvsp[(1) - (3)].v)[i] - (yyvsp[(3) - (3)].v)[i]; ;} break; case 308: -#line 3100 "Gmsh.y" +#line 3101 "Gmsh.y" { for(int i = 0; i < 5; i++) (yyval.v)[i] = (yyvsp[(1) - (3)].v)[i] + (yyvsp[(3) - (3)].v)[i]; ;} break; case 309: -#line 3107 "Gmsh.y" +#line 3108 "Gmsh.y" { (yyval.v)[0] = (yyvsp[(2) - (11)].d); (yyval.v)[1] = (yyvsp[(4) - (11)].d); (yyval.v)[2] = (yyvsp[(6) - (11)].d); (yyval.v)[3] = (yyvsp[(8) - (11)].d); (yyval.v)[4] = (yyvsp[(10) - (11)].d); ;} break; case 310: -#line 3111 "Gmsh.y" +#line 3112 "Gmsh.y" { (yyval.v)[0] = (yyvsp[(2) - (9)].d); (yyval.v)[1] = (yyvsp[(4) - (9)].d); (yyval.v)[2] = (yyvsp[(6) - (9)].d); (yyval.v)[3] = (yyvsp[(8) - (9)].d); (yyval.v)[4] = 1.0; ;} break; case 311: -#line 3115 "Gmsh.y" +#line 3116 "Gmsh.y" { (yyval.v)[0] = (yyvsp[(2) - (7)].d); (yyval.v)[1] = (yyvsp[(4) - (7)].d); (yyval.v)[2] = (yyvsp[(6) - (7)].d); (yyval.v)[3] = 0.0; (yyval.v)[4] = 1.0; ;} break; case 312: -#line 3119 "Gmsh.y" +#line 3120 "Gmsh.y" { (yyval.v)[0] = (yyvsp[(2) - (7)].d); (yyval.v)[1] = (yyvsp[(4) - (7)].d); (yyval.v)[2] = (yyvsp[(6) - (7)].d); (yyval.v)[3] = 0.0; (yyval.v)[4] = 1.0; ;} break; case 313: -#line 3126 "Gmsh.y" +#line 3127 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(List_T*)); List_Add((yyval.l), &((yyvsp[(1) - (1)].l))); @@ -7424,14 +7425,14 @@ yyreduce: break; case 314: -#line 3131 "Gmsh.y" +#line 3132 "Gmsh.y" { List_Add((yyval.l), &((yyvsp[(3) - (3)].l))); ;} break; case 315: -#line 3139 "Gmsh.y" +#line 3140 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(double)); List_Add((yyval.l), &((yyvsp[(1) - (1)].d))); @@ -7439,14 +7440,14 @@ yyreduce: break; case 316: -#line 3144 "Gmsh.y" +#line 3145 "Gmsh.y" { (yyval.l) = (yyvsp[(1) - (1)].l); ;} break; case 317: -#line 3148 "Gmsh.y" +#line 3149 "Gmsh.y" { // creates an empty list (yyval.l) = List_Create(2, 1, sizeof(double)); @@ -7454,14 +7455,14 @@ yyreduce: break; case 318: -#line 3153 "Gmsh.y" +#line 3154 "Gmsh.y" { (yyval.l) = (yyvsp[(2) - (3)].l); ;} break; case 319: -#line 3157 "Gmsh.y" +#line 3158 "Gmsh.y" { (yyval.l) = (yyvsp[(3) - (4)].l); for(int i = 0; i < List_Nbr((yyval.l)); i++){ @@ -7472,7 +7473,7 @@ yyreduce: break; case 320: -#line 3165 "Gmsh.y" +#line 3166 "Gmsh.y" { (yyval.l) = (yyvsp[(4) - (5)].l); for(int i = 0; i < List_Nbr((yyval.l)); i++){ @@ -7483,7 +7484,7 @@ yyreduce: break; case 321: -#line 3176 "Gmsh.y" +#line 3177 "Gmsh.y" { (yyval.l) = (yyvsp[(2) - (2)].l); for(int i = 0; i < List_Nbr((yyval.l)); i++){ @@ -7494,7 +7495,7 @@ yyreduce: break; case 322: -#line 3184 "Gmsh.y" +#line 3185 "Gmsh.y" { (yyval.l) = (yyvsp[(3) - (3)].l); for(int i = 0; i < List_Nbr((yyval.l)); i++){ @@ -7505,7 +7506,7 @@ yyreduce: break; case 323: -#line 3192 "Gmsh.y" +#line 3193 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(double)); for(double d = (yyvsp[(1) - (3)].d); ((yyvsp[(1) - (3)].d) < (yyvsp[(3) - (3)].d)) ? (d <= (yyvsp[(3) - (3)].d)) : (d >= (yyvsp[(3) - (3)].d)); ((yyvsp[(1) - (3)].d) < (yyvsp[(3) - (3)].d)) ? (d += 1.) : (d -= 1.)) @@ -7514,7 +7515,7 @@ yyreduce: break; case 324: -#line 3198 "Gmsh.y" +#line 3199 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(double)); if(!(yyvsp[(5) - (5)].d) || ((yyvsp[(1) - (5)].d) < (yyvsp[(3) - (5)].d) && (yyvsp[(5) - (5)].d) < 0) || ((yyvsp[(1) - (5)].d) > (yyvsp[(3) - (5)].d) && (yyvsp[(5) - (5)].d) > 0)){ @@ -7528,7 +7529,7 @@ yyreduce: break; case 325: -#line 3209 "Gmsh.y" +#line 3210 "Gmsh.y" { // Returns the coordinates of a point and fills a list with it. // This allows to ensure e.g. that relative point positions are @@ -7551,7 +7552,7 @@ yyreduce: break; case 326: -#line 3229 "Gmsh.y" +#line 3230 "Gmsh.y" { (yyval.l) = List_Create(List_Nbr((yyvsp[(1) - (1)].l)), 1, sizeof(double)); for(int i = 0; i < List_Nbr((yyvsp[(1) - (1)].l)); i++){ @@ -7564,7 +7565,7 @@ yyreduce: break; case 327: -#line 3239 "Gmsh.y" +#line 3240 "Gmsh.y" { (yyval.l) = List_Create(List_Nbr((yyvsp[(1) - (1)].l)), 1, sizeof(double)); for(int i = 0; i < List_Nbr((yyvsp[(1) - (1)].l)); i++){ @@ -7577,7 +7578,7 @@ yyreduce: break; case 328: -#line 3249 "Gmsh.y" +#line 3250 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(double)); Symbol TheSymbol; @@ -7597,7 +7598,7 @@ yyreduce: break; case 329: -#line 3266 "Gmsh.y" +#line 3267 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(double)); Symbol TheSymbol; @@ -7624,7 +7625,7 @@ yyreduce: break; case 330: -#line 3293 "Gmsh.y" +#line 3294 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(double)); List_Add((yyval.l), &((yyvsp[(1) - (1)].d))); @@ -7632,21 +7633,21 @@ yyreduce: break; case 331: -#line 3298 "Gmsh.y" +#line 3299 "Gmsh.y" { (yyval.l) = (yyvsp[(1) - (1)].l); ;} break; case 332: -#line 3302 "Gmsh.y" +#line 3303 "Gmsh.y" { List_Add((yyval.l), &((yyvsp[(3) - (3)].d))); ;} break; case 333: -#line 3306 "Gmsh.y" +#line 3307 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(3) - (3)].l)); i++){ double d; @@ -7658,21 +7659,21 @@ yyreduce: break; case 334: -#line 3319 "Gmsh.y" +#line 3320 "Gmsh.y" { (yyval.u) = CTX.PACK_COLOR((int)(yyvsp[(2) - (9)].d), (int)(yyvsp[(4) - (9)].d), (int)(yyvsp[(6) - (9)].d), (int)(yyvsp[(8) - (9)].d)); ;} break; case 335: -#line 3323 "Gmsh.y" +#line 3324 "Gmsh.y" { (yyval.u) = CTX.PACK_COLOR((int)(yyvsp[(2) - (7)].d), (int)(yyvsp[(4) - (7)].d), (int)(yyvsp[(6) - (7)].d), 255); ;} break; case 336: -#line 3335 "Gmsh.y" +#line 3336 "Gmsh.y" { int flag; (yyval.u) = Get_ColorForString(ColorString, -1, (yyvsp[(1) - (1)].c), &flag); @@ -7682,7 +7683,7 @@ yyreduce: break; case 337: -#line 3342 "Gmsh.y" +#line 3343 "Gmsh.y" { unsigned int (*pColOpt)(int num, int action, unsigned int value); StringXColor *pColCat; @@ -7703,14 +7704,14 @@ yyreduce: break; case 338: -#line 3363 "Gmsh.y" +#line 3364 "Gmsh.y" { (yyval.l) = (yyvsp[(2) - (3)].l); ;} break; case 339: -#line 3367 "Gmsh.y" +#line 3368 "Gmsh.y" { (yyval.l) = List_Create(256, 10, sizeof(unsigned int)); GmshColorTable *ct = Get_ColorTable((int)(yyvsp[(3) - (6)].d)); @@ -7725,7 +7726,7 @@ yyreduce: break; case 340: -#line 3382 "Gmsh.y" +#line 3383 "Gmsh.y" { (yyval.l) = List_Create(256, 10, sizeof(unsigned int)); List_Add((yyval.l), &((yyvsp[(1) - (1)].u))); @@ -7733,35 +7734,35 @@ yyreduce: break; case 341: -#line 3387 "Gmsh.y" +#line 3388 "Gmsh.y" { List_Add((yyval.l), &((yyvsp[(3) - (3)].u))); ;} break; case 342: -#line 3394 "Gmsh.y" +#line 3395 "Gmsh.y" { (yyval.c) = (yyvsp[(1) - (1)].c); ;} break; case 343: -#line 3398 "Gmsh.y" +#line 3399 "Gmsh.y" { Msg::Warning("Named string expressions not implemented yet"); ;} break; case 344: -#line 3405 "Gmsh.y" +#line 3406 "Gmsh.y" { (yyval.c) = (yyvsp[(1) - (1)].c); ;} break; case 345: -#line 3409 "Gmsh.y" +#line 3410 "Gmsh.y" { (yyval.c) = (char *)Malloc(32*sizeof(char)); time_t now; @@ -7772,7 +7773,7 @@ yyreduce: break; case 346: -#line 3417 "Gmsh.y" +#line 3418 "Gmsh.y" { (yyval.c) = (char *)Malloc((strlen((yyvsp[(3) - (6)].c))+strlen((yyvsp[(5) - (6)].c))+1)*sizeof(char)); strcpy((yyval.c), (yyvsp[(3) - (6)].c)); @@ -7783,7 +7784,7 @@ yyreduce: break; case 347: -#line 3425 "Gmsh.y" +#line 3426 "Gmsh.y" { (yyval.c) = (char *)Malloc((strlen((yyvsp[(3) - (4)].c))+1)*sizeof(char)); int i; @@ -7800,7 +7801,7 @@ yyreduce: break; case 348: -#line 3439 "Gmsh.y" +#line 3440 "Gmsh.y" { (yyval.c) = (char *)Malloc((strlen((yyvsp[(3) - (4)].c))+1)*sizeof(char)); int i; @@ -7817,14 +7818,14 @@ yyreduce: break; case 349: -#line 3453 "Gmsh.y" +#line 3454 "Gmsh.y" { (yyval.c) = (yyvsp[(3) - (4)].c); ;} break; case 350: -#line 3457 "Gmsh.y" +#line 3458 "Gmsh.y" { char tmpstring[1024]; int i = PrintListOfDouble((yyvsp[(3) - (6)].c), (yyvsp[(5) - (6)].l), tmpstring); @@ -7846,7 +7847,7 @@ yyreduce: break; case 351: -#line 3476 "Gmsh.y" +#line 3477 "Gmsh.y" { const char* (*pStrOpt)(int num, int action, const char *value); StringXString *pStrCat; @@ -7872,7 +7873,7 @@ yyreduce: break; case 352: -#line 3499 "Gmsh.y" +#line 3500 "Gmsh.y" { const char* (*pStrOpt)(int num, int action, const char *value); StringXString *pStrCat; @@ -7899,7 +7900,7 @@ yyreduce: /* Line 1267 of yacc.c. */ -#line 7903 "Gmsh.tab.cpp" +#line 7904 "Gmsh.tab.cpp" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -8113,7 +8114,7 @@ yyreturn: } -#line 3523 "Gmsh.y" +#line 3524 "Gmsh.y" void DeleteSymbol(void *a, void *b) diff --git a/Parser/Gmsh.tab.hpp b/Parser/Gmsh.tab.hpp index 325263363094474c27ef30c9c1e0d6d864c34373..7f8f26c5d9d26beceda77a2663a3dcc518f24258 100644 --- a/Parser/Gmsh.tab.hpp +++ b/Parser/Gmsh.tab.hpp @@ -288,7 +288,7 @@ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 81 "Gmsh.y" +#line 82 "Gmsh.y" { char *c; int i; diff --git a/Parser/Gmsh.y b/Parser/Gmsh.y index 057506e3c46d18e8a47046389c3b1dc03859d0c8..60c632b611af73eb4710c778c32d6f8cd1fafd30 100644 --- a/Parser/Gmsh.y +++ b/Parser/Gmsh.y @@ -1,5 +1,5 @@ %{ -// $Id: Gmsh.y,v 1.315 2008-06-07 07:35:45 geuzaine Exp $ +// $Id: Gmsh.y,v 1.316 2008-06-07 17:20:54 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -24,8 +24,9 @@ #include <stdarg.h> #include <time.h> #include "Message.h" -#include "Malloc.h" -#include "Tools.h" +#include "MallocUtils.h" +#include "ListUtils.h" +#include "TreeUtils.h" #include "Numeric.h" #include "Context.h" #include "GModel.h" diff --git a/Parser/Gmsh.yy.cpp b/Parser/Gmsh.yy.cpp index 760764621c5bfc845e2d04f46aab277eaf657385..b6c4c910e5dd4d1e61f4b8b4a492422b4414bf2f 100644 --- a/Parser/Gmsh.yy.cpp +++ b/Parser/Gmsh.yy.cpp @@ -835,7 +835,7 @@ int gmsh_yy_flex_debug = 0; char *gmsh_yytext; #line 1 "Gmsh.l" #line 2 "Gmsh.l" -// $Id: Gmsh.yy.cpp,v 1.365 2008-06-07 07:35:45 geuzaine Exp $ +// $Id: Gmsh.yy.cpp,v 1.366 2008-06-07 17:20:54 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // diff --git a/Parser/Makefile b/Parser/Makefile index 6e697ce5e49bedff120a7b5b3fade34882485814..76b8c6124dae5528ca6c632343394bfce514d49f 100644 --- a/Parser/Makefile +++ b/Parser/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.158 2008-06-05 16:52:14 geuzaine Exp $ +# $Id: Makefile,v 1.159 2008-06-07 17:20:56 geuzaine Exp $ # # Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle # @@ -23,7 +23,7 @@ include ../variables LIB = ../lib/libGmshParser${LIBEXT} -INC = ${DASH}I../Parser ${DASH}I../Common ${DASH}I../DataStr ${DASH}I../Geo ${DASH}I../Mesh\ +INC = ${DASH}I../Parser ${DASH}I../Common ${DASH}I../Geo ${DASH}I../Mesh\ ${DASH}I../Post ${DASH}I../Graphics ${DASH}I../Numeric ${DASH}I../Fltk\ ${DASH}I../Plugin ${DASH}I../contrib/ANN/include @@ -71,9 +71,9 @@ depend: rm -f Makefile.new # DO NOT DELETE THIS LINE -Gmsh.tab.o: Gmsh.tab.cpp ../Common/Message.h ../DataStr/Malloc.h \ - ../DataStr/Tools.h ../DataStr/gmshList.h ../DataStr/Tree.h \ - ../DataStr/avl.h ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h \ +Gmsh.tab.o: Gmsh.tab.cpp ../Common/Message.h ../Common/MallocUtils.h \ + ../Common/ListUtils.h ../Common/TreeUtils.h ../Common/avl.h \ + ../Common/ListUtils.h ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h \ ../Common/Context.h ../Geo/GModel.h ../Geo/GVertex.h ../Geo/GEntity.h \ ../Geo/Range.h ../Geo/SPoint3.h ../Geo/SBoundingBox3d.h \ ../Geo/SPoint3.h ../Geo/GPoint.h ../Geo/SPoint2.h ../Geo/GEdge.h \ @@ -96,28 +96,30 @@ Gmsh.yy.o: Gmsh.yy.cpp ../Common/Message.h ../Numeric/Numeric.h \ ../Numeric/NumericEmbedded.h ../Geo/Geo.h ../Common/GmshDefines.h \ ../Geo/gmshSurface.h ../Geo/Pair.h ../Geo/Range.h ../Geo/SPoint2.h \ ../Geo/SPoint3.h ../Geo/SVector3.h ../Geo/SPoint3.h \ - ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../DataStr/gmshList.h \ - ../DataStr/Tree.h ../DataStr/avl.h ../Geo/SPoint2.h \ - ../Geo/ExtrudeParams.h ../Common/SmoothData.h Gmsh.tab.hpp + ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Common/ListUtils.h \ + ../Common/TreeUtils.h ../Common/avl.h ../Common/ListUtils.h \ + ../Geo/SPoint2.h ../Geo/ExtrudeParams.h ../Common/SmoothData.h \ + Gmsh.tab.hpp OpenFile.o: OpenFile.cpp ../Common/Message.h ../Geo/Geo.h \ ../Common/GmshDefines.h ../Geo/gmshSurface.h ../Geo/Pair.h \ ../Geo/Range.h ../Geo/SPoint2.h ../Geo/SPoint3.h ../Geo/SVector3.h \ ../Geo/SPoint3.h ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h \ - ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h ../DataStr/gmshList.h \ - ../DataStr/Tree.h ../DataStr/avl.h ../Geo/SPoint2.h \ - ../Geo/ExtrudeParams.h ../Common/SmoothData.h ../Geo/GModel.h \ - ../Geo/GVertex.h ../Geo/GEntity.h ../Geo/Range.h ../Geo/SPoint3.h \ - ../Geo/SBoundingBox3d.h ../Geo/GPoint.h ../Geo/SPoint2.h ../Geo/GEdge.h \ - ../Geo/GEntity.h ../Geo/GVertex.h ../Geo/SVector3.h ../Geo/SPoint3.h \ - ../Geo/SPoint2.h ../Geo/GFace.h ../Geo/GEntity.h ../Geo/GPoint.h \ - ../Geo/GEdgeLoop.h ../Geo/GEdge.h ../Geo/SPoint2.h ../Geo/SVector3.h \ - ../Geo/Pair.h ../Geo/GRegion.h ../Geo/GEntity.h ../Geo/SBoundingBox3d.h \ - ../Common/Context.h Parser.h OpenFile.h ../Common/CommandLine.h \ - ../Graphics/ReadImg.h ../Common/OS.h ../Mesh/HighOrder.h \ - ../Post/PView.h ../Post/PViewData.h ../Common/GmshUI.h \ - ../Graphics/Draw.h ../Graphics/SelectBuffer.h ../Fltk/GUI.h \ - ../Fltk/Opengl_Window.h ../Fltk/Colorbar_Window.h ../Post/ColorTable.h \ - ../Fltk/Popup_Button.h ../Fltk/SpherePosition_Widget.h ../Mesh/Field.h + ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h ../Common/ListUtils.h \ + ../Common/TreeUtils.h ../Common/avl.h ../Common/ListUtils.h \ + ../Geo/SPoint2.h ../Geo/ExtrudeParams.h ../Common/SmoothData.h \ + ../Geo/GModel.h ../Geo/GVertex.h ../Geo/GEntity.h ../Geo/Range.h \ + ../Geo/SPoint3.h ../Geo/SBoundingBox3d.h ../Geo/GPoint.h \ + ../Geo/SPoint2.h ../Geo/GEdge.h ../Geo/GEntity.h ../Geo/GVertex.h \ + ../Geo/SVector3.h ../Geo/SPoint3.h ../Geo/SPoint2.h ../Geo/GFace.h \ + ../Geo/GEntity.h ../Geo/GPoint.h ../Geo/GEdgeLoop.h ../Geo/GEdge.h \ + ../Geo/SPoint2.h ../Geo/SVector3.h ../Geo/Pair.h ../Geo/GRegion.h \ + ../Geo/GEntity.h ../Geo/SBoundingBox3d.h ../Common/Context.h Parser.h \ + OpenFile.h ../Common/CommandLine.h ../Graphics/ReadImg.h ../Common/OS.h \ + ../Mesh/HighOrder.h ../Post/PView.h ../Post/PViewData.h \ + ../Common/GmshUI.h ../Graphics/Draw.h ../Graphics/SelectBuffer.h \ + ../Fltk/GUI.h ../Fltk/Opengl_Window.h ../Fltk/Colorbar_Window.h \ + ../Post/ColorTable.h ../Fltk/Popup_Button.h \ + ../Fltk/SpherePosition_Widget.h ../Mesh/Field.h CreateFile.o: CreateFile.cpp ../Common/Message.h ../Geo/GModel.h \ ../Geo/GVertex.h ../Geo/GEntity.h ../Geo/Range.h ../Geo/SPoint3.h \ ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Geo/GPoint.h \ @@ -129,7 +131,7 @@ CreateFile.o: CreateFile.cpp ../Common/Message.h ../Geo/GModel.h \ ../Common/GmshDefines.h OpenFile.h ../Common/Context.h \ ../Common/Options.h ../Post/ColorTable.h ../Common/GmshUI.h \ ../Graphics/gl2ps.h ../Graphics/gl2gif.h ../Graphics/PixelBuffer.h \ - ../DataStr/Malloc.h ../Graphics/Draw.h ../Graphics/gl2jpeg.h \ + ../Common/MallocUtils.h ../Graphics/Draw.h ../Graphics/gl2jpeg.h \ ../Graphics/PixelBuffer.h ../Graphics/gl2png.h \ ../Graphics/PixelBuffer.h ../Graphics/gl2ppm.h \ ../Graphics/PixelBuffer.h ../Graphics/gl2yuv.h \ diff --git a/Parser/Parser.h b/Parser/Parser.h index 4bf3f3b973d6c5a700136b5193de7e19150eb68e..0ea1b2eb6f57922a97cad05b6f3f1f9b6d4622f4 100644 --- a/Parser/Parser.h +++ b/Parser/Parser.h @@ -20,8 +20,8 @@ // // Please report all bugs and problems to <gmsh@geuz.org>. -#include "gmshList.h" -#include "Tree.h" +#include "ListUtils.h" +#include "TreeUtils.h" typedef struct { char *Name; diff --git a/Plugin/Levelset.cpp b/Plugin/Levelset.cpp index f05fae5eb131c58bb80e68d9ee2a30ec073a52f2..bc703c65bf9217e0ae9581e03fb6f69ad6803bb3 100644 --- a/Plugin/Levelset.cpp +++ b/Plugin/Levelset.cpp @@ -1,4 +1,4 @@ -// $Id: Levelset.cpp,v 1.48 2008-06-05 13:57:47 samtech Exp $ +// $Id: Levelset.cpp,v 1.49 2008-06-07 17:20:56 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -21,7 +21,7 @@ #include "Levelset.h" #include "MakeSimplex.h" -#include "gmshList.h" +#include "ListUtils.h" #include "Numeric.h" #include "adaptiveData.h" diff --git a/Plugin/Makefile b/Plugin/Makefile index 682a317e700e489dc63078596f7a86c96561c64f..7b27f42b7dbcb98b4d4e4e83374db89576a2cc3a 100644 --- a/Plugin/Makefile +++ b/Plugin/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.170 2008-06-05 16:52:15 geuzaine Exp $ +# $Id: Makefile,v 1.171 2008-06-07 17:20:56 geuzaine Exp $ # # Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle # @@ -23,7 +23,7 @@ include ../variables LIB = ../lib/libGmshPlugin${LIBEXT} -INC = ${DASH}I../Common ${DASH}I../Graphics ${DASH}I../DataStr ${DASH}I../Geo\ +INC = ${DASH}I../Common ${DASH}I../Graphics ${DASH}I../Geo\ ${DASH}I../Mesh ${DASH}I../Post ${DASH}I../Fltk ${DASH}I../Numeric\ ${DASH}I../contrib/ANN/include ${DASH}I../contrib/Triangle\ ${DASH}I../contrib/MathEval @@ -79,77 +79,78 @@ depend: Plugin.o: Plugin.cpp Plugin.h ../Common/Options.h ../Post/ColorTable.h \ ../Common/Message.h ../Post/PView.h ../Geo/SPoint3.h \ ../Post/PViewDataList.h ../Post/PViewData.h ../Geo/SBoundingBox3d.h \ - ../Geo/SPoint3.h ../DataStr/gmshList.h ../Common/GmshMatrix.h + ../Geo/SPoint3.h ../Common/ListUtils.h ../Common/GmshMatrix.h PluginManager.o: PluginManager.cpp Plugin.h ../Common/Options.h \ ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \ ../Geo/SPoint3.h ../Post/PViewDataList.h ../Post/PViewData.h \ - ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../DataStr/gmshList.h \ + ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Common/ListUtils.h \ ../Common/GmshMatrix.h PluginManager.h CutMap.h Levelset.h CutGrid.h \ StreamLines.h CutPlane.h CutParametric.h CutSphere.h Skin.h \ - ../DataStr/Tree.h ../DataStr/avl.h Extract.h ExtractElements.h \ - ExtractEdges.h HarmonicToTime.h ModulusPhase.h Integrate.h Gradient.h \ - Curl.h Divergence.h Annotate.h Remove.h MakeSimplex.h Smooth.h \ - Transform.h TransformLatLon.h Triangulate.h Warp.h SphericalRaise.h \ - Eigenvectors.h Eigenvalues.h Lambda2.h Evaluate.h ../Post/OctreePost.h \ - ../Common/Octree.h ../Common/OctreeInternals.h Probe.h FieldView.h \ - GSHHS.h ../Common/Context.h + ../Common/TreeUtils.h ../Common/avl.h ../Common/ListUtils.h Extract.h \ + ExtractElements.h ExtractEdges.h HarmonicToTime.h ModulusPhase.h \ + Integrate.h Gradient.h Curl.h Divergence.h Annotate.h Remove.h \ + MakeSimplex.h Smooth.h Transform.h TransformLatLon.h Triangulate.h \ + Warp.h SphericalRaise.h Eigenvectors.h Eigenvalues.h Lambda2.h \ + Evaluate.h ../Post/OctreePost.h ../Common/Octree.h \ + ../Common/OctreeInternals.h Probe.h FieldView.h GSHHS.h \ + ../Common/Context.h Levelset.o: Levelset.cpp Levelset.h Plugin.h ../Common/Options.h \ ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \ ../Geo/SPoint3.h ../Post/PViewDataList.h ../Post/PViewData.h \ - ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../DataStr/gmshList.h \ + ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Common/ListUtils.h \ ../Common/GmshMatrix.h MakeSimplex.h ../Numeric/Numeric.h \ ../Numeric/NumericEmbedded.h ../Post/adaptiveData.h CutPlane.o: CutPlane.cpp CutPlane.h Levelset.h Plugin.h \ ../Common/Options.h ../Post/ColorTable.h ../Common/Message.h \ ../Post/PView.h ../Geo/SPoint3.h ../Post/PViewDataList.h \ ../Post/PViewData.h ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h \ - ../DataStr/gmshList.h ../Common/GmshMatrix.h ../Common/Context.h \ + ../Common/ListUtils.h ../Common/GmshMatrix.h ../Common/Context.h \ ../Common/GmshUI.h ../Graphics/Draw.h CutSphere.o: CutSphere.cpp CutSphere.h Levelset.h Plugin.h \ ../Common/Options.h ../Post/ColorTable.h ../Common/Message.h \ ../Post/PView.h ../Geo/SPoint3.h ../Post/PViewDataList.h \ ../Post/PViewData.h ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h \ - ../DataStr/gmshList.h ../Common/GmshMatrix.h ../Common/Context.h \ + ../Common/ListUtils.h ../Common/GmshMatrix.h ../Common/Context.h \ ../Common/GmshUI.h ../Graphics/Draw.h CutMap.o: CutMap.cpp CutMap.h Levelset.h Plugin.h ../Common/Options.h \ ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \ ../Geo/SPoint3.h ../Post/PViewDataList.h ../Post/PViewData.h \ - ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../DataStr/gmshList.h \ + ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Common/ListUtils.h \ ../Common/GmshMatrix.h ../Common/Context.h Smooth.o: Smooth.cpp Smooth.h Plugin.h ../Common/Options.h \ ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \ ../Geo/SPoint3.h ../Post/PViewDataList.h ../Post/PViewData.h \ - ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../DataStr/gmshList.h \ + ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Common/ListUtils.h \ ../Common/GmshMatrix.h CutParametric.o: CutParametric.cpp ../Post/OctreePost.h \ ../Common/Octree.h ../Common/OctreeInternals.h CutParametric.h Plugin.h \ ../Common/Options.h ../Post/ColorTable.h ../Common/Message.h \ ../Post/PView.h ../Geo/SPoint3.h ../Post/PViewDataList.h \ ../Post/PViewData.h ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h \ - ../DataStr/gmshList.h ../Common/GmshMatrix.h ../Common/Context.h \ + ../Common/ListUtils.h ../Common/GmshMatrix.h ../Common/Context.h \ ../Common/GmshUI.h ../Graphics/Draw.h Lambda2.o: Lambda2.cpp Lambda2.h Plugin.h ../Common/Options.h \ ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \ ../Geo/SPoint3.h ../Post/PViewDataList.h ../Post/PViewData.h \ - ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../DataStr/gmshList.h \ + ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Common/ListUtils.h \ ../Common/GmshMatrix.h ../Numeric/Numeric.h \ ../Numeric/NumericEmbedded.h Eigenvectors.o: Eigenvectors.cpp Eigenvectors.h Plugin.h \ ../Common/Options.h ../Post/ColorTable.h ../Common/Message.h \ ../Post/PView.h ../Geo/SPoint3.h ../Post/PViewDataList.h \ ../Post/PViewData.h ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h \ - ../DataStr/gmshList.h ../Common/GmshMatrix.h ../Numeric/Numeric.h \ + ../Common/ListUtils.h ../Common/GmshMatrix.h ../Numeric/Numeric.h \ ../Numeric/NumericEmbedded.h ../Numeric/EigSolve.h Eigenvalues.o: Eigenvalues.cpp Eigenvalues.h Plugin.h ../Common/Options.h \ ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \ ../Geo/SPoint3.h ../Post/PViewDataList.h ../Post/PViewData.h \ - ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../DataStr/gmshList.h \ + ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Common/ListUtils.h \ ../Common/GmshMatrix.h ../Numeric/Numeric.h \ ../Numeric/NumericEmbedded.h StreamLines.o: StreamLines.cpp StreamLines.h Plugin.h ../Common/Options.h \ ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \ ../Geo/SPoint3.h ../Post/PViewDataList.h ../Post/PViewData.h \ - ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../DataStr/gmshList.h \ + ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Common/ListUtils.h \ ../Common/GmshMatrix.h ../Post/OctreePost.h ../Common/Octree.h \ ../Common/OctreeInternals.h ../Common/Context.h ../Post/PViewOptions.h \ ../Post/ColorTable.h ../Common/GmshUI.h ../Graphics/Draw.h @@ -157,19 +158,19 @@ CutGrid.o: CutGrid.cpp ../Post/OctreePost.h ../Common/Octree.h \ ../Common/OctreeInternals.h CutGrid.h Plugin.h ../Common/Options.h \ ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \ ../Geo/SPoint3.h ../Post/PViewDataList.h ../Post/PViewData.h \ - ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../DataStr/gmshList.h \ + ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Common/ListUtils.h \ ../Common/GmshMatrix.h ../Common/Context.h ../Common/GmshUI.h \ ../Graphics/Draw.h Transform.o: Transform.cpp Transform.h Plugin.h ../Common/Options.h \ ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \ ../Geo/SPoint3.h ../Post/PViewDataList.h ../Post/PViewData.h \ - ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../DataStr/gmshList.h \ + ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Common/ListUtils.h \ ../Common/GmshMatrix.h TransformLatLon.o: TransformLatLon.cpp TransformLatLon.h Plugin.h \ ../Common/Options.h ../Post/ColorTable.h ../Common/Message.h \ ../Post/PView.h ../Geo/SPoint3.h ../Post/PViewDataList.h \ ../Post/PViewData.h ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h \ - ../DataStr/gmshList.h ../Common/GmshMatrix.h + ../Common/ListUtils.h ../Common/GmshMatrix.h Triangulate.o: Triangulate.cpp ../Geo/GModel.h ../Geo/GVertex.h \ ../Geo/GEntity.h ../Geo/Range.h ../Geo/SPoint3.h \ ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Geo/GPoint.h \ @@ -182,59 +183,59 @@ Triangulate.o: Triangulate.cpp ../Geo/GModel.h ../Geo/GVertex.h \ ../Mesh/DivideAndConquer.h ../Common/Message.h ../Geo/MVertex.h \ ../Geo/SPoint3.h Triangulate.h Plugin.h ../Common/Options.h \ ../Post/ColorTable.h ../Post/PView.h ../Post/PViewDataList.h \ - ../Post/PViewData.h ../DataStr/gmshList.h ../Common/GmshMatrix.h \ + ../Post/PViewData.h ../Common/ListUtils.h ../Common/GmshMatrix.h \ ../Common/Context.h Warp.o: Warp.cpp Warp.h Plugin.h ../Common/Options.h ../Post/ColorTable.h \ ../Common/Message.h ../Post/PView.h ../Geo/SPoint3.h \ ../Post/PViewDataList.h ../Post/PViewData.h ../Geo/SBoundingBox3d.h \ - ../Geo/SPoint3.h ../DataStr/gmshList.h ../Common/GmshMatrix.h \ + ../Geo/SPoint3.h ../Common/ListUtils.h ../Common/GmshMatrix.h \ ../Common/SmoothData.h ../Numeric/Numeric.h \ ../Numeric/NumericEmbedded.h SphericalRaise.o: SphericalRaise.cpp SphericalRaise.h Plugin.h \ ../Common/Options.h ../Post/ColorTable.h ../Common/Message.h \ ../Post/PView.h ../Geo/SPoint3.h ../Post/PViewDataList.h \ ../Post/PViewData.h ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h \ - ../DataStr/gmshList.h ../Common/GmshMatrix.h ../Numeric/Numeric.h \ + ../Common/ListUtils.h ../Common/GmshMatrix.h ../Numeric/Numeric.h \ ../Numeric/NumericEmbedded.h Skin.o: Skin.cpp Skin.h Plugin.h ../Common/Options.h ../Post/ColorTable.h \ ../Common/Message.h ../Post/PView.h ../Geo/SPoint3.h \ ../Post/PViewDataList.h ../Post/PViewData.h ../Geo/SBoundingBox3d.h \ - ../Geo/SPoint3.h ../DataStr/gmshList.h ../Common/GmshMatrix.h \ - ../DataStr/Tree.h ../DataStr/avl.h ../DataStr/Malloc.h \ - ../Common/Context.h + ../Geo/SPoint3.h ../Common/ListUtils.h ../Common/GmshMatrix.h \ + ../Common/TreeUtils.h ../Common/avl.h ../Common/ListUtils.h \ + ../Common/MallocUtils.h ../Common/Context.h GSHHS.o: GSHHS.cpp GSHHS.h Plugin.h ../Common/Options.h \ ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \ ../Geo/SPoint3.h ../Post/PViewDataList.h ../Post/PViewData.h \ - ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../DataStr/gmshList.h \ + ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Common/ListUtils.h \ ../Common/GmshMatrix.h ../Mesh/Field.h ../Geo/Geo.h \ ../Common/GmshDefines.h ../Geo/gmshSurface.h ../Geo/Pair.h \ ../Geo/Range.h ../Geo/SPoint2.h ../Geo/SPoint3.h ../Geo/SVector3.h \ ../Geo/SPoint3.h ../Geo/SBoundingBox3d.h ../Numeric/Numeric.h \ - ../Numeric/NumericEmbedded.h ../DataStr/Tree.h ../DataStr/avl.h \ - ../Geo/SPoint2.h ../Geo/ExtrudeParams.h ../Common/SmoothData.h \ - ../Geo/GModel.h ../Geo/GVertex.h ../Geo/GEntity.h ../Geo/Range.h \ - ../Geo/SPoint3.h ../Geo/SBoundingBox3d.h ../Geo/GPoint.h \ - ../Geo/SPoint2.h ../Geo/GEdge.h ../Geo/GEntity.h ../Geo/GVertex.h \ - ../Geo/SVector3.h ../Geo/SPoint3.h ../Geo/SPoint2.h ../Geo/GFace.h \ - ../Geo/GEntity.h ../Geo/GPoint.h ../Geo/GEdgeLoop.h ../Geo/GEdge.h \ - ../Geo/SPoint2.h ../Geo/SVector3.h ../Geo/Pair.h ../Geo/GRegion.h \ - ../Geo/GEntity.h ../Geo/SBoundingBox3d.h + ../Numeric/NumericEmbedded.h ../Common/TreeUtils.h ../Common/avl.h \ + ../Common/ListUtils.h ../Geo/SPoint2.h ../Geo/ExtrudeParams.h \ + ../Common/SmoothData.h ../Geo/GModel.h ../Geo/GVertex.h \ + ../Geo/GEntity.h ../Geo/Range.h ../Geo/SPoint3.h \ + ../Geo/SBoundingBox3d.h ../Geo/GPoint.h ../Geo/SPoint2.h ../Geo/GEdge.h \ + ../Geo/GEntity.h ../Geo/GVertex.h ../Geo/SVector3.h ../Geo/SPoint3.h \ + ../Geo/SPoint2.h ../Geo/GFace.h ../Geo/GEntity.h ../Geo/GPoint.h \ + ../Geo/GEdgeLoop.h ../Geo/GEdge.h ../Geo/SPoint2.h ../Geo/SVector3.h \ + ../Geo/Pair.h ../Geo/GRegion.h ../Geo/GEntity.h ../Geo/SBoundingBox3d.h Extract.o: Extract.cpp Extract.h Plugin.h ../Common/Options.h \ ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \ ../Geo/SPoint3.h ../Post/PViewDataList.h ../Post/PViewData.h \ - ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../DataStr/gmshList.h \ + ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Common/ListUtils.h \ ../Common/GmshMatrix.h ExtractElements.o: ExtractElements.cpp ExtractElements.h Plugin.h \ ../Common/Options.h ../Post/ColorTable.h ../Common/Message.h \ ../Post/PView.h ../Geo/SPoint3.h ../Post/PViewDataList.h \ ../Post/PViewData.h ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h \ - ../DataStr/gmshList.h ../Common/GmshMatrix.h ../Numeric/Numeric.h \ + ../Common/ListUtils.h ../Common/GmshMatrix.h ../Numeric/Numeric.h \ ../Numeric/NumericEmbedded.h ExtractEdges.o: ExtractEdges.cpp ExtractEdges.h Plugin.h \ ../Common/Options.h ../Post/ColorTable.h ../Common/Message.h \ ../Post/PView.h ../Geo/SPoint3.h ../Post/PViewDataList.h \ ../Post/PViewData.h ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h \ - ../DataStr/gmshList.h ../Common/GmshMatrix.h ../Mesh/BDS.h \ + ../Common/ListUtils.h ../Common/GmshMatrix.h ../Mesh/BDS.h \ ../Geo/GFace.h ../Geo/GEntity.h ../Geo/Range.h ../Geo/SPoint3.h \ ../Geo/SBoundingBox3d.h ../Geo/GPoint.h ../Geo/GEdgeLoop.h \ ../Geo/GEdge.h ../Geo/GEntity.h ../Geo/GVertex.h ../Geo/GEntity.h \ @@ -244,78 +245,78 @@ ExtractEdges.o: ExtractEdges.cpp ExtractEdges.h Plugin.h \ MakeSimplex.o: MakeSimplex.cpp MakeSimplex.h Plugin.h ../Common/Options.h \ ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \ ../Geo/SPoint3.h ../Post/PViewDataList.h ../Post/PViewData.h \ - ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../DataStr/gmshList.h \ + ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Common/ListUtils.h \ ../Common/GmshMatrix.h Evaluate.o: Evaluate.cpp Evaluate.h Plugin.h ../Common/Options.h \ ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \ ../Geo/SPoint3.h ../Post/PViewDataList.h ../Post/PViewData.h \ - ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../DataStr/gmshList.h \ + ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Common/ListUtils.h \ ../Common/GmshMatrix.h ../Post/OctreePost.h ../Common/Octree.h \ ../Common/OctreeInternals.h FieldView.o: FieldView.cpp FieldView.h Plugin.h ../Common/Options.h \ ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \ ../Geo/SPoint3.h ../Post/PViewDataList.h ../Post/PViewData.h \ - ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../DataStr/gmshList.h \ + ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Common/ListUtils.h \ ../Common/GmshMatrix.h ../Mesh/Field.h ../Geo/Geo.h \ ../Common/GmshDefines.h ../Geo/gmshSurface.h ../Geo/Pair.h \ ../Geo/Range.h ../Geo/SPoint2.h ../Geo/SPoint3.h ../Geo/SVector3.h \ ../Geo/SPoint3.h ../Geo/SBoundingBox3d.h ../Numeric/Numeric.h \ - ../Numeric/NumericEmbedded.h ../DataStr/Tree.h ../DataStr/avl.h \ - ../Geo/SPoint2.h ../Geo/ExtrudeParams.h ../Common/SmoothData.h \ - ../Geo/GModel.h ../Geo/GVertex.h ../Geo/GEntity.h ../Geo/Range.h \ - ../Geo/SPoint3.h ../Geo/SBoundingBox3d.h ../Geo/GPoint.h \ - ../Geo/SPoint2.h ../Geo/GEdge.h ../Geo/GEntity.h ../Geo/GVertex.h \ - ../Geo/SVector3.h ../Geo/SPoint3.h ../Geo/SPoint2.h ../Geo/GFace.h \ - ../Geo/GEntity.h ../Geo/GPoint.h ../Geo/GEdgeLoop.h ../Geo/GEdge.h \ - ../Geo/SPoint2.h ../Geo/SVector3.h ../Geo/Pair.h ../Geo/GRegion.h \ - ../Geo/GEntity.h ../Geo/SBoundingBox3d.h + ../Numeric/NumericEmbedded.h ../Common/TreeUtils.h ../Common/avl.h \ + ../Common/ListUtils.h ../Geo/SPoint2.h ../Geo/ExtrudeParams.h \ + ../Common/SmoothData.h ../Geo/GModel.h ../Geo/GVertex.h \ + ../Geo/GEntity.h ../Geo/Range.h ../Geo/SPoint3.h \ + ../Geo/SBoundingBox3d.h ../Geo/GPoint.h ../Geo/SPoint2.h ../Geo/GEdge.h \ + ../Geo/GEntity.h ../Geo/GVertex.h ../Geo/SVector3.h ../Geo/SPoint3.h \ + ../Geo/SPoint2.h ../Geo/GFace.h ../Geo/GEntity.h ../Geo/GPoint.h \ + ../Geo/GEdgeLoop.h ../Geo/GEdge.h ../Geo/SPoint2.h ../Geo/SVector3.h \ + ../Geo/Pair.h ../Geo/GRegion.h ../Geo/GEntity.h ../Geo/SBoundingBox3d.h Integrate.o: Integrate.cpp Integrate.h Plugin.h ../Common/Options.h \ ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \ ../Geo/SPoint3.h ../Post/PViewDataList.h ../Post/PViewData.h \ - ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../DataStr/gmshList.h \ + ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Common/ListUtils.h \ ../Common/GmshMatrix.h ../Post/shapeFunctions.h ../Numeric/Numeric.h \ ../Numeric/NumericEmbedded.h ../Post/PViewOptions.h \ ../Post/ColorTable.h Gradient.o: Gradient.cpp Gradient.h Plugin.h ../Common/Options.h \ ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \ ../Geo/SPoint3.h ../Post/PViewDataList.h ../Post/PViewData.h \ - ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../DataStr/gmshList.h \ + ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Common/ListUtils.h \ ../Common/GmshMatrix.h ../Post/shapeFunctions.h ../Numeric/Numeric.h \ ../Numeric/NumericEmbedded.h Curl.o: Curl.cpp Curl.h Plugin.h ../Common/Options.h ../Post/ColorTable.h \ ../Common/Message.h ../Post/PView.h ../Geo/SPoint3.h \ ../Post/PViewDataList.h ../Post/PViewData.h ../Geo/SBoundingBox3d.h \ - ../Geo/SPoint3.h ../DataStr/gmshList.h ../Common/GmshMatrix.h \ + ../Geo/SPoint3.h ../Common/ListUtils.h ../Common/GmshMatrix.h \ ../Post/shapeFunctions.h ../Numeric/Numeric.h \ ../Numeric/NumericEmbedded.h Divergence.o: Divergence.cpp Divergence.h Plugin.h ../Common/Options.h \ ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \ ../Geo/SPoint3.h ../Post/PViewDataList.h ../Post/PViewData.h \ - ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../DataStr/gmshList.h \ + ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Common/ListUtils.h \ ../Common/GmshMatrix.h ../Post/shapeFunctions.h ../Numeric/Numeric.h \ ../Numeric/NumericEmbedded.h Annotate.o: Annotate.cpp Annotate.h Plugin.h ../Common/Options.h \ ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \ ../Geo/SPoint3.h ../Post/PViewDataList.h ../Post/PViewData.h \ - ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../DataStr/gmshList.h \ + ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Common/ListUtils.h \ ../Common/GmshMatrix.h ../Common/Context.h ../Common/GmshUI.h \ ../Fltk/GUI.h ../Fltk/Opengl_Window.h ../Fltk/Colorbar_Window.h \ ../Fltk/Popup_Button.h ../Fltk/SpherePosition_Widget.h ../Mesh/Field.h \ ../Geo/Geo.h ../Common/GmshDefines.h ../Geo/gmshSurface.h ../Geo/Pair.h \ ../Geo/Range.h ../Geo/SPoint2.h ../Geo/SPoint3.h ../Geo/SVector3.h \ ../Geo/SPoint3.h ../Geo/SBoundingBox3d.h ../Numeric/Numeric.h \ - ../Numeric/NumericEmbedded.h ../DataStr/Tree.h ../DataStr/avl.h \ - ../Geo/SPoint2.h ../Geo/ExtrudeParams.h ../Common/SmoothData.h \ - ../Graphics/Draw.h + ../Numeric/NumericEmbedded.h ../Common/TreeUtils.h ../Common/avl.h \ + ../Common/ListUtils.h ../Geo/SPoint2.h ../Geo/ExtrudeParams.h \ + ../Common/SmoothData.h ../Graphics/Draw.h Remove.o: Remove.cpp Remove.h Plugin.h ../Common/Options.h \ ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \ ../Geo/SPoint3.h ../Post/PViewDataList.h ../Post/PViewData.h \ - ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../DataStr/gmshList.h \ + ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Common/ListUtils.h \ ../Common/GmshMatrix.h Probe.o: Probe.cpp Probe.h Plugin.h ../Common/Options.h \ ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \ ../Geo/SPoint3.h ../Post/PViewDataList.h ../Post/PViewData.h \ - ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../DataStr/gmshList.h \ + ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Common/ListUtils.h \ ../Common/GmshMatrix.h ../Common/Context.h ../Post/OctreePost.h \ ../Common/Octree.h ../Common/OctreeInternals.h ../Common/GmshUI.h \ ../Graphics/Draw.h @@ -323,9 +324,9 @@ HarmonicToTime.o: HarmonicToTime.cpp HarmonicToTime.h Plugin.h \ ../Common/Options.h ../Post/ColorTable.h ../Common/Message.h \ ../Post/PView.h ../Geo/SPoint3.h ../Post/PViewDataList.h \ ../Post/PViewData.h ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h \ - ../DataStr/gmshList.h ../Common/GmshMatrix.h + ../Common/ListUtils.h ../Common/GmshMatrix.h ModulusPhase.o: ModulusPhase.cpp ModulusPhase.h Plugin.h \ ../Common/Options.h ../Post/ColorTable.h ../Common/Message.h \ ../Post/PView.h ../Geo/SPoint3.h ../Post/PViewDataList.h \ ../Post/PViewData.h ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h \ - ../DataStr/gmshList.h ../Common/GmshMatrix.h + ../Common/ListUtils.h ../Common/GmshMatrix.h diff --git a/Plugin/Skin.cpp b/Plugin/Skin.cpp index ca9aeb90f206a6129de8328cbbdb85e4e9c56de5..1c4e9e7c2bf7aa9b49acde9bc460f791f1db8ed8 100644 --- a/Plugin/Skin.cpp +++ b/Plugin/Skin.cpp @@ -1,4 +1,4 @@ -// $Id: Skin.cpp,v 1.38 2008-04-05 17:49:23 geuzaine Exp $ +// $Id: Skin.cpp,v 1.39 2008-06-07 17:20:57 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -20,7 +20,7 @@ // Please report all bugs and problems to <gmsh@geuz.org>. #include "Skin.h" -#include "Malloc.h" +#include "MallocUtils.h" #include "Context.h" extern Context_T CTX; diff --git a/Plugin/Skin.h b/Plugin/Skin.h index 332bfd0f11d258a4af6c452c5bbf8c97c4630755..3c16da98abb97b4a4f10804dc66391b331643327 100644 --- a/Plugin/Skin.h +++ b/Plugin/Skin.h @@ -21,8 +21,8 @@ // Please report all bugs and problems to <gmsh@geuz.org>. #include "Plugin.h" -#include "gmshList.h" -#include "Tree.h" +#include "ListUtils.h" +#include "TreeUtils.h" extern "C" { diff --git a/Post/Makefile b/Post/Makefile index e3a3a53cb8bee05713905d8bdad4bae74f92eadb..c82c7c8aa058e8b4e269b2ad83c996d57093b987 100644 --- a/Post/Makefile +++ b/Post/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.50 2008-06-05 16:52:15 geuzaine Exp $ +# $Id: Makefile,v 1.51 2008-06-07 17:20:57 geuzaine Exp $ # # Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle # @@ -23,7 +23,7 @@ include ../variables LIB = ../lib/libGmshPost${LIBEXT} -INC = ${DASH}I../Common ${DASH}I../DataStr ${DASH}I../Geo ${DASH}I../Mesh\ +INC = ${DASH}I../Common ${DASH}I../Geo ${DASH}I../Mesh\ ${DASH}I../Post ${DASH}I../Graphics ${DASH}I../Numeric ${DASH}I../Parser\ ${DASH}I../Plugin ${DASH}I../Fltk ${DASH}I../contrib/MathEval\ ${DASH}I../contrib/ANN/include @@ -67,12 +67,12 @@ depend: # DO NOT DELETE THIS LINE PView.o: PView.cpp PView.h ../Geo/SPoint3.h PViewOptions.h ColorTable.h \ ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h PViewData.h PViewDataList.h \ - ../DataStr/gmshList.h ../Common/VertexArray.h ../Geo/SVector3.h \ + ../Common/ListUtils.h ../Common/VertexArray.h ../Geo/SVector3.h \ ../Geo/SPoint3.h ../Common/Context.h ../Common/SmoothData.h \ adaptiveData.h ../Common/GmshMatrix.h ../Common/Message.h PViewIO.o: PViewIO.cpp PView.h ../Geo/SPoint3.h PViewDataList.h \ PViewData.h ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h \ - ../DataStr/gmshList.h PViewDataGModel.h ../Geo/GModel.h \ + ../Common/ListUtils.h PViewDataGModel.h ../Geo/GModel.h \ ../Geo/GVertex.h ../Geo/GEntity.h ../Geo/Range.h ../Geo/SPoint3.h \ ../Geo/SBoundingBox3d.h ../Geo/GPoint.h ../Geo/SPoint2.h ../Geo/GEdge.h \ ../Geo/GEntity.h ../Geo/GVertex.h ../Geo/SVector3.h ../Geo/SPoint3.h \ @@ -81,18 +81,18 @@ PViewIO.o: PViewIO.cpp PView.h ../Geo/SPoint3.h PViewDataList.h \ ../Geo/SVector3.h ../Geo/Pair.h ../Geo/GRegion.h ../Geo/GEntity.h \ ../Geo/SBoundingBox3d.h ../Common/StringUtils.h ../Common/Message.h PViewData.o: PViewData.cpp PViewData.h ../Geo/SBoundingBox3d.h \ - ../Geo/SPoint3.h ../DataStr/gmshList.h adaptiveData.h \ + ../Geo/SPoint3.h ../Common/ListUtils.h adaptiveData.h \ ../Common/GmshMatrix.h ../Numeric/Numeric.h \ ../Numeric/NumericEmbedded.h ../Common/Message.h PViewDataIO.o: PViewDataIO.cpp ../Common/Message.h ../Numeric/Numeric.h \ ../Numeric/NumericEmbedded.h PViewData.h ../Geo/SBoundingBox3d.h \ ../Geo/SPoint3.h PViewDataList.o: PViewDataList.cpp PViewDataList.h PViewData.h \ - ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../DataStr/gmshList.h \ + ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Common/ListUtils.h \ ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h \ ../Common/SmoothData.h ../Common/Message.h ../Common/Context.h PViewDataListIO.o: PViewDataListIO.cpp PViewDataList.h PViewData.h \ - ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../DataStr/gmshList.h \ + ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Common/ListUtils.h \ ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h ../Common/Message.h \ ../Common/Context.h PViewDataGModel.o: PViewDataGModel.cpp PViewDataGModel.h PViewData.h \ @@ -126,10 +126,10 @@ PViewOptions.o: PViewOptions.cpp PViewOptions.h ColorTable.h \ adaptiveData.o: adaptiveData.cpp ../Plugin/Plugin.h ../Common/Options.h \ ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \ ../Geo/SPoint3.h ../Post/PViewDataList.h ../Post/PViewData.h \ - ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../DataStr/gmshList.h \ + ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Common/ListUtils.h \ ../Common/GmshMatrix.h adaptiveData.h OctreePost.o: OctreePost.cpp ../Common/Octree.h \ - ../Common/OctreeInternals.h OctreePost.h ../DataStr/gmshList.h PView.h \ + ../Common/OctreeInternals.h OctreePost.h ../Common/ListUtils.h PView.h \ ../Geo/SPoint3.h PViewDataList.h PViewData.h ../Geo/SBoundingBox3d.h \ ../Geo/SPoint3.h PViewDataGModel.h ../Geo/GModel.h ../Geo/GVertex.h \ ../Geo/GEntity.h ../Geo/Range.h ../Geo/SPoint3.h \ diff --git a/Post/OctreePost.cpp b/Post/OctreePost.cpp index f08bf5327fd575c43abd8df9bdc939cd9630cafd..8e633cacbda30aa2b40dd59b1ea23354ea2823e2 100644 --- a/Post/OctreePost.cpp +++ b/Post/OctreePost.cpp @@ -1,4 +1,4 @@ -// $Id: OctreePost.cpp,v 1.14 2008-06-05 13:57:47 samtech Exp $ +// $Id: OctreePost.cpp,v 1.15 2008-06-07 17:20:57 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -21,7 +21,7 @@ #include "Octree.h" #include "OctreePost.h" -#include "gmshList.h" +#include "ListUtils.h" #include "PView.h" #include "PViewDataList.h" #include "PViewDataGModel.h" diff --git a/Post/PViewData.cpp b/Post/PViewData.cpp index 2f517b0e54e8491ab9bdb302064a236fdf0660b8..b958942e5ce824562d5d4f5d83d0a7299b21a4b1 100644 --- a/Post/PViewData.cpp +++ b/Post/PViewData.cpp @@ -1,4 +1,4 @@ -// $Id: PViewData.cpp,v 1.22 2008-06-05 16:52:15 geuzaine Exp $ +// $Id: PViewData.cpp,v 1.23 2008-06-07 17:20:57 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -23,7 +23,7 @@ // #include "PViewData.h" -#include "gmshList.h" +#include "ListUtils.h" #include "adaptiveData.h" #include "Numeric.h" #include "Message.h" diff --git a/Post/PViewDataList.h b/Post/PViewDataList.h index 5bdaa81cf820e634f0371d3b1c8dc4daa23199c9..25973330d236f8e36118fae99fa44af95049bb6c 100644 --- a/Post/PViewDataList.h +++ b/Post/PViewDataList.h @@ -24,7 +24,7 @@ #include <string> #include "PViewData.h" #include "SBoundingBox3d.h" -#include "gmshList.h" +#include "ListUtils.h" // list-based datasets (all elements are discontinuous) class PViewDataList : public PViewData { diff --git a/Post/adaptiveData.h b/Post/adaptiveData.h index 04a2de2dcedc753c069e30740d2bf8a116dc32c2..8ae33bf032497712b4baf234f251ff269879f8fd 100644 --- a/Post/adaptiveData.h +++ b/Post/adaptiveData.h @@ -22,7 +22,7 @@ #include <list> #include <set> -#include "gmshList.h" +#include "ListUtils.h" #include "GmshMatrix.h" class PViewData; diff --git a/configure b/configure index f8fdde7c237d34ef249fe46ceb8c6645cfad9a86..75603f79783b16dd524dabf3b61db001481045af 100755 --- a/configure +++ b/configure @@ -3650,10 +3650,9 @@ esac if test "x$enable_gui" != "xno"; then - GMSH_DIRS="Common DataStr Geo Mesh Post Numeric Parser Plugin Graphics Fltk" - GMSH_LIBS="-Llib -lGmshFltk -lGmshParser -lGmshGraphics -lGmshPlugin" - GMSH_LIBS="${GMSH_LIBS} -lGmshMesh -lGmshGeo -lGmshPost -lGmshCommon" - GMSH_LIBS="${GMSH_LIBS} -lGmshDataStr -lGmshNumeric" + GMSH_DIRS="Common Geo Mesh Post Numeric Parser Plugin Graphics Fltk" + GMSH_LIBS="-Llib -lGmshFltk -lGmshParser -lGmshGraphics -lGmshPlugin -lGmshMesh" + GMSH_LIBS="${GMSH_LIBS} -lGmshGeo -lGmshPost -lGmshCommon -lGmshNumeric" FLAGS="-DHAVE_FLTK ${FLAGS}" if test "x${FLTK_PREFIX}" != "x" ; then @@ -4112,15 +4111,13 @@ fi else if test "x$enable_post" != "xno"; then - GMSH_DIRS="Common DataStr Geo Mesh Post Numeric Parser Plugin" - GMSH_LIBS="-Llib Common/Main.o -lGmshParser -lGmshPlugin" - GMSH_LIBS="${GMSH_LIBS} -lGmshGeo -lGmshMesh -lGmshPost -lGmshCommon" - GMSH_LIBS="${GMSH_LIBS} -lGmshDataStr -lGmshNumeric" + GMSH_DIRS="Common Geo Mesh Post Numeric Parser Plugin" + GMSH_LIBS="-Llib Common/Main.o -lGmshParser -lGmshPlugin -lGmshGeo" + GMSH_LIBS="${GMSH_LIBS} -lGmshMesh -lGmshPost -lGmshCommon -lGmshNumeric" else - GMSH_DIRS="Common DataStr Geo Mesh Numeric Parser" - GMSH_LIBS="-Llib Common/Main.o -lGmshParser" - GMSH_LIBS="${GMSH_LIBS} -lGmshGeo -lGmshMesh -lGmshCommon" - GMSH_LIBS="${GMSH_LIBS} -lGmshDataStr -lGmshNumeric" + GMSH_DIRS="Common Geo Mesh Numeric Parser" + GMSH_LIBS="-Llib Common/Main.o -lGmshParser -lGmshGeo -lGmshMesh -lGmshCommon" + GMSH_LIBS="${GMSH_LIBS} -lGmshNumeric" FLAGS="-DHAVE_NO_POST ${FLAGS}" fi diff --git a/configure.in b/configure.in index 5fb5ae6b68129915a5abe541f23fa216dbd0fe2f..a5b5c8600410d6002aafdf06bab585c051742235 100644 --- a/configure.in +++ b/configure.in @@ -1,4 +1,4 @@ -dnl $Id: configure.in,v 1.156 2008-05-04 08:31:10 geuzaine Exp $ +dnl $Id: configure.in,v 1.157 2008-06-07 17:20:44 geuzaine Exp $ dnl dnl Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle dnl @@ -223,10 +223,9 @@ esac dnl Choose to build the GUI or the batch version if test "x$enable_gui" != "xno"; then - GMSH_DIRS="Common DataStr Geo Mesh Post Numeric Parser Plugin Graphics Fltk" - GMSH_LIBS="-Llib -lGmshFltk -lGmshParser -lGmshGraphics -lGmshPlugin" - GMSH_LIBS="${GMSH_LIBS} -lGmshMesh -lGmshGeo -lGmshPost -lGmshCommon" - GMSH_LIBS="${GMSH_LIBS} -lGmshDataStr -lGmshNumeric" + GMSH_DIRS="Common Geo Mesh Post Numeric Parser Plugin Graphics Fltk" + GMSH_LIBS="-Llib -lGmshFltk -lGmshParser -lGmshGraphics -lGmshPlugin -lGmshMesh" + GMSH_LIBS="${GMSH_LIBS} -lGmshGeo -lGmshPost -lGmshCommon -lGmshNumeric" FLAGS="-DHAVE_FLTK ${FLAGS}" if test "x${FLTK_PREFIX}" != "x" ; then @@ -353,15 +352,13 @@ if test "x$enable_gui" != "xno"; then else if test "x$enable_post" != "xno"; then - GMSH_DIRS="Common DataStr Geo Mesh Post Numeric Parser Plugin" - GMSH_LIBS="-Llib Common/Main.o -lGmshParser -lGmshPlugin" - GMSH_LIBS="${GMSH_LIBS} -lGmshGeo -lGmshMesh -lGmshPost -lGmshCommon" - GMSH_LIBS="${GMSH_LIBS} -lGmshDataStr -lGmshNumeric" + GMSH_DIRS="Common Geo Mesh Post Numeric Parser Plugin" + GMSH_LIBS="-Llib Common/Main.o -lGmshParser -lGmshPlugin -lGmshGeo" + GMSH_LIBS="${GMSH_LIBS} -lGmshMesh -lGmshPost -lGmshCommon -lGmshNumeric" else - GMSH_DIRS="Common DataStr Geo Mesh Numeric Parser" - GMSH_LIBS="-Llib Common/Main.o -lGmshParser" - GMSH_LIBS="${GMSH_LIBS} -lGmshGeo -lGmshMesh -lGmshCommon" - GMSH_LIBS="${GMSH_LIBS} -lGmshDataStr -lGmshNumeric" + GMSH_DIRS="Common Geo Mesh Numeric Parser" + GMSH_LIBS="-Llib Common/Main.o -lGmshParser -lGmshGeo -lGmshMesh -lGmshCommon" + GMSH_LIBS="${GMSH_LIBS} -lGmshNumeric" FLAGS="-DHAVE_NO_POST ${FLAGS}" fi diff --git a/contrib/MathEval/Makefile b/contrib/MathEval/Makefile index a1ada64661fd46f86c10deda558402de6b246977..c81450bef85a0173c42cdd78af0584cc17ee3d64 100644 --- a/contrib/MathEval/Makefile +++ b/contrib/MathEval/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.25 2008-06-05 16:52:16 geuzaine Exp $ +# $Id: Makefile,v 1.26 2008-06-07 17:20:57 geuzaine Exp $ # # Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle # @@ -23,7 +23,7 @@ include ../../variables LIB = ../../lib/libGmshMathEval${LIBEXT} -INC = ${DASH}I../../Common ${DASH}I../../DataStr +INC = ${DASH}I../../Common CFLAGS = ${OPTIM} ${FLAGS} ${INC} ${SYSINCLUDE} @@ -65,13 +65,14 @@ depend: rm -f Makefile.new # DO NOT DELETE THIS LINE -matheval.o: matheval.cpp common.h ../../DataStr/Malloc.h matheval.h \ +matheval.o: matheval.cpp common.h ../../Common/MallocUtils.h matheval.h \ node.h symbol_table.h -node.o: node.cpp common.h ../../DataStr/Malloc.h node.h symbol_table.h -scanner.yy.o: scanner.yy.cpp common.h ../../DataStr/Malloc.h node.h \ +node.o: node.cpp common.h ../../Common/MallocUtils.h node.h \ + symbol_table.h +scanner.yy.o: scanner.yy.cpp common.h ../../Common/MallocUtils.h node.h \ symbol_table.h parser.tab.hpp -parser.tab.o: parser.tab.cpp common.h ../../DataStr/Malloc.h node.h \ +parser.tab.o: parser.tab.cpp common.h ../../Common/MallocUtils.h node.h \ symbol_table.h -symbol_table.o: symbol_table.cpp common.h ../../DataStr/Malloc.h \ +symbol_table.o: symbol_table.cpp common.h ../../Common/MallocUtils.h \ symbol_table.h xmath.h xmath.o: xmath.cpp xmath.h diff --git a/contrib/MathEval/common.h b/contrib/MathEval/common.h index 781b6df4ad8e2287151a8cdcb7fb8556d4ef8b73..e7755a0db2aed4c44a888ba7993c8bec231dcd0c 100644 --- a/contrib/MathEval/common.h +++ b/contrib/MathEval/common.h @@ -26,7 +26,7 @@ #include <stdlib.h> #include <string.h> -#include "Malloc.h" +#include "MallocUtils.h" /* Macro definitions to simplify corresponding function calls. */ #define XMALLOC(type, num) ((type *) Malloc ((num) * sizeof(type))) diff --git a/contrib/NR/Makefile b/contrib/NR/Makefile index 0f095f809c5d133d4250955ab7bd6b832716e274..c8567e7e842e0a24c2b9f58544c8e0a2cfffd9d6 100644 --- a/contrib/NR/Makefile +++ b/contrib/NR/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.14 2008-06-05 14:26:09 samtech Exp $ +# $Id: Makefile,v 1.15 2008-06-07 17:20:57 geuzaine Exp $ # # Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle # @@ -23,7 +23,7 @@ include ../../variables LIB = ../../lib/libGmshNR${LIBEXT} -INC = ${DASH}I../NR ${DASH}I../../Common ${DASH}I../../DataStr ${DASH}I../../Numeric +INC = ${DASH}I../NR ${DASH}I../../Common ${DASH}I../../Numeric # don't optimize this library: there are some problems with gcc... CFLAGS = ${FLAGS} ${INC} ${SYSINCLUDE} diff --git a/doc/CREDITS b/doc/CREDITS index 31286365f9e545085608c59052e6a1d0dad8b425..bf28e198c3901dda41b295ab10721100aa01271e 100644 --- a/doc/CREDITS +++ b/doc/CREDITS @@ -1,4 +1,4 @@ -$Id: CREDITS,v 1.51 2008-03-21 09:39:43 geuzaine Exp $ +$Id: CREDITS,v 1.52 2008-06-07 17:20:57 geuzaine Exp $ Gmsh is copyright (C) 1997-2008 @@ -24,7 +24,7 @@ Gundry for the Plot3d mesh format; Jozef Vesely for help with the Tetgen integration; Koen Hillewaert for high order element mappings and other improvements. -The AVL tree code (DataStr/avl.*) and the YUV image code +The AVL tree code (Common/avl.*) and the YUV image code (Graphics/gl2yuv.*) are copyright (C) 1988-1993, 1995 The Regents of the University of California. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and diff --git a/utils/converters/autocad/Makefile b/utils/converters/autocad/Makefile index f93a85f120a8aa3a744c6a2a59596fa9227fb45f..0b1c061ee6eb2c3a69578b22fe28e0c1c0571594 100644 --- a/utils/converters/autocad/Makefile +++ b/utils/converters/autocad/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.3 2005-01-01 19:35:40 geuzaine Exp $ +# $Id: Makefile,v 1.4 2008-06-07 17:20:58 geuzaine Exp $ # # Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle # @@ -21,9 +21,8 @@ include ../../../variables -dxf2geo: dxf2geo.c message.c - ${CXX} ${OPTIM} -o ../../../bin/dxf2geo -I../../../DataStr\ - dxf2geo.c message.c ../../../lib/libGmshDataStr.a -lm +dxf2geo: dxf2geo.cpp + ${CXX} ${OPTIM} -o ../../../bin/dxf2geo dxf2geo.cpp -lm clean: rm -f *.o diff --git a/utils/converters/autocad/dxf2geo.c b/utils/converters/autocad/dxf2geo.cpp similarity index 80% rename from utils/converters/autocad/dxf2geo.c rename to utils/converters/autocad/dxf2geo.cpp index 03d77873be5d0f22f75caf71612b690b5511f391..c7a7ecb77f96b04bf28637f0e6e9cc9a9f5779a1 100644 --- a/utils/converters/autocad/dxf2geo.c +++ b/utils/converters/autocad/dxf2geo.cpp @@ -1,4 +1,4 @@ -// $Id: dxf2geo.c,v 1.3 2005-01-01 19:35:40 geuzaine Exp $ +// $Id: dxf2geo.cpp,v 1.1 2008-06-07 17:20:58 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // @@ -37,7 +37,7 @@ #include <stdlib.h> #include <string.h> #include <math.h> -#include "Tree.h" +#include <set> #define DEG2RAD 3.14159265359/180. #define BUFSIZE 2048 @@ -54,112 +54,82 @@ int cpt_vert_node = 1, num_vert_node[1024]; float curthick, xcoords[10], ycoords[10], zcoords[10], floats[10], angles[10]; float max_x, max_y, max_z, min_x, min_y, min_z; float THETOL, THEROT = 0., THETRANSX = 0., THETRANSY = 0.; -Tree_T *Point_T, *Curve_T; -struct Point +class Point { + public: int num; float x, y, z; + void write() const + { + float xx = x; + float yy = y; + xx = cos(-THEROT * DEG2RAD) * x + sin(-THEROT * DEG2RAD) * y; + yy = -sin(-THEROT * DEG2RAD) * x + cos(-THEROT * DEG2RAD) * y; + xx += THETRANSX; + yy += THETRANSY; + fprintf(outfile, "Point (%d) = {%g *u, %g *u, %g *u, lc} ;\n", + num, xx, yy, z); + } }; -int fcmpPoint(const void *a, const void *b) -{ - struct Point *q, *w; - - q = (struct Point *)a; - w = (struct Point *)b; - - if(fabs(q->x - w->x) < THETOL && - fabs(q->y - w->y) < THETOL && - fabs(q->z - w->z) < THETOL) - return 0; - - if(q->x > w->x) - return (1); - if(q->x < w->x) - return (-1); - if(q->y > w->y) - return (1); - if(q->y < w->y) - return (-1); - if(q->z > w->z) - return (1); - if(q->z < w->z) - return (-1); - - return 0; -} - -int addpoint(struct Point *p) -{ - struct Point *pp; - - if((pp = (struct Point *)Tree_PQuery(Point_T, p))) - return pp->num; - - p->num = nump++; - Tree_Add(Point_T, p); - return p->num; -} - -void writepoint(void *a, void *b) -{ - struct Point *p; - float x, y; - - p = (struct Point *)a; - - x = p->x; - y = p->y; - - p->x = cos(-THEROT * DEG2RAD) * x + sin(-THEROT * DEG2RAD) * y; - p->y = -sin(-THEROT * DEG2RAD) * x + cos(-THEROT * DEG2RAD) * y; - - p->x += THETRANSX; - p->y += THETRANSY; - - fprintf(outfile, "Point (%d) = {%g *u, %g *u, %g *u, lc} ;\n", - p->num, p->x, p->y, p->z); -} +class PointLessThanLexicographic{ + public: + bool operator()(const Point &v1, const Point &v2) const + { + if(v1.x - v2.x > THETOL) return true; + if(v1.x - v2.x < -THETOL) return false; + if(v1.y - v2.y > THETOL) return true; + if(v1.y - v2.y < -THETOL) return false; + if(v1.z - v2.z > THETOL) return true; + return false; + } +}; -struct Curve +class Curve { + public: int num, type, a, b, c; + void write() const + { + switch (type) { + case GEOLINE: + fprintf(outfile, "Line (%d) = {%d, %d} ;\n", num, a, b); + break; + case GEOCIRCLE: + fprintf(outfile, "Circle (%d) = {%d, %d, %d} ;\n", + num, a, b, c); + break; + } + } }; -int fcmpCurve(const void *a, const void *b) -{ - struct Curve *q, *w; - - q = (struct Curve *)a; - w = (struct Curve *)b; +class CurveLessThan{ + public: + bool operator()(const Curve &c1, const Curve &c2) const + { + if(c1.num < c2.num) return true; + return false; + } +}; - if(q->num < w->num) - return (-1); - return (1); -} +std::set<Point, PointLessThanLexicographic> Point_T; +std::set<Curve, CurveLessThan> Curve_T; -void addcurve(struct Curve *c) +int addpoint(Point &p) { - c->num = numc++; - Tree_Add(Curve_T, c); + std::set<Point>::iterator it = Point_T.find(p); + if(it != Point_T.end()) + return it->num; + p.num = nump++; + Point_T.insert(p); + return p.num; } -void writecurve(void *a, void *b) +void addcurve(Curve &c) { - struct Curve *c; - - c = (struct Curve *)a; - - switch (c->type) { - case GEOLINE: - fprintf(outfile, "Line (%d) = {%d, %d} ;\n", c->num, c->a, c->b); - break; - case GEOCIRCLE: - fprintf(outfile, "Circle (%d) = {%d, %d, %d} ;\n", - c->num, c->a, c->b, c->c); - break; - } + c.num = numc++; + Curve_T.insert(c); } int checkdegen(int a, int b, int c) @@ -171,22 +141,23 @@ int checkdegen(int a, int b, int c) ycoords[b] == ycoords[c] && zcoords[b] == zcoords[c]) || (xcoords[a] == xcoords[c] && - ycoords[a] == ycoords[c] && zcoords[a] == zcoords[c])) + ycoords[a] == ycoords[c] && + zcoords[a] == zcoords[c])) return (1); return (0); } void addobj(void) { /* dump out current object we should have all info on */ - struct Point p; - struct Curve c; + Point p; + Curve c; int num[10]; if(strstr(curobj, "POINT")) { p.x = xcoords[0]; p.y = ycoords[0]; p.z = zcoords[0]; - addpoint(&p); + addpoint(p); } else if(strstr(curobj, "LINE") || strstr(curobj, "3DLINE")) { if(xcoords[0] == xcoords[1] && ycoords[0] == ycoords[1] @@ -197,73 +168,73 @@ void addobj(void) p.x = xcoords[0]; p.y = ycoords[0]; p.z = zcoords[0]; - num[0] = addpoint(&p); + num[0] = addpoint(p); p.x = xcoords[1]; p.y = ycoords[1]; p.z = zcoords[1]; - num[1] = addpoint(&p); + num[1] = addpoint(p); c.type = GEOLINE; c.a = num[0]; c.b = num[1]; - addcurve(&c); + addcurve(c); } else if(strstr(curobj, "CIRCLE")) { p.x = xcoords[0]; p.y = ycoords[0]; p.z = zcoords[0]; - num[0] = addpoint(&p); + num[0] = addpoint(p); p.x = xcoords[0] - floats[0]; p.y = ycoords[0]; p.z = zcoords[0]; - num[1] = addpoint(&p); + num[1] = addpoint(p); p.x = xcoords[0] + floats[0]; p.y = ycoords[0]; p.z = zcoords[0]; - num[2] = addpoint(&p); + num[2] = addpoint(p); p.x = xcoords[0]; p.y = ycoords[0] - floats[0]; p.z = zcoords[0]; - num[3] = addpoint(&p); + num[3] = addpoint(p); p.x = xcoords[0]; p.y = ycoords[0] + floats[0]; p.z = zcoords[0]; - num[4] = addpoint(&p); + num[4] = addpoint(p); c.type = GEOCIRCLE; c.a = num[2]; c.b = num[0]; c.c = num[4]; - addcurve(&c); + addcurve(c); c.type = GEOCIRCLE; c.a = num[4]; c.b = num[0]; c.c = num[1]; - addcurve(&c); + addcurve(c); c.type = GEOCIRCLE; c.a = num[1]; c.b = num[0]; c.c = num[3]; - addcurve(&c); + addcurve(c); c.type = GEOCIRCLE; c.a = num[3]; c.b = num[0]; c.c = num[2]; - addcurve(&c); + addcurve(c); } else if(strstr(curobj, "ARC")) { p.x = xcoords[0]; p.y = ycoords[0]; p.z = zcoords[0]; - num[0] = addpoint(&p); + num[0] = addpoint(p); p.x = xcoords[0] + floats[0] * cos(angles[0] * DEG2RAD); p.y = ycoords[0] + floats[0] * sin(angles[0] * DEG2RAD); p.z = zcoords[0]; - num[1] = addpoint(&p); + num[1] = addpoint(p); p.x = xcoords[0] + floats[0] * cos(angles[1] * DEG2RAD); p.y = ycoords[0] + floats[0] * sin(angles[1] * DEG2RAD); p.z = zcoords[0]; - num[2] = addpoint(&p); + num[2] = addpoint(p); if((angles[1] - angles[0] > 0 && angles[1] - angles[0] < 180) || (angles[1] - angles[0] < 0 && angles[1] - angles[0] < -180)) { @@ -271,7 +242,7 @@ void addobj(void) c.a = num[1]; c.b = num[0]; c.c = num[2]; - addcurve(&c); + addcurve(c); } else { if(angles[1] - angles[0] > 0) { @@ -291,17 +262,17 @@ void addobj(void) floats[0] * sin((angles[0] - angles[1]) * 0.5 * DEG2RAD); } p.z = zcoords[0]; - num[3] = addpoint(&p); + num[3] = addpoint(p); c.type = GEOCIRCLE; c.a = num[1]; c.b = num[0]; c.c = num[3]; - addcurve(&c); + addcurve(c); c.type = GEOCIRCLE; c.a = num[3]; c.b = num[0]; c.c = num[2]; - addcurve(&c); + addcurve(c); } } else if(strstr(curobj, "TRACE")) { /* 2 back-to-back triangles */ @@ -355,34 +326,33 @@ void addobj(void) p.x = xcoords[0]; p.y = ycoords[0]; p.z = zcoords[0]; - num_vert_node[cpt_vert_node] = addpoint(&p); - // printf("cpt_vert-node = %d : new number = %d\n",cpt_vert_node,num_vert_node[cpt_vert_node]); + num_vert_node[cpt_vert_node] = addpoint(p); cpt_vert_node++; } else if(ints[0] == 128) { c.type = GEOLINE; c.a = num_vert_node[ints[1]]; c.b = num_vert_node[ints[2]]; - addcurve(&c); + addcurve(c); c.type = GEOLINE; c.a = num_vert_node[ints[2]]; c.b = num_vert_node[ints[3]]; - addcurve(&c); + addcurve(c); if(ints[4] == 0) { c.type = GEOLINE; c.a = num_vert_node[ints[3]]; c.b = num_vert_node[ints[1]]; - addcurve(&c); + addcurve(c); } else { c.type = GEOLINE; c.a = num_vert_node[ints[3]]; c.b = num_vert_node[ints[4]]; - addcurve(&c); + addcurve(c); c.type = GEOLINE; c.a = num_vert_node[ints[4]]; c.b = num_vert_node[ints[1]]; - addcurve(&c); + addcurve(c); } } ints[0] = ints[1] = ints[2] = ints[3] = ints[4] = ints[5] = 0; @@ -410,43 +380,44 @@ void addobj(void) p.x = xcoords[0]; p.y = ycoords[0]; p.z = zcoords[0]; - num[0] = addpoint(&p); + num[0] = addpoint(p); p.x = xcoords[1]; p.y = ycoords[1]; p.z = zcoords[1]; - num[1] = addpoint(&p); + num[1] = addpoint(p); p.x = xcoords[2]; p.y = ycoords[2]; p.z = zcoords[2]; - num[2] = addpoint(&p); + num[2] = addpoint(p); c.type = GEOLINE; c.a = num[0]; c.b = num[1]; - addcurve(&c); + addcurve(c); c.type = GEOLINE; c.a = num[1]; c.b = num[2]; - addcurve(&c); - if(xcoords[3] == xcoords[2] && ycoords[3] == ycoords[2] - && zcoords[3] == zcoords[2]) { + addcurve(c); + if(xcoords[3] == xcoords[2] && + ycoords[3] == ycoords[2] && + zcoords[3] == zcoords[2]) { c.type = GEOLINE; c.a = num[2]; c.b = num[0]; - addcurve(&c); + addcurve(c); } else { p.x = xcoords[3]; p.y = ycoords[3]; p.z = zcoords[3]; - num[3] = addpoint(&p); + num[3] = addpoint(p); c.type = GEOLINE; c.a = num[2]; c.b = num[3]; - addcurve(&c); + addcurve(c); c.type = GEOLINE; c.a = num[3]; c.b = num[0]; - addcurve(&c); + addcurve(c); } #endif } @@ -467,8 +438,6 @@ int getline(void) return (0); } - - int main(int argc, char *argv[]) { char *index; @@ -511,9 +480,6 @@ int main(int argc, char *argv[]) max_x = max_y = max_z = -10000000.0; /* init bounding limits */ min_x = min_y = min_z = 10000000.0; - Point_T = Tree_Create(sizeof(struct Point), fcmpPoint); - Curve_T = Tree_Create(sizeof(struct Curve), fcmpCurve); - find: while(!feof(infile)) { /* run file up to the "ENTITIES" section */ if(getline()) @@ -619,21 +585,22 @@ stopit: fclose(infile); fprintf(outfile, "/* Converted from AutoCad DXF file: %s */\n", inname); fprintf(outfile, "/* Tolerance %g: %d points / %d curves */\n\n", - THETOL, Tree_Nbr(Point_T), Tree_Nbr(Curve_T)); + THETOL, Point_T.size(), Curve_T.size()); fprintf(outfile, "u = 1; \nlc = 1 ;\n\n"); - Tree_Action(Point_T, writepoint); + + for(std::set<Point>::iterator it = Point_T.begin(); it != Point_T.end(); ++it) + it->write(); fprintf(outfile, "\n"); - Tree_Action(Curve_T, writecurve); + + for(std::set<Curve>::iterator it = Curve_T.begin(); it != Curve_T.end(); ++it) + it->write(); fprintf(outfile, "\n"); + fflush(outfile); fclose(outfile); printf("bounding box [%g,%g] [%g,%g] [%g,%g]\n", min_x, max_x, min_y, max_y, min_z, max_z); - printf - ("tolerance %g: %d points / %d curves / %ld degenerate entities removed\n", - THETOL, Tree_Nbr(Point_T), Tree_Nbr(Curve_T), degenerates); - Tree_Delete(Point_T); - Tree_Delete(Curve_T); + printf("tolerance %g: %d points / %d curves / %ld degenerate entities removed\n", + THETOL, Point_T.size(), Curve_T.size(), degenerates); exit(0); - } diff --git a/utils/converters/autocad/message.c b/utils/converters/autocad/message.c deleted file mode 100644 index 51273b80de6e00322ce6eaeed8db22adf519a63e..0000000000000000000000000000000000000000 --- a/utils/converters/autocad/message.c +++ /dev/null @@ -1,13 +0,0 @@ -#include <stdlib.h> -#include <stdio.h> -#include <signal.h> -#include <stdarg.h> - -void Msg(int level, const char *fmt, ...) -{ - va_list args; - va_start(args, fmt); - vfprintf(stderr, fmt, args); - fprintf(stderr, "\n"); - va_end(args); -} diff --git a/utils/misc/variables.msvc b/utils/misc/variables.msvc index fe4ec86d24d31a371d3442db6e31e153b74ac85c..12bddefdf84fe26deee34431f575f3e0fdace459 100644 --- a/utils/misc/variables.msvc +++ b/utils/misc/variables.msvc @@ -38,7 +38,7 @@ SYSINCLUDE=/I"${INCLUDE}" OPTIM=/O2 # Gmsh subdirectories -GMSH_DIRS=Common DataStr Geo Mesh Post Numeric Parser Plugin contrib/ANN contrib/MathEval contrib/NR contrib/Tetgen +GMSH_DIRS=Common Geo Mesh Post Numeric Parser Plugin contrib/ANN contrib/MathEval contrib/NR contrib/Tetgen # Gmsh libraries GMSH_LIBS=Common/Main.obj lib/*.lib