From d4fe13d3eedeaeefa6f004a4a095bff7dc196678 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Wed, 27 Aug 2003 01:45:09 +0000 Subject: [PATCH] Fix compareTwoCurves --- Geo/CAD.cpp | 33 ++++++++++++++++++++++++--------- Makefile | 4 ++-- doc/VERSIONS | 4 +++- 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/Geo/CAD.cpp b/Geo/CAD.cpp index 31c30ae227..c4f1a30328 100644 --- a/Geo/CAD.cpp +++ b/Geo/CAD.cpp @@ -1,4 +1,4 @@ -// $Id: CAD.cpp,v 1.63 2003-03-21 00:52:37 geuzaine Exp $ +// $Id: CAD.cpp,v 1.64 2003-08-27 01:45:09 geuzaine Exp $ // // Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle // @@ -1509,15 +1509,30 @@ int compareTwoCurves(const void *a, const void *b) if(c1->Typ != c2->Typ) return c1->Typ - c2->Typ; - comp = compareVertex(&c1->beg, &c2->beg); - if(comp) - return comp; - comp = compareVertex(&c1->end, &c2->end); - if(comp) - return comp; - // a finir pour des splines !! + + if(List_Nbr(c1->Control_Points) != List_Nbr(c2->Control_Points)) + return List_Nbr(c1->Control_Points) - List_Nbr(c2->Control_Points); + + if(!List_Nbr(c1->Control_Points)){ + comp = compareVertex(&c1->beg, &c2->beg); + if(comp) + return comp; + comp = compareVertex(&c1->end, &c2->end); + if(comp) + return comp; + } + else { + for(int i = 0; i < List_Nbr(c1->Control_Points); i++){ + Vertex *v1, *v2; + List_Read(c1->Control_Points, i, &v1); + List_Read(c2->Control_Points, i, &v2); + comp = compareVertex(&v1, &v2); + if(comp) + return comp; + } + } + return 0; - //return c1->Num - c2->Num; } int compareAbsCurve(const void *a, const void *b) diff --git a/Makefile b/Makefile index 65552d1cf4..ca409fc988 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.298 2003-08-24 23:21:23 geuzaine Exp $ +# $Id: Makefile,v 1.299 2003-08-27 01:45:09 geuzaine Exp $ # # Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle # @@ -23,7 +23,7 @@ include variables GMSH_MAJOR_VERSION = 1 GMSH_MINOR_VERSION = 46 -GMSH_PATCH_VERSION = 0 +GMSH_PATCH_VERSION = 1 GMSH_VERSION_FILE = Common/GmshVersion.h GMSH_RELEASE = ${GMSH_MAJOR_VERSION}.${GMSH_MINOR_VERSION}.${GMSH_PATCH_VERSION} diff --git a/doc/VERSIONS b/doc/VERSIONS index 6ba8f32e2b..9a60781e5a 100644 --- a/doc/VERSIONS +++ b/doc/VERSIONS @@ -1,4 +1,6 @@ -$Id: VERSIONS,v 1.154 2003-08-22 21:20:05 geuzaine Exp $ +$Id: VERSIONS,v 1.155 2003-08-27 01:45:09 geuzaine Exp $ + +New since 1.46: fix extrusion of surfaces defined by only two curves; New in 1.46: fix crash for very long command lines; new options for setting the displacement factor and Triangle's parameters + renamed a -- GitLab