diff --git a/Parser/OpenFile.cpp b/Parser/OpenFile.cpp index a8f4d2678919f907204f1d1500b522a46c9f1e66..8e96c784404eb49ea511149404f5775e2589ca1b 100644 --- a/Parser/OpenFile.cpp +++ b/Parser/OpenFile.cpp @@ -1,4 +1,4 @@ -// $Id: OpenFile.cpp,v 1.63 2004-10-17 01:53:49 geuzaine Exp $ +// $Id: OpenFile.cpp,v 1.64 2004-10-27 20:37:10 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -92,10 +92,20 @@ void SetBoundingBox(void) CalculateMinMax(THEM->Points, NULL); } else if(List_Nbr(CTX.post.list)) { - // else, if we have views, use the last one - CalculateMinMax(NULL, ((Post_View *) List_Pointer - (CTX.post.list, - List_Nbr(CTX.post.list) - 1))->BBox); + // else, if we have views, use the max bb of all the views + double bbox[6]; + Post_View *v = (Post_View *)List_Pointer(CTX.post.list, 0); + for(int i = 0; i < 6; i++) bbox[i] = v->BBox[i]; + for(int i = 1; i < List_Nbr(CTX.post.list); i++){ + v = (Post_View *)List_Pointer(CTX.post.list, i); + if(v->BBox[0] < bbox[0]) bbox[0] = v->BBox[0]; + if(v->BBox[1] > bbox[1]) bbox[1] = v->BBox[1]; + if(v->BBox[2] < bbox[2]) bbox[2] = v->BBox[2]; + if(v->BBox[3] > bbox[3]) bbox[3] = v->BBox[3]; + if(v->BBox[4] < bbox[4]) bbox[4] = v->BBox[4]; + if(v->BBox[5] > bbox[5]) bbox[5] = v->BBox[5]; + } + CalculateMinMax(NULL, bbox); } else { // else, use a default bbox diff --git a/doc/texinfo/gmsh.texi b/doc/texinfo/gmsh.texi index 9b822d30222e52f92af84afc61a8ac1a77d5b6da..117ad3c0f7593f8ec5a704bb158277af00a75f0a 100644 --- a/doc/texinfo/gmsh.texi +++ b/doc/texinfo/gmsh.texi @@ -1,5 +1,5 @@ \input texinfo.tex @c -*-texinfo-*- -@c $Id: gmsh.texi,v 1.144 2004-10-25 17:02:19 geuzaine Exp $ +@c $Id: gmsh.texi,v 1.145 2004-10-27 20:37:10 geuzaine Exp $ @c @c Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle @c @@ -1259,8 +1259,8 @@ point), the bounding box is taken as the box enclosing all the geometrical points; @item If there is no mesh and no geometry, but there are some post-processing -views, the bounding box is taken as the box enclosing all the primitives of -the last post-processing view. +views, the bounding box is taken as the box enclosing all the primitives in +the views. @end enumerate @item BoundingBox @{ @var{expression}, @var{expression}, @var{expression}, @var{expression}, @var{expression}, @var{expression} @};