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

Slightly change the way we compute the bounding box during OpenFile
(not MergeFile), so that opening a file containing both a
geometry/mesh and a view works as expected.
parent 4dc9f44c
No related branches found
No related tags found
No related merge requests found
// $Id: OpenFile.cpp,v 1.39 2003-02-12 20:27:14 geuzaine Exp $ // $Id: OpenFile.cpp,v 1.40 2003-02-27 00:21:22 geuzaine Exp $
// //
// Copyright (C) 1997 - 2003 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997 - 2003 C. Geuzaine, J.-F. Remacle
// //
...@@ -130,14 +130,20 @@ int MergeProblem(char *name){ ...@@ -130,14 +130,20 @@ int MergeProblem(char *name){
void MergeProblemWithBoundingBox(char *name){ void MergeProblemWithBoundingBox(char *name){
int nb = List_Nbr(CTX.post.list); int nb = List_Nbr(CTX.post.list);
int status = ParseFile(name,0); int status = ParseFile(name,0);
if(List_Nbr(CTX.post.list) > nb) if(List_Nbr(CTX.post.list) > nb){
// if we merged a view, use it
CalculateMinMax(NULL, ((Post_View*)List_Pointer CalculateMinMax(NULL, ((Post_View*)List_Pointer
(CTX.post.list,List_Nbr(CTX.post.list)-1))->BBox); (CTX.post.list,List_Nbr(CTX.post.list)-1))->BBox);
else if(!status) }
else if(!status) {
// else, if we did not read a mesh, use the geomnetry
CalculateMinMax(THEM->Points,NULL); CalculateMinMax(THEM->Points,NULL);
else }
else{
// else, use the mesh
CalculateMinMax(THEM->Vertices,NULL); CalculateMinMax(THEM->Vertices,NULL);
} }
}
void OpenProblem(char *name){ void OpenProblem(char *name){
char ext[6]; char ext[6];
...@@ -183,7 +189,6 @@ void OpenProblem(char *name){ ...@@ -183,7 +189,6 @@ void OpenProblem(char *name){
if(!CTX.batch) WID->set_title(CTX.filename); if(!CTX.batch) WID->set_title(CTX.filename);
#endif #endif
int nb = List_Nbr(CTX.post.list);
int status = MergeProblem(CTX.filename); int status = MergeProblem(CTX.filename);
ApplyLcFactor(THEM); ApplyLcFactor(THEM);
...@@ -200,13 +205,19 @@ void OpenProblem(char *name){ ...@@ -200,13 +205,19 @@ void OpenProblem(char *name){
ZeroHighlight(&M); ZeroHighlight(&M);
#endif #endif
if(List_Nbr(CTX.post.list) > nb) if(!Tree_Nbr(THEM->Points) && !Tree_Nbr(THEM->Points) && List_Nbr(CTX.post.list)){
// if there are no points or vertices and there is a view, use it
CalculateMinMax(NULL, ((Post_View*)List_Pointer CalculateMinMax(NULL, ((Post_View*)List_Pointer
(CTX.post.list,List_Nbr(CTX.post.list)-1))->BBox); (CTX.post.list,List_Nbr(CTX.post.list)-1))->BBox);
else if(!status) }
else if(!status){
// else, if we don't have a mesh, use the geometry
CalculateMinMax(THEM->Points,NULL); CalculateMinMax(THEM->Points,NULL);
else }
else{
// else, suppose we have a mesh (or use a default bbox if empty)
CalculateMinMax(THEM->Vertices,NULL); CalculateMinMax(THEM->Vertices,NULL);
}
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment