From e58363c4dc1f1cad0b41218fb29c07b4c80f041c Mon Sep 17 00:00:00 2001
From: Emilie Marchandise <emilie.marchandise@uclouvain.be>
Date: Tue, 8 Jun 2010 12:26:07 +0000
Subject: [PATCH] Added lua Binding for reinitialisation of options
 gmshOptions:initOptions()

---
 Common/Context.cpp     |  1 +
 Common/Context.h       |  3 +++
 Common/LuaBindings.cpp | 11 +++++++++++
 Geo/GFaceCompound.cpp  |  2 +-
 4 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/Common/Context.cpp b/Common/Context.cpp
index 32322fb745..e013fd487c 100644
--- a/Common/Context.cpp
+++ b/Common/Context.cpp
@@ -116,3 +116,4 @@ int CTX::unpackAlpha(unsigned int X)
   else
     return ( ( (X) >> 24 ) & 0xff );
 }
+
diff --git a/Common/Context.h b/Common/Context.h
index 694e850e02..3f5b62f6b1 100644
--- a/Common/Context.h
+++ b/Common/Context.h
@@ -11,6 +11,8 @@
 #include "CGNSOptions.h"
 #include "meshPartitionOptions.h"
 
+class binding;
+
 // The interface-independent context.
 
 struct contextMeshOptions {
@@ -242,6 +244,7 @@ class CTX {
   int unpackGreen(unsigned int X);
   int unpackBlue(unsigned int X);
   int unpackAlpha(unsigned int X);
+  
 };
 
 #endif
diff --git a/Common/LuaBindings.cpp b/Common/LuaBindings.cpp
index f2f6978b6c..354b91f776 100644
--- a/Common/LuaBindings.cpp
+++ b/Common/LuaBindings.cpp
@@ -29,6 +29,7 @@
 #include "Bindings.h"
 #include "GmshMessage.h"
 #include "linearSystem.h"
+#include "Options.h"
 
 #if defined(HAVE_OPENGL)
 #include "drawContext.h"
@@ -83,6 +84,11 @@ class gmshOptions {
   {
     GmshSetOption(category, name, value, index);
   }
+  void initOptions(){
+    ReInitOptions(0);
+    InitOptionsGUI(0);
+  }
+
   static void registerBindings(binding *b)
   {
     classBinding *cb = b->addClass<gmshOptions>("gmshOptions");
@@ -112,6 +118,11 @@ class gmshOptions {
     mb->setDescription("return the value of a string option. This is equivalent "
                        "to category[index].name");
     mb->setArgNames("category", "index", "name", NULL);
+
+    mb = cb->addMethod("initOptions", &gmshOptions::initOptions);
+    mb->setDescription("Re-initialize option file");
+    mb->setArgNames(NULL);
+
     mb = cb->setConstructor<gmshOptions>();
     mb->setDescription("an instance of gmshOptions is needed to access the database");
   }
diff --git a/Geo/GFaceCompound.cpp b/Geo/GFaceCompound.cpp
index 865f019b25..7f91547ba4 100644
--- a/Geo/GFaceCompound.cpp
+++ b/Geo/GFaceCompound.cpp
@@ -1461,7 +1461,7 @@ GPoint GFaceCompound::point(double par1, double par2) const
 
     //curved PN triangle
     //-------------------------
-
+    printf("normals size=%d vertex=%d \n", _normals.size(), lt->tri->getVertex(0)->getNum());
     const SVector3 n1 = _normals[lt->tri->getVertex(0)];
     const SVector3 n2 = _normals[lt->tri->getVertex(1)];
     const SVector3 n3 = _normals[lt->tri->getVertex(2)];
-- 
GitLab