From 3dcf8c5372a62eb43a6eb51e6d33562755e26440 Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 11 Mar 2020 10:39:03 +0300 Subject: [PATCH] Export MeshGems version, to be able to check it in scripts --- idl/BLSURFPlugin_Algorithm.idl | 6 ++++++ src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx | 9 ++++++++- src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx | 2 ++ src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx | 11 ++++++++++- src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx | 2 ++ 5 files changed, 28 insertions(+), 2 deletions(-) diff --git a/idl/BLSURFPlugin_Algorithm.idl b/idl/BLSURFPlugin_Algorithm.idl index 23095c9..6ddc5ea 100644 --- a/idl/BLSURFPlugin_Algorithm.idl +++ b/idl/BLSURFPlugin_Algorithm.idl @@ -137,6 +137,12 @@ module BLSURFPlugin interface BLSURFPlugin_Hypothesis : SMESH::SMESH_Hypothesis { + /*! + * Get version of MeshGems suite. + * The version is a string in form .-. Example: "2.9-6". + */ + string GetMeshGemsVersion(); + /*! *Set a way to define size of mesh elements to generate * 0 - size is defined automatically diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx index b47c66e..e20cc14 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx @@ -40,6 +40,7 @@ #include CORBA_CLIENT_HEADER(GEOM_Gen) #include +#define MESHGEMS_VERSION_HEX (MESHGEMS_VERSION_MAJOR << 16 | MESHGEMS_VERSION_MINOR << 8 | MESHGEMS_VERSION_PATCH) namespace { @@ -234,7 +235,7 @@ BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis(int hypId, SMESH_Gen * gen, boo _defaultOptionValues["compute_ridges" ] = "yes"; } - if ( strcmp( MESHGEMS_VERSION_LONG, "2.9-6" ) < 0 ) + if ( MESHGEMS_VERSION_HEX < 0x020906 ) { std::string missingOption = "allow_patch_independent"; _defaultOptionValues.erase( missingOption ); @@ -268,6 +269,12 @@ TopoDS_Shape BLSURFPlugin_Hypothesis::entryToShape(std::string entry) return S; } +//============================================================================= +std::string BLSURFPlugin_Hypothesis::GetMeshGemsVersion() +{ + return MESHGEMS_VERSION_LONG; +} + //============================================================================= void BLSURFPlugin_Hypothesis::SetPhysicalMesh(PhysicalMesh thePhysicalMesh) { if (thePhysicalMesh != _physicalMesh) { diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx index fcff08a..705dc72 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx @@ -75,6 +75,8 @@ public: TopoDS_Shape entryToShape(std::string entry); + static std::string GetMeshGemsVersion(); + void SetPhysicalMesh(PhysicalMesh thePhysicalMesh); PhysicalMesh GetPhysicalMesh() const { return _physicalMesh; } diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx index 8220eda..e7d1888 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx @@ -69,6 +69,16 @@ BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i() } //============================================================================= +/*! + * BLSURFPlugin_Hypothesis_i::GetMeshGemsVersion + * + * Get version of MeshGems suite. + */ +//============================================================================= +char* BLSURFPlugin_Hypothesis_i::GetMeshGemsVersion() +{ + return CORBA::string_dup( this->GetImpl()->GetMeshGemsVersion().c_str() ); +} //============================================================================= /*! @@ -76,7 +86,6 @@ BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i() * * Set PhysicalMesh */ - //============================================================================= void BLSURFPlugin_Hypothesis_i::SetPhysicalMesh(CORBA::Long theValue) { diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx index f5ec502..b961636 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx @@ -49,6 +49,8 @@ public: // Destructor virtual ~BLSURFPlugin_Hypothesis_i(); + char* GetMeshGemsVersion(); + void SetPhysicalMesh(CORBA::Long theValue); CORBA::Long GetPhysicalMesh(); -- 2.39.2