]> SALOME platform Git repositories - plugins/blsurfplugin.git/commitdiff
Salome HOME
Merge branch 'occ/new_mg_licnese' V9_8_0a1 V9_8_0a2
authorvsr <vsr@opencascade.com>
Fri, 24 Sep 2021 08:55:56 +0000 (11:55 +0300)
committervsr <vsr@opencascade.com>
Fri, 24 Sep 2021 08:55:56 +0000 (11:55 +0300)
doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters.png
resources/CMakeLists.txt
src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx
src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx
src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx
src/GUI/BLSURFPluginGUI_StdWidget_QTD.ui

index 5f67d49f6b6ff3dbb3caf1e8ecc5220f74312b33..575553d6c8a583b88a9adaaf7cec222afa5947d3 100644 (file)
Binary files a/doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters.png and b/doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters.png differ
index edda96760d4e431a4cf5dbdc090669b2d67fa53d..9c5d5a7141dc19f78f964d4486219a8a5ce5a57a 100644 (file)
@@ -36,3 +36,4 @@ SET(BLSURFPLUGIN_RESOURCES_FILES
 )
 
 INSTALL(FILES ${BLSURFPLUGIN_RESOURCES_FILES} DESTINATION ${SALOME_BLSURFPLUGIN_INSTALL_RES_DATA})
+INSTALL(FILES SalomeApp.xml RENAME SalomeAppSL.xml DESTINATION ${SALOME_BLSURFPLUGIN_INSTALL_RES_DATA})
index afac06f0ca69b47fa53f41acbc986def127b7b51..8f517c63eb03a501ad1dc99e94610ae60ee7f1fd 100644 (file)
@@ -98,6 +98,9 @@ extern "C"{
 #include <fenv.h>
 #endif
 
+#include <memory>
+#include <functional>
+
 using namespace std;
 
 /* ==================================
@@ -2629,18 +2632,22 @@ bool BLSURFPlugin_BLSURF::compute(SMESH_Mesh&         aMesh,
 
   /* retrieve mesh data (see meshgems/mesh.h) */
   integer nv, ne, nt, nq, vtx[4], tag, nb_tag;
-  integer *evedg, *evtri, *evquad, *tags_buff, type;
+  integer type;
   real xyz[3];
 
   mesh_get_vertex_count    (msh, &nv);
   mesh_get_edge_count      (msh, &ne);
   mesh_get_triangle_count  (msh, &nt);
   mesh_get_quadrangle_count(msh, &nq);
-
-  evedg  = (integer *)mesh_calloc_generic_buffer(msh);
-  evtri  = (integer *)mesh_calloc_generic_buffer(msh);
-  evquad = (integer *)mesh_calloc_generic_buffer(msh);
-  tags_buff = (integer*)mesh_calloc_generic_buffer(msh);
+  
+  using deleted_unique_ptr = std::unique_ptr<integer,std::function<void(integer*)>>;
+  
+  deleted_unique_ptr evedg_var((integer *)mesh_calloc_generic_buffer(msh), [](integer *ptr) { free(ptr); });
+  deleted_unique_ptr evtri_var((integer *)mesh_calloc_generic_buffer(msh), [](integer *ptr) { free(ptr); });
+  deleted_unique_ptr evquad_var((integer *)mesh_calloc_generic_buffer(msh), [](integer *ptr) { free(ptr); });
+  deleted_unique_ptr tags_buff_var((integer*)mesh_calloc_generic_buffer(msh), [](integer *ptr) { free(ptr); });
+
+  integer *evedg(evedg_var.get()),*evtri(evtri_var.get()),*evquad(evquad_var.get()),*tags_buff(tags_buff_var.get());
 
   std::vector<const SMDS_MeshNode*> nodes(nv+1);
   std::vector<bool>                  tags(nv+1);
index f583e989244b40f46f5b434805154f00e06e5e32..3ff30d9f0a1a77a86eef67be04a6b5008423a7e9 100644 (file)
@@ -29,6 +29,7 @@
 
 #include <SMESHDS_Group.hxx>
 #include <SMESHDS_Mesh.hxx>
+#include <SMESH_BoostTxtArchive.hxx>
 #include <SMESH_Gen_i.hxx>
 #include <SMESH_Group.hxx>
 #include <SMESH_TryCatch.hxx>
@@ -47,7 +48,6 @@
 #define MESHGEMS_VERSION_HEX (MESHGEMS_VERSION_MAJOR << 16 | MESHGEMS_VERSION_MINOR << 8 | MESHGEMS_VERSION_PATCH)
 
 #include <boost/archive/text_oarchive.hpp>
-#include <boost/archive/text_iarchive.hpp>
 #include <boost/serialization/set.hpp>
 #include <boost/serialization/vector.hpp>
 #include <boost/serialization/string.hpp>
@@ -3395,10 +3395,8 @@ std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load)
   std::string buffer;
   if ( SMESHDS_Hypothesis::LoadStringFromStream( load, buffer ))
   {
-    std::istringstream istream( buffer.data() );
-    boost::archive::text_iarchive archive( istream );
     SMESH_TRY;
-    archive >> _hyperPatchEntriesList;
+    SMESHUtils::BoostTxtArchive( buffer ) >> _hyperPatchEntriesList;
     SMESH_CATCH( SMESH::printErrorInDebugMode );
   }
 
