Skip to content
Snippets Groups Projects
Commit bc987486 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

if we have no geometry and no mesh, use the max of all view bounding boxes
(instead of the bounding box of the last view only)
parent 29021c58
No related branches found
No related tags found
No related merge requests found
// $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 // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
// //
...@@ -92,10 +92,20 @@ void SetBoundingBox(void) ...@@ -92,10 +92,20 @@ void SetBoundingBox(void)
CalculateMinMax(THEM->Points, NULL); CalculateMinMax(THEM->Points, NULL);
} }
else if(List_Nbr(CTX.post.list)) { else if(List_Nbr(CTX.post.list)) {
// else, if we have views, use the last one // else, if we have views, use the max bb of all the views
CalculateMinMax(NULL, ((Post_View *) List_Pointer double bbox[6];
(CTX.post.list, Post_View *v = (Post_View *)List_Pointer(CTX.post.list, 0);
List_Nbr(CTX.post.list) - 1))->BBox); 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 {
// else, use a default bbox // else, use a default bbox
......
\input texinfo.tex @c -*-texinfo-*- \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
@c Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle @c Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
@c @c
...@@ -1259,8 +1259,8 @@ point), the bounding box is taken as the box enclosing all the geometrical ...@@ -1259,8 +1259,8 @@ point), the bounding box is taken as the box enclosing all the geometrical
points; points;
@item @item
If there is no mesh and no geometry, but there are some post-processing 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 views, the bounding box is taken as the box enclosing all the primitives in
the last post-processing view. the views.
@end enumerate @end enumerate
@item BoundingBox @{ @var{expression}, @var{expression}, @var{expression}, @var{expression}, @var{expression}, @var{expression} @}; @item BoundingBox @{ @var{expression}, @var{expression}, @var{expression}, @var{expression}, @var{expression}, @var{expression} @};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment