From f90fb3fc84bc2ef1f00548f07e49fdbf5f255dce Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Sun, 6 Aug 2017 23:38:51 +0200 Subject: [PATCH] adapt to GMSH 3.0.4 and SALOME 8.3.0 --- CMakeLists.txt | 2 +- src/GMSHPlugin/GMSHPlugin_Mesher.cxx | 18 +++++++++--------- src/GMSHPlugin/GMSHPlugin_Mesher.hxx | 12 +++++++----- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b10f1b..c0ce213 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,7 +32,7 @@ ENDIF(WIN32) STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC) SET(${PROJECT_NAME_UC}_MAJOR_VERSION 8) -SET(${PROJECT_NAME_UC}_MINOR_VERSION 1) +SET(${PROJECT_NAME_UC}_MINOR_VERSION 3) SET(${PROJECT_NAME_UC}_PATCH_VERSION 0) SET(${PROJECT_NAME_UC}_VERSION ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION}) diff --git a/src/GMSHPlugin/GMSHPlugin_Mesher.cxx b/src/GMSHPlugin/GMSHPlugin_Mesher.cxx index 9ec0011..6e2ccf1 100644 --- a/src/GMSHPlugin/GMSHPlugin_Mesher.cxx +++ b/src/GMSHPlugin/GMSHPlugin_Mesher.cxx @@ -218,38 +218,38 @@ void GMSHPlugin_Mesher::CreateGmshCompounds() TopAbs_ShapeEnum geomType = geomShape.ShapeType(); if (geomShape.ShapeType() == TopAbs_COMPOUND)// voir s'il ne faut pas mettre une erreur dans le cas contraire { - //printf("shapeType == TopAbs_COMPOUND\n"); + MESSAGE("shapeType == TopAbs_COMPOUND"); TopoDS_Iterator it(geomShape); TopAbs_ShapeEnum shapeType = it.Value().ShapeType(); // compound of edges if (shapeType == TopAbs_EDGE) { - //printf(" shapeType == TopAbs_EDGE :"); + MESSAGE(" shapeType == TopAbs_EDGE :"); int num = _gModel->getNumEdges()+1; - Curve *curve = Create_Curve(num, MSH_SEGM_COMPOUND, 1, NULL, NULL, -1, -1, 0., 1.); + Curve *curve = CreateCurve(num, MSH_SEGM_COMPOUND, 1, NULL, NULL, -1, -1, 0., 1.); for (it; it.More(); it.Next()) { TopoDS_Shape topoShape = it.Value(); ASSERT(topoShape.ShapeType() == shapeType); - curve->compound.push_back(occgeo->getOCCEdgeByNativePtr(_gModel, (TopoDS_Edge&)topoShape)->tag()); + curve->compound.push_back(occgeo->addEdgeToModel(_gModel, (TopoDS_Edge&)topoShape)->tag()); } Tree_Add(_gModel->getGEOInternals()->Curves, &curve); - _gModel->importGEOInternals(); + //_gModel->importGEOInternals(); } // compound of faces else if (shapeType == TopAbs_FACE) { - //printf(" shapeType == TopAbs_FACE :"); + MESSAGE(" shapeType == TopAbs_FACE :"); int num = _gModel->getNumFaces()+1; - Surface *surface = Create_Surface(num, MSH_SURF_COMPOUND); + Surface *surface = CreateSurface(num, MSH_SURF_COMPOUND); for (it; it.More(); it.Next()) { TopoDS_Shape topoShape = it.Value(); ASSERT(topoShape.ShapeType() == shapeType); - surface->compound.push_back(occgeo->getOCCFaceByNativePtr(_gModel, (TopoDS_Face&)topoShape)->tag()); + surface->compound.push_back(occgeo->addFaceToModel(_gModel, (TopoDS_Face&)topoShape)->tag()); } Tree_Add(_gModel->getGEOInternals()->Surfaces, &surface); - _gModel->importGEOInternals(); + _gModel->getGEOInternals()->synchronize(_gModel); } } } diff --git a/src/GMSHPlugin/GMSHPlugin_Mesher.hxx b/src/GMSHPlugin/GMSHPlugin_Mesher.hxx index 2f2a4c3..6da9164 100644 --- a/src/GMSHPlugin/GMSHPlugin_Mesher.hxx +++ b/src/GMSHPlugin/GMSHPlugin_Mesher.hxx @@ -17,18 +17,20 @@ // // See http://www.alneos.com/ or email : contact@alneos.fr // + +#ifndef _GMSHPlugin_Mesher_HXX_ +#define _GMSHPlugin_Mesher_HXX_ + #include #include "Gmsh.h" #include "GmshConfig.h" #include "GModelIO_OCC.h" +#include "GModelIO_GEO.h" #include "Geo.h" #include "GEdgeCompound.h" #include "GFaceCompound.h" #include "MElement.h" -#ifndef _GMSHPlugin_Mesher_HXX_ -#define _GMSHPlugin_Mesher_HXX_ - #include "GMSHPlugin_Defs.hxx" #include "StdMeshers_FaceSide.hxx" #include "SMDS_MeshElement.hxx" @@ -42,8 +44,8 @@ class SMESH_Mesh; class SMESH_Comment; class SMESHDS_Mesh; class TopoDS_Shape; -class TopTools_DataMapOfShapeShape; -class TopTools_IndexedMapOfShape; +//class TopTools_DataMapOfShapeShape; +//class TopTools_IndexedMapOfShape; class GMSHPlugin_Hypothesis; -- 2.39.2