@@ -3406,10 +3404,8 @@ std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load)
   buffer.clear();
   if ( SMESHDS_Hypothesis::LoadStringFromStream( load, buffer ))
   {
-    std::istringstream istream( buffer.data() );
-    boost::archive::text_iarchive archive( istream );
     SMESH_TRY;
-    archive >> _enforcedMeshes;
+    SMESHUtils::BoostTxtArchive( buffer ) >> _enforcedMeshes;
     SMESH_CATCH( SMESH::printErrorInDebugMode );
   }
 
index 5a90eb090190d2cfee1241f1b3d285835255678c..b378244a4926eefb7cf78d08d41153f8766df2bb 100644 (file)
@@ -1086,6 +1086,9 @@ void BLSURFPlugin_Hypothesis_i::SetEnforcedMeshes(const BLSURFPlugin::EnforcedMe
     enforcedMeshes.push_back({ meshID, partID, partType, inEM.groupName.in() });
   }
 
+  if ( GetImpl()->GetEnforcedMeshes() == enforcedMeshes )
+    return;
+
   this->GetImpl()->SetEnforcedMeshes( enforcedMeshes );
 
   // dump
@@ -1102,8 +1105,9 @@ void BLSURFPlugin_Hypothesis_i::SetEnforcedMeshes(const BLSURFPlugin::EnforcedMe
       pyDump << "'" << inEM.groupName.in() << "'";
     else
       pyDump << "''";
-    pyDump << ")" << ( i + 1 < theMeshes.length() ? ", " : "])");
+    pyDump << ")" << ( i + 1 < theMeshes.length() ? ", " : "");
   }
+  pyDump << "])";
 }
 
 //=============================================================================
