Commit 094a18df by Christophe Geuzaine

make sure to build the old bindings for now

parent af0a15b6
Pipeline #742 failed with stage
in 27 minutes 31 seconds
......@@ -1252,7 +1252,7 @@ if(ENABLE_WRAP_PYTHON)
find_package(PythonLibs)
if(SWIG_FOUND AND PYTHONLIBS_FOUND)
message(STATUS "Found SWIG version " ${SWIG_VERSION})
if(NOT DEPRECATED_API) # new bindings
if(NOT ENABLE_DEPRECATED_API) # new bindings
include_directories(${PYTHON_INCLUDE_PATH})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_SWIG_FLAGS "")
......@@ -1263,7 +1263,7 @@ if(ENABLE_WRAP_PYTHON)
set_target_properties("_gmsh" PROPERTIES LINK_FLAGS
"-undefined suppress -flat_namespace")
endif(APPLE)
else(NOT DEPRECATED_API) # old, deprecated internal developer bindings
else(NOT ENABLE_DEPRECATED_API) # old, deprecated internal developer bindings
find_package(PythonInterp)
string(SUBSTRING ${SWIG_VERSION} 0 1 SWIG_MAJOR_VERSION)
if(SWIG_MAJOR_VERSION EQUAL 1)
......@@ -1299,16 +1299,16 @@ if(ENABLE_WRAP_PYTHON)
endif(ENABLE_PETSC4PY)
endif(HAVE_PETSC)
endif(SWIG_MAJOR_VERSION EQUAL 1)
endif(NOT DEPRECATED_API)
endif(NOT ENABLE_DEPRECATED_API)
endif(SWIG_FOUND AND PYTHONLIBS_FOUND)
endif(ENABLE_WRAP_PYTHON)
if(ENABLE_WRAP_JAVA AND DEPRECATED_API)
if(ENABLE_WRAP_JAVA AND ENABLE_DEPRECATED_API)
if(NOT HAVE_BLAS OR NOT HAVE_LAPACK)
message(WARNING "Java wrapping samples will not work without BLAS and LAPACK")
endif(NOT HAVE_BLAS OR NOT HAVE_LAPACK)
add_subdirectory(wrappers/java)
endif(ENABLE_WRAP_JAVA AND DEPRECATED_API)
endif(ENABLE_WRAP_JAVA AND ENABLE_DEPRECATED_API)
check_function_exists(vsnprintf HAVE_VSNPRINTF)
if(NOT HAVE_VSNPRINTF AND NOT ENABLE_BUILD_IOS AND NOT ENABLE_BUILD_ANDROID)
......
......@@ -423,10 +423,10 @@ int gmshModelSetReverseMesh(int dim, int tag)
return 0;
}
int gmshModelAddEmbedded(int dim, const std::vector<int> &tags, int toDim, int toTag)
int gmshModelEmbed(int dim, const std::vector<int> &tags, int inDim, int inTag)
{
if(toDim == 2){
GFace *gf = GModel::current()->getFaceByTag(toTag);
if(inDim == 2){
GFace *gf = GModel::current()->getFaceByTag(inTag);
if(gf){
for(unsigned int i = 0; i < tags.size(); i++){
if(dim == 0){
......@@ -442,8 +442,8 @@ int gmshModelAddEmbedded(int dim, const std::vector<int> &tags, int toDim, int t
}
}
}
else if(toDim == 3){
GRegion *gr = GModel::current()->getRegionByTag(toTag);
else if(inDim == 3){
GRegion *gr = GModel::current()->getRegionByTag(inTag);
if(gr){
for(unsigned int i = 0; i < tags.size(); i++){
if(dim == 0){
......@@ -640,7 +640,7 @@ int gmshModelGeoSynchronize()
return 0;
}
// gmshModelOCC
// gmshModelOcc
static void createOcc()
{
......@@ -652,3 +652,10 @@ int gmshModelOccAddVertex(int &tag, double x, double y, double z, double meshSiz
createOcc();
return !GModel::current()->getOCCInternals()->addVertex(tag, x, y, z, meshSize);
}
int gmshModelGeoSynchronize()
{
createOcc();
GModel::current()->getOccInternals()->synchronize(GModel::current());
return 0;
}
......@@ -29,7 +29,7 @@
#endif
// gmsh
GMSH_API gmshInitialize(int argc=0, char **argv=0);
GMSH_API gmshInitialize(int argc = 0, char **argv = 0);
GMSH_API gmshFinalize();
GMSH_API gmshOpen(const std::string &fileName);
GMSH_API gmshMerge(const std::string &fileName);
......@@ -49,21 +49,22 @@ GMSH_API gmshModelDestroy();
GMSH_API gmshModelGetEntities(std::vector<std::pair<int, int> > &dimTags);
GMSH_API gmshModelGetPhysicalGroups(std::vector<std::pair<int, int> > &dimTags);
GMSH_API gmshModelAddPhysicalGroup(int dim, int tag, const std::vector<int> &tags);
GMSH_API gmshModelGetEntitiesForPhysicalGroup(int dim, int tag, std::vector<int> &tags);
GMSH_API gmshModelGetEntitiesForPhysicalGroup(int dim, int tag,
std::vector<int> &tags);
GMSH_API gmshModelSetPhysicalName(int dim, int tag, const std::string &name);
GMSH_API gmshModelGetPhysicalName(int dim, int tag, std::string &name);
GMSH_API gmshModelGetVertexCoordinates(int tag, std::vector<double> &coord);
GMSH_API gmshModelGetVertexCoordinates(int tag, double &x, double &y, double &z);
GMSH_API gmshModelGetBoundary(const std::vector<std::pair<int, int> > &inDimTags,
std::vector<std::pair<int, int> > &outDimTags,
bool combined=true, bool oriented=true,
bool recursive=false);
bool combined = true, bool oriented = true,
bool recursive = false);
GMSH_API gmshModelGetEntitiesInBoundingBox(int dim, double x1, double y1, double z1,
double x2, double y2, double z2,
std::vector<int> &tags);
GMSH_API gmshModelGetBoundingBox(int dim, int tag, double &x1, double &y1,
double &z1, double &x2, double &y2, double &z2);
GMSH_API gmshModelRemove(const std::vector<std::pair<int, int> > &dimTags,
bool recursive=false);
bool recursive = false);
GMSH_API gmshModelMesh(int dim);
GMSH_API gmshModelGetMeshVertices(int dim, int tag, std::vector<int> &vertexTags,
std::vector<double> &coords);
......@@ -78,51 +79,52 @@ GMSH_API gmshModelSetTransfiniteVolume(int tag, const std::vector<int> &cornerTa
GMSH_API gmshModelSetRecombine(int dim, int tag, double angle);
GMSH_API gmshModelSetSmoothing(int tag, int val);
GMSH_API gmshModelSetReverseMesh(int dim, int tag);
GMSH_API gmshModelAddEmbedded(int dim, const std::vector<int> &tags,
int toDim, int toTag);
GMSH_API gmshModelEmbed(int dim, const std::vector<int> &tags, int inDim, int inTag);
// gmshModelGeo
GMSH_API gmshModelGeoAddVertex(int &tag, double x, double y, double z, double meshSize);
GMSH_API gmshModelGeoAddVertex(int &tag, double x, double y, double z,
double meshSize);
GMSH_API gmshModelGeoAddLine(int &tag, int startTag, int endTag);
GMSH_API gmshModelGeoAddCircleArc(int &tag, int startTag, int centerTag, int endTag,
double nx=0., double ny=0., double nz=0.);
GMSH_API gmshModelGeoAddEllipseArc(int &tag, int startTag, int centerTag, int majorTag,
int endTag, double nx=0., double ny=0., double nz=0.);
double nx = 0., double ny = 0., double nz = 0.);
GMSH_API gmshModelGeoAddEllipseArc(int &tag, int startTag, int centerTag,
int majorTag, int endTag, double nx = 0.,
double ny = 0., double nz = 0.);
GMSH_API gmshModelGeoAddSpline(int &tag, const std::vector<int> &vertexTags);
GMSH_API gmshModelGeoAddBSpline(int &tag, const std::vector<int> &vertexTags);
GMSH_API gmshModelGeoAddBezier(int &tag, const std::vector<int> &vertexTags);
GMSH_API gmshModelGeoAddLineLoop(int &tag, const std::vector<int> &edgeTags);
GMSH_API gmshModelGeoAddPlaneSurface(int &tag, const std::vector<int> &wireTags);
GMSH_API gmshModelGeoAddSurfaceFilling(int &tag, const std::vector<int> &wireTags,
int sphereCenterTag=-1);
int sphereCenterTag = -1);
GMSH_API gmshModelGeoAddSurfaceLoop(int &tag, const std::vector<int> &faceTags);
GMSH_API gmshModelGeoAddVolume(int &tag, const std::vector<int> &shellTags);
GMSH_API gmshModelGeoExtrude(const std::vector<std::pair<int, int> > &inDimTags,
double dx, double dy, double dz,
std::vector<std::pair<int, int> > &outDimTags,
const std::vector<int> &numElements=std::vector<int>(),
const std::vector<double> &heights=std::vector<double>(),
bool recombine=false);
const std::vector<int> &numElements = std::vector<int>(),
const std::vector<double> &heights = std::vector<double>(),
bool recombine = false);
GMSH_API gmshModelGeoRevolve(const std::vector<std::pair<int, int> > &inDimTags,
double x, double y, double z,
double ax, double ay, double az, double angle,
std::vector<std::pair<int, int> > &outDimTags,
const std::vector<int> &numElements=std::vector<int>(),
const std::vector<double> &heights=std::vector<double>(),
bool recombine=false);
const std::vector<int> &numElements = std::vector<int>(),
const std::vector<double> &heights = std::vector<double>(),
bool recombine = false);
GMSH_API gmshModelGeoTwist(const std::vector<std::pair<int, int> > &inDimTags,
double x, double y, double z,
double dx, double dy, double dz,
double ax, double ay, double az, double angle,
std::vector<std::pair<int, int> > &outDimTags,
const std::vector<int> &numElements=std::vector<int>(),
const std::vector<double> &heights=std::vector<double>(),
bool recombine=false);
const std::vector<int> &numElements = std::vector<int>(),
const std::vector<double> &heights = std::vector<double>(),
bool recombine = false);
GMSH_API gmshModelGeoTranslate(const std::vector<std::pair<int, int> > &dimTags,
double dx, double dy, double dz);
GMSH_API gmshModelGeoRotate(const std::vector<std::pair<int, int> > &dimTags,
double x, double y, double z, double ax, double ay, double az,
double angle);
double x, double y, double z, double ax, double ay,
double az, double angle);
GMSH_API gmshModelGeoDilate(const std::vector<std::pair<int, int> > &dimTags,
double x, double y, double z,
double a, double b, double c);
......@@ -131,12 +133,13 @@ GMSH_API gmshModelGeoSymmetry(const std::vector<std::pair<int, int> > &dimTags,
GMSH_API gmshModelGeoCopy(const std::vector<std::pair<int, int> > &inDimTags,
std::vector<std::pair<int, int> > &outDimTags);
GMSH_API gmshModelGeoRemove(const std::vector<std::pair<int, int> > &dimTags,
bool recursive=false);
bool recursive = false);
GMSH_API gmshModelGeoRemoveAllDuplicates();
GMSH_API gmshModelGeoSynchronize();
// gmshModelOcc
GMSH_API gmshModelOccAddVertex(int &tag, double x, double y, double z, double meshSize);
GMSH_API gmshModelOccAddVertex(int &tag, double x, double y, double z,
double meshSize);
// gmshSolver
......
This directory contains examples on how to use the Gmsh C++ API.
#include <iostream>
#include <gmsh.h>
// this reimplements gmsh/tutorial/t1.geo
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment