From e7bb1173b3f21c45b6035769bc4ef24cc8692ec0 Mon Sep 17 00:00:00 2001
From: Jonathan Lambrechts <jonathan.lambrechts@uclouvain.be>
Date: Fri, 21 May 2010 09:43:24 +0000
Subject: [PATCH] complete model+mesh extrusion (for simple meshes) in lua

---
 Geo/GModel.cpp | 7 +++++++
 Geo/GModel.h   | 2 ++
 2 files changed, 9 insertions(+)

diff --git a/Geo/GModel.cpp b/Geo/GModel.cpp
index ecb4c7554e..86fa28bfc0 100644
--- a/Geo/GModel.cpp
+++ b/Geo/GModel.cpp
@@ -1925,6 +1925,10 @@ void GModel::glue(double eps)
     glueFacesInRegions(this, Unique2Duplicates, Duplicates2Unique);
   }    
 }
+void GModel::insertRegion(GRegion *r)
+{
+  regions.insert(r);
+}
 
 #include "Bindings.h"
 
@@ -1976,6 +1980,9 @@ void GModel::registerBindings(binding *b)
   cm->setDescription("access a geometrical region by tag");
   cm->setArgNames("tag", NULL);
 
+  cm = cb->addMethod("insertRegion", &GModel::insertRegion);
+  cm->setDescription("insert an existing region to the model list");
+  cm->setArgNames("region", NULL);
   cm = cb->addMethod("getRegions", &GModel::bindingsGetRegions);
   cm->setDescription("return a vector of the regions");
   cm = cb->addMethod("getFaces", &GModel::bindingsGetFaces);
diff --git a/Geo/GModel.h b/Geo/GModel.h
index 5327353a1e..6ed3ac83eb 100644
--- a/Geo/GModel.h
+++ b/Geo/GModel.h
@@ -118,6 +118,8 @@ class GModel
   std::set<GEdge*, GEntityLessThan> edges;
   std::set<GVertex*, GEntityLessThan> vertices;
 
+  void insertRegion (GRegion*);
+
   // map between the pair <dimension, elementary or physical number>
   // and an optional associated name
   std::map<std::pair<int, int>, std::string> physicalNames, elementaryNames;
-- 
GitLab