@@ -3566,7 +3570,7 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexEntry(const char* theFaceEntry,
         if (string(theGroupName).empty())
           SMESH::TPythonDump() << _this() << ".AddEnforcedVertex(" << x << ", " << y << ", " << z << ")";
         else
-          SMESH::TPythonDump() << _this() << ".AddEnforcedVertexWithGroup(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ", \"" << theGroupName << "\")";
+          SMESH::TPythonDump() << _this() << ".AddEnforcedVertexWithGroup(" << x << ", " << y << ", " << z << ", \"" << theGroupName << "\")";
       }
       else {
         if (string(theGroupName).empty())
index 7780a04b1a1b88afcf5d74ec23c0d621770aede2..8de8e988f156fdfe6d72b5ce1c202659b3ea3916 100644 (file)
@@ -7,8 +7,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>899</width>
-    <height>532</height>
+    <width>902</width>
+    <height>390</height>
    </rect>
   </property>
   <layout class="QGridLayout" name="gridLayout_8">
         <property name="orientation">
          <enum>Qt::Vertical</enum>
         </property>
+        <property name="sizeType">
+         <enum>QSizePolicy::Minimum</enum>
+        </property>
         <property name="sizeHint" stdset="0">
          <size>
           <width>20</width>
-          <height>4</height>
+          <height>0</height>
          </size>
         </property>
        </spacer>
         <property name="orientation">
          <enum>Qt::Vertical</enum>
         </property>
+        <property name="sizeType">
+         <enum>QSizePolicy::MinimumExpanding</enum>
+        </property>
         <property name="sizeHint" stdset="0">
          <size>
           <width>20</width>
-          <height>36</height>
+          <height>0</height>
          </size>
         </property>
        </spacer>
         <property name="orientation">
          <enum>Qt::Vertical</enum>
         </property>
+        <property name="sizeType">
+         <enum>QSizePolicy::MinimumExpanding</enum>
+        </property>
         <property name="sizeHint" stdset="0">
          <size>
           <width>20</width>
-          <height>23</height>
+          <height>0</height>
          </size>
         </property>
        </spacer>
      </layout>
     </widget>
    </item>
-   <item row="1" column="0">
+   <item row="0" column="2">
     <widget class="QGroupBox" name="groupBox_4">
      <property name="title">
       <string>BLSURF_ELEMENT_TYPE</string>
         <property name="orientation">
          <enum>Qt::Vertical</enum>
         </property>
+        <property name="sizeType">
+         <enum>QSizePolicy::MinimumExpanding</enum>
+        </property>
         <property name="sizeHint" stdset="0">
          <size>
           <width>20</width>
-          <height>3</height>
+          <height>0</height>
          </size>
         </property>
        </spacer>
      </layout>
     </widget>
    </item>
-   <item row="1" column="1">
+   <item row="1" column="0">
     <widget class="QGroupBox" name="groupBox_2">
      <property name="title">
       <string>BLSURF_MAIN_PARAMETERS</string>
         <property name="orientation">
          <enum>Qt::Vertical</enum>
         </property>
+        <property name="sizeType">
+         <enum>QSizePolicy::MinimumExpanding</enum>
+        </property>
         <property name="sizeHint" stdset="0">
          <size>
           <width>20</width>
-          <height>55</height>
+          <height>0</height>
          </size>
         </property>
        </spacer>
      </layout>
     </widget>
    </item>
-   <item row="2" column="0">
+   <item row="1" column="1">
     <widget class="QGroupBox" name="groupBox_5">
      <property name="toolTip">
       <string/>
          </item>
         </layout>
         <zorder>label_7</zorder>
-        <zorder>myVolumeGradation_2</zorder>
         <zorder>myNbSurfaceProximityLayers</zorder>
         <zorder>label_9</zorder>
         <zorder>mySurfaceProximityRatio</zorder>
         <property name="orientation">
          <enum>Qt::Vertical</enum>
         </property>
+        <property name="sizeType">
+         <enum>QSizePolicy::Minimum</enum>
+        </property>
         <property name="sizeHint" stdset="0">
          <size>
           <width>20</width>
-          <height>15</height>
+          <height>0</height>
          </size>
         </property>
        </spacer>
      </layout>
     </widget>
    </item>
-   <item row="2" column="1">
+   <item row="1" column="2">
     <widget class="QGroupBox" name="groupBox_3">
      <property name="title">
       <string>BLSURF_OTHER_PARAMETERS</string>
         <property name="orientation">
          <enum>Qt::Vertical</enum>
         </property>
+        <property name="sizeType">
+         <enum>QSizePolicy::MinimumExpanding</enum>
+        </property>
         <property name="sizeHint" stdset="0">
          <size>
           <width>20</width>
-          <height>3</height>
+          <height>0</height>
          </size>
         </property>
        </spacer>
  <buttongroups>
   <buttongroup name="myButtonGroupElementType"/>
  </buttongroups>
-</ui>
+</ui>
\ No newline at end of file