From b58f405419f8b4fa15db3c2020f1eb1d2aa3da86 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Sun, 17 Dec 2006 22:23:17 +0000
Subject: [PATCH] better mousewheel interaction

---
 Fltk/Opengl_Window.cpp |  3 ++-
 Geo/GModel.cpp         | 14 +++++++-------
 Geo/GModel.h           |  6 +++++-
 3 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/Fltk/Opengl_Window.cpp b/Fltk/Opengl_Window.cpp
index f46af1fd3a..4bcd1a027f 100644
--- a/Fltk/Opengl_Window.cpp
+++ b/Fltk/Opengl_Window.cpp
@@ -1,4 +1,4 @@
-// $Id: Opengl_Window.cpp,v 1.77 2006-11-27 22:22:10 geuzaine Exp $
+// $Id: Opengl_Window.cpp,v 1.78 2006-12-17 22:23:16 geuzaine Exp $
 //
 // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 //
@@ -287,6 +287,7 @@ int Opengl_Window::handle(int event)
       CTX.s[0] *= ((dy > 0) ? fact : 1./fact);
       CTX.s[1] = CTX.s[0];
       CTX.s[2] = CTX.s[0];
+      prev.recenter();
       redraw();
     }
     WID->update_manip_window();
diff --git a/Geo/GModel.cpp b/Geo/GModel.cpp
index f465a6164e..9ea6da8547 100644
--- a/Geo/GModel.cpp
+++ b/Geo/GModel.cpp
@@ -1,4 +1,4 @@
-// $Id: GModel.cpp,v 1.25 2006-12-12 18:16:41 geuzaine Exp $
+// $Id: GModel.cpp,v 1.26 2006-12-17 22:23:17 geuzaine Exp $
 //
 // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 //
@@ -298,10 +298,10 @@ void GModel::deleteMeshPartitions()
 
 double GModel::getMeshSize () 
 {
-  if (meshSize < 0)
-    {
-      SBoundingBox3d b = bounds();
-      return 0.1 * norm( SVector3 ( b.max() , b.min() ) );
-    }
-  else return meshSize;
+  if(meshSize < 0){
+    SBoundingBox3d b = bounds();
+    return 0.1 * norm(SVector3(b.max(), b.min()));
+  }
+  else
+    return meshSize;
 }
diff --git a/Geo/GModel.h b/Geo/GModel.h
index 11fb1b3e0c..3a9faa67e0 100644
--- a/Geo/GModel.h
+++ b/Geo/GModel.h
@@ -32,12 +32,15 @@
 
 // OCC Internals have to be stored in the model
 class OCC_Internals;
+
 // A geometric model. The model is a "not yet" non-manifold B-Rep.
 class GModel  
 {
+ private:
   void deleteOCCInternals();
   OCC_Internals *occ_internals;
   double meshSize;
+
  protected:
   std::string modelName;
   std::set<GRegion*, GEntityLessThan> regions;
@@ -46,10 +49,11 @@ class GModel
   std::set<GVertex*, GEntityLessThan> vertices;
   std::set<int> meshPartitions;
   std::map<int, std::string> physicalNames;
+
  public:
   GModel() : modelName("Untitled"), normals(0), meshSize(-1.) {}
   GModel(const std::string &name) : modelName(name), normals(0), meshSize(-1.) {}
-  virtual ~GModel(){ deleteOCCInternals();destroy(); }
+  virtual ~GModel(){ deleteOCCInternals(); destroy(); }
   
   typedef std::set<GRegion*, GEntityLessThan>::iterator riter;
   typedef std::set<GFace*, GEntityLessThan>::iterator fiter;
-- 
GitLab