Salome HOME
23368: [CEA 1865] Possibility to define faces to mesh as a single one: transpatch...
[plugins/blsurfplugin.git] / src / BLSURFPlugin / BLSURFPlugin_Hypothesis_i.cxx
index c5cb677c6067ce223170afc06fc26040ee993d58..3db9133b7eb91c6c58b98636370a9448ea744399 100644 (file)
@@ -1059,6 +1059,51 @@ char* BLSURFPlugin_Hypothesis_i::GetTags()
   return CORBA::string_dup( this->GetImpl()->GetTags().c_str() );
 }
 
+//=============================================================================
+void BLSURFPlugin_Hypothesis_i::SetHyperPatches(const BLSURFPlugin::THyperPatchList& hpl)
+{
+  ::BLSURFPlugin_Hypothesis::THyperPatchList patchList( hpl.length() );
+  SMESH_Comment hplDump;
+  hplDump << "[";
+  for ( size_t i = 0; i < patchList.size(); ++i )
+  {
+    hplDump << "[ ";
+    BLSURFPlugin::THyperPatch tags = hpl[ i ];
+    for ( CORBA::ULong j = 0; j < tags.length(); ++j )
+    {
+      patchList[ i ].insert( tags[ j ]);
+      hplDump << tags[ j ] << ( j+1 < tags.length() ? ", " : " ]" );
+    }
+    hplDump << ( i+1 < patchList.size() ? "," : "]");
+  }
+  if ( GetImpl()->GetHyperPatches() != patchList )
+  {
+    GetImpl()->SetHyperPatches( patchList );
+    SMESH::TPythonDump() << _this() << ".SetHyperPatches( " << hplDump << " )";
+  }
+}
+
+//=============================================================================
+BLSURFPlugin::THyperPatchList* BLSURFPlugin_Hypothesis_i::GetHyperPatches()
+{
+  const ::BLSURFPlugin_Hypothesis::THyperPatchList& hpl = GetImpl()->GetHyperPatches();
+  BLSURFPlugin::THyperPatchList* resHpl = new BLSURFPlugin::THyperPatchList();
+  resHpl->length( hpl.size() );
+
+  ::BLSURFPlugin_Hypothesis::THyperPatchList::const_iterator hpIt = hpl.begin();
+  for ( int i = 0; hpIt != hpl.end(); ++hpIt, ++i )
+  {
+    const ::BLSURFPlugin_Hypothesis::THyperPatchTags& hp = *hpIt;
+    BLSURFPlugin::THyperPatch& resHp = (*resHpl)[ i ];
+    resHp.length( hp.size() );
+
+    ::BLSURFPlugin_Hypothesis::THyperPatchTags::const_iterator tag = hp.begin();
+    for ( int j = 0; tag != hp.end(); ++tag, ++j )
+      resHp[ j ] = *tag;
+  }
+  return resHpl;
+}
+
 //=============================================================================
 /*!
  *  BLSURFPlugin_Hypothesis_i::SetPreCADMergeEdges