From 48554b32deeab8b20ce1867b439b4a74731d6fda Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Sat, 10 Jan 2009 12:08:02 +0000 Subject: [PATCH] fix minimize --- Common/OctreeInternals.cpp | 24 ++++++++---------------- Common/OctreeInternals.h | 14 +++++++------- Fltk/GUI.cpp | 30 ++++++++++++++++++++---------- Fltk/Makefile | 18 +++++++++--------- Makefile | 3 +-- 5 files changed, 45 insertions(+), 44 deletions(-) diff --git a/Common/OctreeInternals.cpp b/Common/OctreeInternals.cpp index a984a0ec20..f5ea8f5b83 100644 --- a/Common/OctreeInternals.cpp +++ b/Common/OctreeInternals.cpp @@ -2,22 +2,14 @@ // // See the LICENSE.txt file for license information. Please report all // bugs and problems to <gmsh@geuz.org>. -// -// Contributor(s): -// We lost track of the origin of this octree code. If you happen to -// know the author of the original routines, please send us an email. -#include <iostream> +#include <list> #include <stdio.h> #include <stdlib.h> #include <math.h> -#include <list> - #include "GmshMessage.h" #include "OctreeInternals.h" -using std::list; - int initializeOctantBuckets(double *_orig, double *_size, int _maxElem, octantBucket **buckets_head, globalInfo **globalPara) // Initialize the buckets @@ -285,13 +277,13 @@ int subdivideOctantBucket(octantBucket *_bucket, globalInfo *_globalPara) return 1; } -void * searchElement(octantBucket *_buckets_head, double *_pt, globalInfo *_globalPara, - BBFunction BBElement, InEleFunction xyzInElement) +void *searchElement(octantBucket *_buckets_head, double *_pt, globalInfo *_globalPara, + BBFunction BBElement, InEleFunction xyzInElement) { int flag; octantBucket *ptrBucket; ELink ptr1; - list<void *>::iterator iter; + std::list<void*>::iterator iter; void * ptrToEle = _globalPara->ptrToPrevElement; if (ptrToEle) { @@ -385,12 +377,13 @@ void insertOneBB(void* _region, double *_minPt, double *_maxPt, octantBucket *_b return; } -void * searchAllElements(octantBucket *_buckets_head, double *_pt, globalInfo *_globalPara, - BBFunction BBElement, InEleFunction xyzInElement, list<void *> *_elements) +void *searchAllElements(octantBucket *_buckets_head, double *_pt, globalInfo *_globalPara, + BBFunction BBElement, InEleFunction xyzInElement, + std::list<void*> *_elements) { int flag, flag1; octantBucket *ptrBucket; - list<void *>::iterator iter; + std::list<void*>::iterator iter; ptrBucket = findElementBucket(_buckets_head, _pt); if (ptrBucket == NULL) { @@ -411,7 +404,6 @@ void * searchAllElements(octantBucket *_buckets_head, double *_pt, globalInfo *_ flag1 = 0; for (iter = (ptrBucket->listBB).begin(); iter != (ptrBucket->listBB).end(); iter++){ - // printf("Enter 1 \n"); flag = xyzInElementBB(_pt, *iter, BBElement); if (flag == 1) flag = xyzInElement(*iter, _pt); diff --git a/Common/OctreeInternals.h b/Common/OctreeInternals.h index 0a373c7c2b..1c95dbf000 100644 --- a/Common/OctreeInternals.h +++ b/Common/OctreeInternals.h @@ -68,14 +68,14 @@ int subdivideOctantBucket(octantBucket *bucket, globalInfo *globalPara); int initializeOctantBuckets(double *orig, double *size, int maxElem, octantBucket **buckets, globalInfo **globalPara); int checkElementInBucket(octantBucket *bucket, void * element); -octantBucket* findElementBucket(octantBucket *buckets, double *pt); -void * searchElement(octantBucket *buckets, double *pt, - globalInfo *globalPara, BBFunction BBElement, - InEleFunction xyzInElement); +octantBucket *findElementBucket(octantBucket *buckets, double *pt); +void *searchElement(octantBucket *buckets, double *pt, + globalInfo *globalPara, BBFunction BBElement, + InEleFunction xyzInElement); int xyzInElementBB(double *xyz, void *region, BBFunction BBElement); void insertOneBB(void *, double *, double *, octantBucket *); -void * searchAllElements(octantBucket *_buckets_head, double *_pt, globalInfo *_globalPara, - BBFunction BBElement, InEleFunction xyzInElement, - std::list<void *> *_elements); +void *searchAllElements(octantBucket *_buckets_head, double *_pt, globalInfo *_globalPara, + BBFunction BBElement, InEleFunction xyzInElement, + std::list<void *> *_elements); #endif diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp index f17612ce74..cecd91af21 100644 --- a/Fltk/GUI.cpp +++ b/Fltk/GUI.cpp @@ -668,16 +668,26 @@ void window_cb(Fl_Widget *w, void *data) if(!strcmp(str, "minimize")){ for(unsigned int i = 0; i < GUI::instance()->graph.size(); i++) - GUI::instance()->graph[i]->win->iconize(); - GUI::instance()->options->win->iconize(); - GUI::instance()->plugins->win->iconize(); - GUI::instance()->fields->win->iconize(); - GUI::instance()->visibility->win->iconize(); - GUI::instance()->clipping->win->iconize(); - GUI::instance()->manip->win->iconize(); - GUI::instance()->stats->win->iconize(); - GUI::instance()->messages->win->iconize(); - GUI::instance()->menu->win->iconize(); + if(GUI::instance()->graph[i]->win->shown()) + GUI::instance()->graph[i]->win->iconize(); + if(GUI::instance()->options->win->shown()) + GUI::instance()->options->win->iconize(); + if(GUI::instance()->plugins->win->shown()) + GUI::instance()->plugins->win->iconize(); + if(GUI::instance()->fields->win->shown()) + GUI::instance()->fields->win->iconize(); + if(GUI::instance()->visibility->win->shown()) + GUI::instance()->visibility->win->iconize(); + if(GUI::instance()->clipping->win->shown()) + GUI::instance()->clipping->win->iconize(); + if(GUI::instance()->manip->win->shown()) + GUI::instance()->manip->win->iconize(); + if(GUI::instance()->stats->win->shown()) + GUI::instance()->stats->win->iconize(); + if(GUI::instance()->messages->win->shown()) + GUI::instance()->messages->win->iconize(); + if(GUI::instance()->menu->win->shown()) + GUI::instance()->menu->win->iconize(); } else if(!strcmp(str, "zoom")){ if(zoom){ diff --git a/Fltk/Makefile b/Fltk/Makefile index dd6a9f914b..f94287216c 100644 --- a/Fltk/Makefile +++ b/Fltk/Makefile @@ -281,15 +281,15 @@ aboutWindow${OBJEXT}: aboutWindow.cpp GUI.h aboutWindow.h paletteWindow.h \ ../Common/Context.h ../Geo/CGNSOptions.h ../Mesh/meshPartitionOptions.h \ ../Common/GmshConfig.h fileDialogs${OBJEXT}: fileDialogs.cpp ../Common/GmshConfig.h \ - ../Common/GmshDefines.h GUI.h ../Common/CreateFile.h \ - ../Common/Options.h ../Post/ColorTable.h Draw.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 \ - ../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/SPoint3.h \ + ../Common/GmshMessage.h ../Common/GmshDefines.h GUI.h \ + ../Common/CreateFile.h ../Common/Options.h ../Post/ColorTable.h Draw.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 ../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/SPoint3.h \ ../Geo/SBoundingBox3d.h ../Common/Context.h ../Geo/CGNSOptions.h \ ../Mesh/meshPartitionOptions.h fileChooser.h extraDialogs${OBJEXT}: extraDialogs.cpp GUI.h paletteWindow.h \ diff --git a/Makefile b/Makefile index 913b244ca4..bbcb2f4cbe 100644 --- a/Makefile +++ b/Makefile @@ -212,8 +212,7 @@ clean-fm: depend: initialtag mv -f Common/GmshConfig.h . cp -f utils/misc/GmshConfig.depend Common/GmshConfig.h - for i in ${GMSH_DIRS};\ - do (cd $$i && ${MAKE} depend); done + for i in ${GMSH_DIRS}; do (cd $$i && ${MAKE} depend); done mv -f GmshConfig.h Common/ nodepend: -- GitLab