From 6df8817c1a9827149025cc942249d7083f504d3d Mon Sep 17 00:00:00 2001 From: eap Date: Mon, 17 Sep 2018 22:24:36 +0300 Subject: [PATCH] 23586: [EDF] HYDRO: Copy mesh to new geometry --- doc/salome/gui/SMESH/images/copy_mesh_dlg.png | Bin 23114 -> 26601 bytes doc/salome/gui/SMESH/input/copy_mesh.rst | 12 +- idl/SMESH_Gen.idl | 31 + resources/CMakeLists.txt | 1 + resources/copy_mesh_with_geom.png | Bin 0 -> 636 bytes src/SMESH/SMESH_Mesh.cxx | 4 +- src/SMESH/SMESH_Mesh.hxx | 2 +- src/SMESH/SMESH_subMesh.cxx | 2 +- src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx | 295 +++++- src/SMESHGUI/SMESHGUI_CopyMeshDlg.h | 18 +- src/SMESHGUI/SMESHGUI_GEOMGenUtils.cxx | 11 + src/SMESHGUI/SMESHGUI_GEOMGenUtils.h | 2 + src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx | 10 +- src/SMESHGUI/SMESHGUI_MeshOp.cxx | 54 +- src/SMESHGUI/SMESHGUI_MeshOp.h | 5 +- src/SMESHGUI/SMESHGUI_Utils.cxx | 6 + src/SMESHGUI/SMESHGUI_Utils.h | 12 + src/SMESHGUI/SMESH_images.ts | 4 + src/SMESHGUI/SMESH_msg_en.ts | 27 + src/SMESH_I/SMESH_2smeshpy.cxx | 14 +- src/SMESH_I/SMESH_Algo_i.cxx | 24 + src/SMESH_I/SMESH_Algo_i.hxx | 9 + src/SMESH_I/SMESH_Gen_i.cxx | 888 +++++++++++++++++- src/SMESH_I/SMESH_Gen_i.hxx | 28 +- src/SMESH_I/SMESH_Gen_i_1.cxx | 116 ++- src/SMESH_I/SMESH_Group_i.cxx | 8 +- src/SMESH_I/SMESH_Hypothesis_i.hxx | 14 +- src/SMESH_I/SMESH_Mesh_i.cxx | 47 +- src/SMESH_I/SMESH_Mesh_i.hxx | 2 +- src/SMESH_I/SMESH_PythonDump.cxx | 10 + src/SMESH_I/SMESH_PythonDump.hxx | 6 + src/SMESH_I/SMESH_subMesh_i.cxx | 29 + src/SMESH_I/SMESH_subMesh_i.hxx | 22 + src/SMESH_SWIG/smeshBuilder.py | 39 +- src/StdMeshers/StdMeshers_Arithmetic1D.cxx | 39 +- src/StdMeshers/StdMeshers_Arithmetic1D.hxx | 18 +- src/StdMeshers/StdMeshers_FixedPoints1D.cxx | 26 +- src/StdMeshers/StdMeshers_FixedPoints1D.hxx | 14 +- .../StdMeshers_NumberOfSegments.cxx | 18 +- .../StdMeshers_NumberOfSegments.hxx | 17 +- .../StdMeshers_QuadrangleParams.hxx | 2 +- src/StdMeshers/StdMeshers_Reversible1D.hxx | 2 +- src/StdMeshers/StdMeshers_StartEndLength.cxx | 42 +- src/StdMeshers/StdMeshers_StartEndLength.hxx | 16 +- src/StdMeshers_I/StdMeshers_Adaptive1D_i.hxx | 6 + .../StdMeshers_Arithmetic1D_i.cxx | 122 +-- .../StdMeshers_Arithmetic1D_i.hxx | 28 +- .../StdMeshers_AutomaticLength_i.hxx | 6 + .../StdMeshers_CartesianParameters3D_i.hxx | 7 + .../StdMeshers_Deflection1D_i.hxx | 5 + .../StdMeshers_FixedPoints1D_i.cxx | 124 +-- .../StdMeshers_FixedPoints1D_i.hxx | 28 +- src/StdMeshers_I/StdMeshers_Geometric1D_i.cxx | 36 +- src/StdMeshers_I/StdMeshers_Geometric1D_i.hxx | 12 + .../StdMeshers_ImportSource1D_i.hxx | 11 + .../StdMeshers_ImportSource2D_i.hxx | 11 + .../StdMeshers_LayerDistribution2D_i.hxx | 11 + .../StdMeshers_LayerDistribution_i.hxx | 11 + .../StdMeshers_LengthFromEdges_i.hxx | 11 + src/StdMeshers_I/StdMeshers_LocalLength_i.hxx | 11 + .../StdMeshers_MaxElementArea_i.hxx | 12 + .../StdMeshers_MaxElementVolume_i.hxx | 11 + src/StdMeshers_I/StdMeshers_MaxLength_i.hxx | 11 + .../StdMeshers_NotConformAllowed_i.hxx | 11 + .../StdMeshers_NumberOfLayers2D_i.hxx | 11 + .../StdMeshers_NumberOfLayers_i.hxx | 11 + .../StdMeshers_NumberOfSegments_i.cxx | 127 +-- .../StdMeshers_NumberOfSegments_i.hxx | 21 +- src/StdMeshers_I/StdMeshers_ObjRefUlils.cxx | 18 + src/StdMeshers_I/StdMeshers_ObjRefUlils.hxx | 7 + .../StdMeshers_ProjectionSource1D_i.cxx | 43 + .../StdMeshers_ProjectionSource1D_i.hxx | 9 + .../StdMeshers_ProjectionSource2D_i.cxx | 45 + .../StdMeshers_ProjectionSource2D_i.hxx | 10 + .../StdMeshers_ProjectionSource3D_i.cxx | 45 + .../StdMeshers_ProjectionSource3D_i.hxx | 12 +- src/StdMeshers_I/StdMeshers_Propagation_i.hxx | 12 + .../StdMeshers_QuadrangleParams_i.cxx | 51 + .../StdMeshers_QuadrangleParams_i.hxx | 10 + .../StdMeshers_QuadranglePreference_i.hxx | 6 + .../StdMeshers_QuadraticMesh_i.hxx | 6 + .../StdMeshers_Reversible1D_i.cxx | 43 +- .../StdMeshers_Reversible1D_i.hxx | 13 +- ...StdMeshers_SegmentLengthAroundVertex_i.hxx | 10 + .../StdMeshers_StartEndLength_i.cxx | 120 +-- .../StdMeshers_StartEndLength_i.hxx | 20 +- .../StdMeshers_ViscousLayers2D_i.cxx | 52 +- .../StdMeshers_ViscousLayers2D_i.hxx | 11 + .../StdMeshers_ViscousLayers_i.cxx | 41 + .../StdMeshers_ViscousLayers_i.hxx | 9 + 90 files changed, 2471 insertions(+), 723 deletions(-) create mode 100644 resources/copy_mesh_with_geom.png diff --git a/doc/salome/gui/SMESH/images/copy_mesh_dlg.png b/doc/salome/gui/SMESH/images/copy_mesh_dlg.png index c959e680f6f20123999988deef191927db99fd4c..97ca1cac7ad153d74e006363744a9dbf17d377da 100644 GIT binary patch literal 26601 zcmdSBby$?$+BZCifB_<{q@sXGcY`R>A>G~GT_Q+#H%dxNcb9a7!~oLWUGuKtzW3hG zexCh&$MGKD_s@5U2hKRmT-UnRI?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GetID() ); SMESH_Algo *algo; const SMESH_HypoFilter* compatibleHypoKind; diff --git a/src/SMESH/SMESH_Mesh.hxx b/src/SMESH/SMESH_Mesh.hxx index c52b5ef2e..dbe14fed8 100644 --- a/src/SMESH/SMESH_Mesh.hxx +++ b/src/SMESH/SMESH_Mesh.hxx @@ -334,7 +334,7 @@ class SMESH_EXPORT SMESH_Mesh struct TCallUp // callback from SMESH to SMESH_I level { virtual void RemoveGroup (const int theGroupID)=0; - virtual void HypothesisModified ()=0; + virtual void HypothesisModified (int theHypID)=0; virtual void Load ()=0; virtual ~TCallUp() {} }; diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index 7bab8d9e7..8ef0c8827 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -365,7 +365,7 @@ int SMESH_subMesh::computeCost() const */ //============================================================================= -const map < int, SMESH_subMesh * >& SMESH_subMesh::DependsOn() +const std::map < int, SMESH_subMesh * >& SMESH_subMesh::DependsOn() { if ( _dependenceAnalysed || !_father->HasShapeToMesh() ) return _mapDepend; diff --git a/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx b/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx index 4dabf6c90..b7794c02d 100644 --- a/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx @@ -24,32 +24,34 @@ #include "SMESHGUI_CopyMeshDlg.h" #include "SMESHGUI.h" +#include "SMESHGUI_FilterDlg.h" +#include "SMESHGUI_GEOMGenUtils.h" +#include "SMESHGUI_IdValidator.h" +#include "SMESHGUI_MeshUtils.h" +#include "SMESHGUI_Selection.h" #include "SMESHGUI_SpinBox.h" #include "SMESHGUI_Utils.h" #include "SMESHGUI_VTKUtils.h" -#include "SMESHGUI_MeshUtils.h" -#include "SMESHGUI_IdValidator.h" -#include "SMESHGUI_FilterDlg.h" #include #include #include // SALOME GUI includes +#include +#include +#include #include -#include -#include #include #include - -#include -#include - +#include +#include #include #include -#include +#include // SALOME KERNEL includes +#include #include // OCCT includes @@ -113,7 +115,8 @@ SMESHGUI_CopyMeshDlg::SMESHGUI_CopyMeshDlg( SMESHGUI* theModule ) myFilterDlg(0), myIsApplyAndClose( false ) { - QPixmap image (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_COPY_MESH"))); + QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_COPY_MESH"))); + QPixmap image2 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_COPY_MESH_WG"))); setModal(false); setAttribute(Qt::WA_DeleteOnClose, true); @@ -126,18 +129,21 @@ SMESHGUI_CopyMeshDlg::SMESHGUI_CopyMeshDlg( SMESHGUI* theModule ) /***************************************************************/ ConstructorsBox = new QGroupBox(tr("SMESH_COPY_MESH_TITLE"), this); - QButtonGroup* GroupConstructors = new QButtonGroup(this); + GroupConstructors = new QButtonGroup(this); QHBoxLayout* ConstructorsBoxLayout = new QHBoxLayout(ConstructorsBox); ConstructorsBoxLayout->setSpacing(SPACING); ConstructorsBoxLayout->setMargin(MARGIN); QRadioButton* RadioButton1= new QRadioButton(ConstructorsBox); - RadioButton1->setIcon(image); + RadioButton1->setIcon(image1); GroupConstructors->addButton(RadioButton1, 0); + QRadioButton* RadioButton2= new QRadioButton(ConstructorsBox); + RadioButton2->setIcon(image2); + GroupConstructors->addButton(RadioButton2, 1); ConstructorsBoxLayout->addWidget(RadioButton1); + ConstructorsBoxLayout->addWidget(RadioButton2); RadioButton1->setChecked(true); - GroupConstructors->addButton(RadioButton1, 0); /***************************************************************/ GroupArguments = new QGroupBox(tr("SMESH_ARGUMENTS"), this); @@ -164,13 +170,26 @@ SMESHGUI_CopyMeshDlg::SMESHGUI_CopyMeshDlg( SMESHGUI* theModule ) // CheckBox for copying groups myCopyGroupsCheck = new QCheckBox(tr("SMESH_MAKE_GROUPS"), GroupArguments); - myCopyGroupsCheck->setChecked(false); + myCopyGroupsCheck->setChecked(true); // CheckBox for keeping ids ( OBSOLETE ) myKeepIdsCheck = new QCheckBox(tr("SMESH_KEEP_IDS"), GroupArguments); myKeepIdsCheck->setChecked(true); myKeepIdsCheck->hide(); + // New geometry + myGeomLabel = new QLabel( tr("NEW_GEOM"), GroupArguments ); + myGeomNameEdit = new QLineEdit( GroupArguments ); + myGeomNameEdit->setReadOnly(true); + + // CheckBox to reuse hypotheses + myReuseHypCheck = new QCheckBox(tr("REUSE_HYPOTHESES"), GroupArguments); + myReuseHypCheck->setChecked(true); + + // CheckBox to copy mesh elements + myCopyElementsCheck = new QCheckBox(tr("COPY_ELEMENTS"), GroupArguments); + myCopyElementsCheck->setChecked(true); + // layout GroupArgumentsLayout->addWidget(myTextLabelElements, 0, 0); GroupArgumentsLayout->addWidget(myLineEditElements, 0, 1, 1, 5); @@ -178,8 +197,13 @@ SMESHGUI_CopyMeshDlg::SMESHGUI_CopyMeshDlg( SMESHGUI* theModule ) GroupArgumentsLayout->addWidget(myIdSourceCheck, 1, 0, 1, 6); GroupArgumentsLayout->addWidget(meshNameLabel, 2, 0); GroupArgumentsLayout->addWidget(myMeshNameEdit, 2, 1, 1, 5); - GroupArgumentsLayout->addWidget(myCopyGroupsCheck, 3, 0, 1, 6); - // GroupArgumentsLayout->addWidget(myKeepIdsCheck, 4, 0, 1, 6); + GroupArgumentsLayout->addWidget(myGeomLabel, 3, 0); + GroupArgumentsLayout->addWidget(myGeomNameEdit, 3, 1, 1, 5); + GroupArgumentsLayout->addWidget(myCopyGroupsCheck, 4, 0, 1, 6); + GroupArgumentsLayout->addWidget(myReuseHypCheck, 5, 0, 1, 6); + GroupArgumentsLayout->addWidget(myCopyElementsCheck, 6, 0, 1, 6); + // GroupArgumentsLayout->addWidget(myKeepIdsCheck, 7, 0, 1, 6); + GroupArgumentsLayout->setRowStretch( 6, 1 ); /***************************************************************/ GroupButtons = new QGroupBox(this); @@ -243,6 +267,9 @@ SMESHGUI_CopyMeshDlg::SMESHGUI_CopyMeshDlg( SMESHGUI* theModule ) this, SLOT (onTextChange(const QString&))); connect(myIdSourceCheck, SIGNAL(toggled(bool)), this, SLOT (onSelectIdSource(bool))); + connect(GroupConstructors, SIGNAL(buttonClicked(int)), + this, SLOT (onConstructor(int))); + SelectionIntoArgument(); } @@ -275,11 +302,12 @@ void SMESHGUI_CopyMeshDlg::Init (bool ResetControls) { myBusy = false; - myMeshNameEdit->setText( SMESH::UniqueMeshName("Mesh")); + if ( !isWithGeomMode() ) + myMeshNameEdit->setText( SMESH::UniqueMeshName("Mesh")); + if ( ResetControls ) { myLineEditElements->clear(); - //myElementsId = ""; myNbOkElements = 0; buttonOk->setEnabled(false); @@ -289,11 +317,98 @@ void SMESHGUI_CopyMeshDlg::Init (bool ResetControls) myMesh = SMESH::SMESH_Mesh::_nil(); myIdSourceCheck->setChecked(true); - myCopyGroupsCheck->setChecked(false); - myKeepIdsCheck->setChecked(false); - onSelectIdSource( myIdSourceCheck->isChecked() ); + onConstructor( 0 ); + } +} + +//======================================================================= +//function : onConstructor +//purpose : switch operation mode +//======================================================================= + +void SMESHGUI_CopyMeshDlg::onConstructor( int withGeom ) +{ + myGeomLabel ->setVisible( withGeom ); + myGeomNameEdit ->setVisible( withGeom ); + myReuseHypCheck ->setVisible( withGeom ); + myCopyElementsCheck->setVisible( withGeom ); + myFilterBtn ->setVisible( !withGeom ); + myIdSourceCheck ->setVisible( !withGeom ); + + if ( !withGeom ) + myMeshNameEdit->setText( SMESH::UniqueMeshName("Mesh")); + + onSelectIdSource( /*toSelectMesh=*/ myIdSourceCheck->isChecked() || withGeom ); +} + +//======================================================================= +//function : getErrorMsg +//purpose : Return an error message and entries of invalid smesh object +//======================================================================= + +QString SMESHGUI_CopyMeshDlg::getErrorMsg( SMESH::string_array_var theInvalidEntries, + QStringList & theEntriesToBrowse ) +{ + if ( theInvalidEntries->length() == 0 ) + return tr("SMESH_OPERATION_FAILED"); + + // theInvalidEntries - SObject's that hold geometry objects whose + // counterparts are not found in the newGeometry, followed by SObject's + // holding mesh sub-objects that are invalid because they depend on a not found + // preceeding sub-shape + + QString msg = tr("SUBSHAPES_NOT_FOUND_MSG") + "\n"; + + QString objString; + for ( CORBA::ULong i = 0; i < theInvalidEntries->length(); ++i ) + { + _PTR(SObject) so = SMESH::getStudy()->FindObjectID( theInvalidEntries[i].in() ); + + int objType = SMESHGUI_Selection::type( theInvalidEntries[i].in() ); + if ( objType < 0 ) // geom object + { + objString += "\n"; + if ( so ) + objString += so->GetName().c_str(); + else + objString += theInvalidEntries[i].in(); // it's something like "FACE #2" + } + else // smesh object + { + theEntriesToBrowse.push_back( theInvalidEntries[i].in() ); + + objString += "\n "; + switch ( objType ) { + case SMESH::MESH: + objString += tr("SMESH_MESH"); break; + case SMESH::HYPOTHESIS: + objString += tr("SMESH_HYPOTHESIS"); break; + case SMESH::ALGORITHM: + objString += tr("SMESH_ALGORITHM"); break; + case SMESH::SUBMESH_VERTEX: + case SMESH::SUBMESH_EDGE: + case SMESH::SUBMESH_FACE: + case SMESH::SUBMESH_SOLID: + case SMESH::SUBMESH_COMPOUND: + case SMESH::SUBMESH: + objString += tr("SMESH_SUBMESH"); break; + case SMESH::GROUP: + objString += tr("SMESH_GROUP"); break; + default:; + } + objString += " \""; + if ( so ) + objString += so->GetName().c_str(); + objString += "\" ("; + objString += theInvalidEntries[i].in(); + objString += ")"; + } } + if ( !objString.isEmpty() ) + msg += objString; + + return msg; } //================================================================================= @@ -303,13 +418,14 @@ void SMESHGUI_CopyMeshDlg::Init (bool ResetControls) bool SMESHGUI_CopyMeshDlg::ClickOnApply() { - if (SMESHGUI::isStudyLocked()) + if ( SMESHGUI::isStudyLocked() ) return false; if( !isValid() ) return false; QStringList anEntryList; + bool toShowObjects = isApplyAndClose(); try { SUIT_OverrideCursor aWaitCursor; @@ -333,16 +449,55 @@ bool SMESHGUI_CopyMeshDlg::ClickOnApply() } QByteArray meshName = myMeshNameEdit->text().toUtf8(); bool toCopyGroups = ( myCopyGroupsCheck->isChecked() ); + bool toReuseHyps = ( myReuseHypCheck->isChecked() ); + bool toCopyElems = ( myCopyElementsCheck->isChecked() ); bool toKeepIDs = ( myKeepIdsCheck->isChecked() ); SMESH::SMESH_Gen_var gen = SMESHGUI::GetSMESHGen(); - SMESH::SMESH_Mesh_var newMesh = - gen->CopyMesh(aPartToCopy, meshName.constData(), toCopyGroups, toKeepIDs); - if( !newMesh->_is_nil() ) - if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( newMesh ) ) + SMESH::SMESH_Mesh_var newMesh; + if ( isWithGeomMode() ) + { + SMESH::SMESH_Mesh_var srcMesh = mySelectedObject->GetMesh(); + SMESH::ListOfGroups_var newGroups; + SMESH::submesh_array_var newSubmeshes; + SMESH::ListOfHypothesis_var newHypotheses; + SMESH::string_array_var invalidEntries; + CORBA::Boolean ok = gen->CopyMeshWithGeom( srcMesh, myNewGeometry, + meshName.constData(), + toCopyGroups, toReuseHyps, toCopyElems, + newMesh.out(), + newGroups.out(), + newSubmeshes.out(), + newHypotheses.out(), + invalidEntries.out() ); + if ( !ok ) + { + if ( invalidEntries->length() > 0 ) + toShowObjects = true; + SUIT_MessageBox::warning( this, + tr("SMESH_WRN_WARNING"), + getErrorMsg( invalidEntries, anEntryList )); + } + } + else + { + newMesh = gen->CopyMesh(aPartToCopy, meshName.constData(), toCopyGroups, toKeepIDs); + } + if ( !newMesh->_is_nil() ) + if ( _PTR(SObject) aSObject = SMESH::ObjectToSObject( newMesh ) ) + { anEntryList.append( aSObject->GetID().c_str() ); + + if ( isWithGeomMode() ) + SMESH::SetName( aSObject, meshName ); + } } - catch (...) { + catch(const SALOME::SALOME_Exception & S_ex) + { + SalomeApp_Tools::QtCatchCorbaException(S_ex); + } + catch (...) + { } mySMESHGUI->updateObjBrowser(true); @@ -350,7 +505,7 @@ bool SMESHGUI_CopyMeshDlg::ClickOnApply() if( LightApp_Application* anApp = dynamic_cast( SUIT_Session::session()->activeApplication() ) ) - anApp->browseObjects( anEntryList, isApplyAndClose() ); + anApp->browseObjects( anEntryList, toShowObjects ); Init(false); mySelectedObject = SMESH::SMESH_IDSource::_nil(); @@ -503,13 +658,12 @@ void SMESHGUI_CopyMeshDlg::SelectionIntoArgument() myActor = 0; QString aString = ""; - myLineEditElements->setText(aString); myNbOkElements = 0; buttonOk->setEnabled(false); buttonApply->setEnabled(false); myFilterBtn->setEnabled(false); - // get selected mesh + // get selected mesh or geometry SALOME_ListIO aList; mySelectionMgr->selectedObjects(aList); int nbSel = aList.Extent(); @@ -517,19 +671,29 @@ void SMESHGUI_CopyMeshDlg::SelectionIntoArgument() return; Handle(SALOME_InteractiveObject) IO = aList.First(); - mySelectedObject = SMESH::IObjectToInterface( IO ); - if ( mySelectedObject->_is_nil() ) - return; - myMesh = SMESH::GetMeshByIO(IO); - if (myMesh->_is_nil()) - return; + SMESH::SMESH_Mesh_var mesh = SMESH::GetMeshByIO(IO); + GEOM::GEOM_Object_var geom = SMESH::GetGeom(IO); - myActor = SMESH::FindActorByEntry(IO->getEntry()); - if (!myActor) - myActor = SMESH::FindActorByObject(myMesh); + if ( !mesh->_is_nil() ) + { + myMesh = mesh; + myActor = SMESH::FindActorByEntry(IO->getEntry()); + if (!myActor) + myActor = SMESH::FindActorByObject(myMesh); + + mySelectedObject = SMESH::IObjectToInterface( IO ); + if ( mySelectedObject->_is_nil() ) + return; + } + else if ( !geom->_is_nil() ) + { + myNewGeometry = geom; + } + else + return; - if (myIdSourceCheck->isChecked()) + if (myIdSourceCheck->isChecked() || isWithGeomMode() ) { SMESH::GetNameOfSelectedIObjects( mySelectionMgr, aString ); if ( aString.isEmpty() ) aString = " "; @@ -541,8 +705,23 @@ void SMESHGUI_CopyMeshDlg::SelectionIntoArgument() myNbOkElements = aString.size(); myFilterBtn->setEnabled(true); } - myLineEditElements->setText( aString ); + bool ok = !aString.isEmpty(); + if ( !mesh->_is_nil() ) + { + myLineEditElements->setText( aString ); + if ( isWithGeomMode() ) + myMeshNameEdit->setText( aString ); + } + else if ( !geom->_is_nil() ) + { + myGeomNameEdit->setText( aString ); + ok = ok && !myLineEditElements->text().isEmpty(); + } + + if ( ok && isWithGeomMode() && !myMesh->_is_nil() ) + ok = myMesh->HasShapeToMesh(); + buttonOk->setEnabled(ok); buttonApply->setEnabled(ok); @@ -554,7 +733,9 @@ void SMESHGUI_CopyMeshDlg::SelectionIntoArgument() //======================================================================= void SMESHGUI_CopyMeshDlg::onSelectIdSource (bool toSelectMesh) { - if (toSelectMesh) + if ( isWithGeomMode() ) + myTextLabelElements->setText(tr("SMESH_MESH")); + else if ( toSelectMesh ) myTextLabelElements->setText(tr("OBJECT_NAME")); else myTextLabelElements->setText(tr("ELEM_IDS")); @@ -564,7 +745,8 @@ void SMESHGUI_CopyMeshDlg::onSelectIdSource (bool toSelectMesh) } mySelectionMgr->clearFilters(); - mySelectionMgr->installFilter(myIdSourceFilter); + if ( !isWithGeomMode() ) + mySelectionMgr->installFilter(myIdSourceFilter); SMESH::SetPointRepresentation(false); if (toSelectMesh) { @@ -592,10 +774,29 @@ void SMESHGUI_CopyMeshDlg::onSelectIdSource (bool toSelectMesh) bool SMESHGUI_CopyMeshDlg::isValid() { - if ( myIdSourceCheck->isChecked() ) - return !mySelectedObject->_is_nil(); + bool ok = false; + if ( myIdSourceCheck->isChecked() || isWithGeomMode() ) + { + ok = ( !mySelectedObject->_is_nil() ); + if ( isWithGeomMode() ) + ok = ok && ( !myNewGeometry->_is_nil() ); + } + else + { + ok = ( myNbOkElements > 0 ); + } + + return ok; +} - return myNbOkElements > 0; +//======================================================================= +//function : isWithGeomMode +//purpose : Return true if the mode is "with geometry" +//======================================================================= + +bool SMESHGUI_CopyMeshDlg::isWithGeomMode() +{ + return ( GroupConstructors->checkedId() == 1 ); } //================================================================================= diff --git a/src/SMESHGUI/SMESHGUI_CopyMeshDlg.h b/src/SMESHGUI/SMESHGUI_CopyMeshDlg.h index fe4a8f1a9..2566e7aa6 100644 --- a/src/SMESHGUI/SMESHGUI_CopyMeshDlg.h +++ b/src/SMESHGUI/SMESHGUI_CopyMeshDlg.h @@ -35,12 +35,14 @@ // IDL includes #include #include CORBA_SERVER_HEADER(SMESH_Mesh) +#include CORBA_SERVER_HEADER(SMESH_Gen) class QCheckBox; class QGroupBox; class QLabel; class QLineEdit; class QPushButton; +class QButtonGroup; class SMESHGUI; class SMESHGUI_IdValidator; @@ -56,10 +58,10 @@ class SUIT_SelectionFilter; //================================================================================= class SMESHGUI_EXPORT SMESHGUI_CopyMeshDlg : public QDialog -{ +{ Q_OBJECT -public: + public: SMESHGUI_CopyMeshDlg( SMESHGUI* ); ~SMESHGUI_CopyMeshDlg(); @@ -67,10 +69,12 @@ private: void Init( bool = true ); void enterEvent( QEvent* ); /* mouse enter the QWidget */ void keyPressEvent( QKeyEvent* ); - int GetConstructorId(); void setNewMeshName(); + QString getErrorMsg( SMESH::string_array_var invalidEntries, + QStringList & entriesToBrowse ); bool isValid(); + bool isWithGeomMode(); void setIsApplyAndClose( const bool theFlag ); bool isApplyAndClose() const; @@ -84,11 +88,14 @@ private: bool myBusy; SMESH::SMESH_Mesh_var myMesh; + GEOM::GEOM_Object_var myNewGeometry; SMESH_Actor* myActor; SUIT_SelectionFilter* myIdSourceFilter; SMESH::SMESH_IDSource_var mySelectedObject; + QButtonGroup* GroupConstructors; + QGroupBox* ConstructorsBox; QGroupBox* GroupArguments; QGroupBox* GroupButtons; @@ -99,10 +106,14 @@ private: QPushButton* buttonHelp; QLabel* myTextLabelElements; + QLabel* myGeomLabel; QLineEdit* myLineEditElements; QLineEdit* myMeshNameEdit; + QLineEdit* myGeomNameEdit; QCheckBox* myIdSourceCheck; QCheckBox* myCopyGroupsCheck; + QCheckBox* myReuseHypCheck; + QCheckBox* myCopyElementsCheck; QCheckBox* myKeepIdsCheck; QPushButton* myFilterBtn; @@ -122,6 +133,7 @@ private slots: void SelectionIntoArgument(); void DeactivateActiveDialog(); void ActivateThisDialog(); + void onConstructor( int ); void onTextChange( const QString& ); void onSelectIdSource( bool ); void setFilters(); diff --git a/src/SMESHGUI/SMESHGUI_GEOMGenUtils.cxx b/src/SMESHGUI/SMESHGUI_GEOMGenUtils.cxx index 536742006..7a403902d 100644 --- a/src/SMESHGUI/SMESHGUI_GEOMGenUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_GEOMGenUtils.cxx @@ -111,6 +111,17 @@ namespace SMESH return aMeshShape; } + GEOM::GEOM_Object_var GetGeom( Handle(SALOME_InteractiveObject) io ) + { + GEOM::GEOM_Object_var go; + if ( !io.IsNull() && io->hasEntry() ) + { + _PTR(SObject) so = SMESH::getStudy()->FindObjectID( io->getEntry() ); + go = GetGeom( so ); + } + return go._retn(); + } + SMESHGUI_EXPORT char* GetGeomName( _PTR(SObject) smeshSO ) { if (!smeshSO) diff --git a/src/SMESHGUI/SMESHGUI_GEOMGenUtils.h b/src/SMESHGUI/SMESHGUI_GEOMGenUtils.h index f59609e07..33031215c 100644 --- a/src/SMESHGUI/SMESHGUI_GEOMGenUtils.h +++ b/src/SMESHGUI/SMESHGUI_GEOMGenUtils.h @@ -51,6 +51,8 @@ namespace SMESH SMESHGUI_EXPORT GEOM::GEOM_Object_var GetGeom( _PTR(SObject) ); + SMESHGUI_EXPORT GEOM::GEOM_Object_var GetGeom( Handle(SALOME_InteractiveObject) io ); + SMESHGUI_EXPORT char* GetGeomName( _PTR(SObject) smeshSO ); SMESHGUI_EXPORT GEOM::GEOM_Object_ptr GetSubShape( GEOM::GEOM_Object_ptr, long ); diff --git a/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx b/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx index 7aff8c6ce..255d2f575 100644 --- a/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx @@ -523,13 +523,15 @@ namespace SMESH if(MYDEBUG) MESSAGE("Loading client meshers plugin library ..."); #ifdef WIN32 #ifdef UNICODE - LPTSTR path = new TCHAR[aClientLibName.length() + 1]; - path[aClientLibName.toWCharArray(path)] = '\0'; + LPTSTR path = new TCHAR[aClientLibName.length() + 1]; + path[aClientLibName.toWCharArray(path)] = '\0'; #else - const char* path = aClientLibName.toUtf8().data(); + QByteArray baPath = aClientLibName.toUtf8(); + const char* path = baPath.data(); #endif #else - char* path = aClientLibName.toUtf8().data(); + QByteArray baPath = aClientLibName.toUtf8(); + char* path = baPath.data(); #endif LibHandle libHandle = LoadLib( path ); if (!libHandle) { diff --git a/src/SMESHGUI/SMESHGUI_MeshOp.cxx b/src/SMESHGUI/SMESHGUI_MeshOp.cxx index 9378e4d40..9c690f378 100644 --- a/src/SMESHGUI/SMESHGUI_MeshOp.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshOp.cxx @@ -92,6 +92,7 @@ SMESHGUI_MeshOp::SMESHGUI_MeshOp( const bool theToCreate, const bool theIsMesh ) myShapeByMeshOp( 0 ), myToCreate( theToCreate ), myIsMesh( theIsMesh ), + myIsInvalidSubMesh( false ), myHypoSet( 0 ) { if ( GeometryGUI::GetGeomGen()->_is_nil() )// check that GEOM_Gen exists @@ -152,7 +153,7 @@ bool SMESHGUI_MeshOp::onApply() QStringList anEntryList; if ( myToCreate && myIsMesh ) aResult = createMesh( aMess, anEntryList ); - if ( myToCreate && !myIsMesh ) + if (( myToCreate && !myIsMesh ) || myIsInvalidSubMesh ) aResult = createSubMesh( aMess, anEntryList ); else if ( !myToCreate ) aResult = editMeshOrSubMesh( aMess ); @@ -519,6 +520,7 @@ void SMESHGUI_MeshOp::selectionDone() try { myIsOnGeometry = true; + myIsInvalidSubMesh = false; //Check geometry for mesh QString anObjEntry = myDlg->selectedObject(SMESHGUI_MeshDlg::Obj); @@ -638,11 +640,21 @@ void SMESHGUI_MeshOp::selectionDone() SMESH::SMESH_subMesh_var submeshVar = SMESH::SMESH_subMesh::_narrow( _CAST( SObject,pObj )->GetObject() ); myIsMesh = submeshVar->_is_nil(); + myIsInvalidSubMesh = ( !myIsMesh && submeshVar->GetId() < 1 ); myDlg->setTitile( myToCreate, myIsMesh ); myDlg->setObjectShown( SMESHGUI_MeshDlg::Mesh, !submeshVar->_is_nil() ); myDlg->setObjectShown( SMESHGUI_MeshDlg::Geom, true ); myDlg->objectWg( SMESHGUI_MeshDlg::Mesh, SMESHGUI_MeshDlg::Btn )->hide(); - myDlg->objectWg( SMESHGUI_MeshDlg::Geom, SMESHGUI_MeshDlg::Btn )->hide(); + if ( myIsInvalidSubMesh ) + { + // it is necessary to select a new geometry + myDlg->objectWg( SMESHGUI_MeshDlg::Geom, SMESHGUI_MeshDlg::Btn )->show(); + myDlg->activateObject( SMESHGUI_MeshDlg::Geom ); + } + else + { + myDlg->objectWg( SMESHGUI_MeshDlg::Geom, SMESHGUI_MeshDlg::Btn )->hide(); + } myDlg->updateGeometry(); myDlg->adjustSize(); readMesh(); @@ -1877,9 +1889,9 @@ bool SMESHGUI_MeshOp::createMesh( QString& theMess, QStringList& theEntryList ) //================================================================================ /*! * \brief Creates sub-mesh - * \param theMess - Output parameter intended for returning error message - * \param theEntryList - List of entries of published objects - * \retval bool - TRUE if sub-mesh is created, FALSE otherwise + * \param theMess - Output parameter intended for returning error message + * \param theEntryList - List of entries of published objects + * \retval bool - TRUE if sub-mesh is created, FALSE otherwise * * Creates sub-mesh */ @@ -1893,11 +1905,16 @@ bool SMESHGUI_MeshOp::createSubMesh( QString& theMess, QStringList& theEntryList return false; // get mesh object - QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh ); - _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toUtf8().data() ); SMESH::SMESH_Mesh_var aMeshVar = - SMESH::SMESH_Mesh::_narrow( _CAST( SObject,pMesh )->GetObject() ); - if (aMeshVar->_is_nil()) + SMESH::EntryToInterface( myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh )); + if ( aMeshVar->_is_nil() && myIsInvalidSubMesh ) + { + SMESH::SMESH_subMesh_var aSMVar = + SMESH::EntryToInterface( myDlg->selectedObject( SMESHGUI_MeshDlg::Obj )); + if ( !aSMVar->_is_nil() ) + aMeshVar = aSMVar->GetMesh(); + } + if ( aMeshVar->_is_nil() ) return false; // GEOM shape of the main mesh @@ -1971,8 +1988,14 @@ bool SMESHGUI_MeshOp::createSubMesh( QString& theMess, QStringList& theEntryList SUIT_OverrideCursor aWaitCursor; + QString aNameOrID = aName; + if ( myIsInvalidSubMesh ) + // pass a sub-mesh entry to mesh->GetSubMesh() to replace the invalid sub-mesh + // by a valid one in an existing SO + aNameOrID = myDlg->selectedObject(SMESHGUI_MeshDlg::Obj); + // create sub-mesh - SMESH::SMESH_subMesh_var aSubMeshVar = aMeshVar->GetSubMesh( aGeomVar, aName.toUtf8().data() ); + SMESH::SMESH_subMesh_var aSubMeshVar = aMeshVar->GetSubMesh( aGeomVar, aNameOrID.toUtf8().data() ); _PTR(SObject) aSubMeshSO = SMESH::FindSObject( aSubMeshVar.in() ); if ( aSubMeshSO ) { SMESH::SetName( aSubMeshSO, aName.toUtf8().data() ); @@ -2249,10 +2272,13 @@ void SMESHGUI_MeshOp::readMesh() myHasConcurrentSubBefore = checkSubMeshConcurrency( aMeshVar, aSubMeshVar ); } - // Get name of geometry object - CORBA::String_var name = SMESH::GetGeomName( pObj ); - if ( name.in() ) - myDlg->setObjectText( SMESHGUI_MeshDlg::Geom, name.in() ); + if ( !myIsInvalidSubMesh ) + { + // Get name of geometry object + CORBA::String_var name = SMESH::GetGeomName( pObj ); + if ( name.in() ) + myDlg->setObjectText( SMESHGUI_MeshDlg::Geom, name.in() ); + } } // Get hypotheses and algorithms assigned to the mesh/sub-mesh diff --git a/src/SMESHGUI/SMESHGUI_MeshOp.h b/src/SMESHGUI/SMESHGUI_MeshOp.h index 8ba4f8c40..48879d0f0 100644 --- a/src/SMESHGUI/SMESHGUI_MeshOp.h +++ b/src/SMESHGUI/SMESHGUI_MeshOp.h @@ -153,8 +153,11 @@ private: SMESHGUI_ShapeByMeshOp* myShapeByMeshOp; bool myToCreate; bool myIsMesh; - bool myIsOnGeometry; //!< TRUE if edited mesh accotiated with geometrical object + bool myIsOnGeometry; //!< TRUE if edited mesh is based on geometry bool myHasConcurrentSubBefore; + bool myIsInvalidSubMesh; //!< "invalid sub-mesh" is edited + // The geometry of "invalid sub-mesh" is not a sub-shape of the main shape; + // it is created for the case where a valid sub-shape not found by CopyMeshWithGeom() TDim2Type2HypList myExistingHyps; //!< all hypothesis of SMESH module TDim2Type2HypList myObjHyps; //!< hypothesis assigned to the current diff --git a/src/SMESHGUI/SMESHGUI_Utils.cxx b/src/SMESHGUI/SMESHGUI_Utils.cxx index b8e679e67..5721e5301 100644 --- a/src/SMESHGUI/SMESHGUI_Utils.cxx +++ b/src/SMESHGUI/SMESHGUI_Utils.cxx @@ -226,6 +226,12 @@ namespace SMESH return app->orb()->string_to_object(theIOR.toLatin1().data()); } + CORBA::Object_var EntryToObject( const QString& theEntry ) + { + _PTR(SObject) anObj = getStudy()->FindObjectID( theEntry.toLatin1().data() ); + return SObjectToObject(anObj); + } + int GetNameOfSelectedIObjects(LightApp_SelectionMgr* theMgr, QString& theName) { if (!theMgr) diff --git a/src/SMESHGUI/SMESHGUI_Utils.h b/src/SMESHGUI/SMESHGUI_Utils.h index 6ff20e8a2..41d2e674e 100644 --- a/src/SMESHGUI/SMESHGUI_Utils.h +++ b/src/SMESHGUI/SMESHGUI_Utils.h @@ -152,6 +152,18 @@ SMESHGUI_EXPORT return TInterface::_nil(); } +SMESHGUI_EXPORT + CORBA::Object_var EntryToObject( const QString& ); + + template typename TInterface::_var_type + EntryToInterface( const QString& theEntry ) + { + CORBA::Object_var anObj = EntryToObject( theEntry ); + if ( !CORBA::is_nil( anObj ) ) + return TInterface::_narrow( anObj ); + return TInterface::_nil(); + } + SMESHGUI_EXPORT int GetNameOfSelectedIObjects( LightApp_SelectionMgr*, QString& ); diff --git a/src/SMESHGUI/SMESH_images.ts b/src/SMESHGUI/SMESH_images.ts index 629c0d107..9605001fb 100644 --- a/src/SMESHGUI/SMESH_images.ts +++ b/src/SMESHGUI/SMESH_images.ts @@ -35,6 +35,10 @@ ICON_COPY_MESH copy_mesh.png + + ICON_COPY_MESH_WG + copy_mesh_with_geom.png + ICON_COMPUTE mesh_compute.png diff --git a/src/SMESHGUI/SMESH_msg_en.ts b/src/SMESHGUI/SMESH_msg_en.ts index 75d649a72..bd20246ad 100644 --- a/src/SMESHGUI/SMESH_msg_en.ts +++ b/src/SMESHGUI/SMESH_msg_en.ts @@ -1938,6 +1938,14 @@ add the exported data to its contents? SMESH_HYPOTHESES Hypotheses + + SMESH_HYPOTHESIS + Hypothesis + + + SMESH_ALGORITHM + Algorithm + SMESH_HYP_1 Algorithm misses a hypothesis @@ -8070,6 +8078,25 @@ as they are of improper type: NEW_NAME New Mesh Name + + NEW_GEOM + New Geometry + + + REUSE_HYPOTHESES + Reuse Hypotheses + + + COPY_ELEMENTS + Copy Mesh Elements + + + SUBSHAPES_NOT_FOUND_MSG + +Some sub-shapes not found in the new geometry. They are listed +below along with dependent mesh objects that are marked with +with red in the Object Browser. + SMESHGUI_MeasureDlg diff --git a/src/SMESH_I/SMESH_2smeshpy.cxx b/src/SMESH_I/SMESH_2smeshpy.cxx index 6c1329704..cef6517ce 100644 --- a/src/SMESH_I/SMESH_2smeshpy.cxx +++ b/src/SMESH_I/SMESH_2smeshpy.cxx @@ -1006,10 +1006,10 @@ void _pyGen::Process( const Handle(_pyCommand)& theCommand ) AddObject( mesh ); return; } - if( method == "CreateMeshesFromMED" || - method == "CreateMeshesFromSAUV"|| - method == "CreateMeshesFromCGNS" || - method == "CreateMeshesFromGMF" ) // command result is ( [mesh1,mesh2], status ) + if ( method == "CreateMeshesFromMED" || + method == "CreateMeshesFromSAUV"|| + method == "CreateMeshesFromCGNS" || + method == "CreateMeshesFromGMF" ) // command result is ( [mesh1,mesh2], status ) { std::list< _pyID > meshIDs = theCommand->GetStudyEntries( theCommand->GetResultValue() ); std::list< _pyID >::iterator meshID = meshIDs.begin(); @@ -1027,6 +1027,12 @@ void _pyGen::Process( const Handle(_pyCommand)& theCommand ) theCommand->SetArg( 1, file ); } } + if ( method == "CopyMeshWithGeom" ) + { + std::list< _pyID > entries = theCommand->GetStudyEntries( theCommand->GetResultValue() ); + Handle(_pyMesh) mesh = new _pyMesh( theCommand, entries.front() ); + AddObject( mesh ); + } // CreateHypothesis() if ( method == "CreateHypothesis" ) diff --git a/src/SMESH_I/SMESH_Algo_i.cxx b/src/SMESH_I/SMESH_Algo_i.cxx index c878fe37b..1b66bb29f 100644 --- a/src/SMESH_I/SMESH_Algo_i.cxx +++ b/src/SMESH_I/SMESH_Algo_i.cxx @@ -81,3 +81,27 @@ SMESH::ListOfHypothesisName* SMESH_Algo_i::GetCompatibleHypothesis() } return listOfHypothesis._retn(); } + +//================================================================================ +/*! + * Return geometry this hypothesis depends on. Return false if there is no geometry parameter + */ +//================================================================================ + +bool SMESH_Algo_i::getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const +{ + return false; +} + +//================================================================================ +/*! + * \brief Set new geometry instead of that returned by getObjectsDependOn() + */ +//================================================================================ + +bool SMESH_Algo_i::setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) +{ + return true; +} diff --git a/src/SMESH_I/SMESH_Algo_i.hxx b/src/SMESH_I/SMESH_Algo_i.hxx index 0d75eb5c2..9d4f6bf56 100644 --- a/src/SMESH_I/SMESH_Algo_i.hxx +++ b/src/SMESH_I/SMESH_Algo_i.hxx @@ -53,6 +53,15 @@ public: // Gets list of compatible hypotheses SMESH::ListOfHypothesisName* GetCompatibleHypothesis(); + + + // Return geometry this hypothesis depends on. Return false if there is no geometry parameter + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const; + + // Set new geometry instead of that returned by getObjectsDependOn() + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ); }; #endif diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index 75c9d2184..cd9c86098 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -103,6 +103,9 @@ #include "SMESH_PreMeshInfo.hxx" #include "SMESH_PythonDump.hxx" #include "SMESH_ControlsDef.hxx" + +// to pass CORBA exception through SMESH_TRY +#define SMY_OWN_CATCH catch( SALOME::SALOME_Exception& se ) { throw se; } #include "SMESH_TryCatch.hxx" // to include after OCC headers! #include CORBA_SERVER_HEADER(SMESH_Group) @@ -110,6 +113,7 @@ #include CORBA_SERVER_HEADER(SMESH_MeshEditor) +#include #include #include @@ -138,6 +142,7 @@ #include #include #include +#include using namespace std; using SMESH::TPythonDump; @@ -440,17 +445,17 @@ GenericHypothesisCreator_i* SMESH_Gen_i::getHypothesisCreator(const char* theHyp // load plugin library if(MYDEBUG) MESSAGE("Loading server meshers plugin library ..."); #ifdef WIN32 - #ifdef UNICODE - const wchar_t* path = Kernel_Utils::decode_s(aPlatformLibName); - #else - const char* path = aPlatformLibName.c_str(); - #endif +#ifdef UNICODE + const wchar_t* path = Kernel_Utils::decode_s(aPlatformLibName); +#else + const char* path = aPlatformLibName.c_str(); +#endif #else - const char* path = aPlatformLibName.c_str(); + const char* path = aPlatformLibName.c_str(); #endif LibHandle libHandle = LoadLib( path ); #if defined(WIN32) && defined(UNICODE) - delete path; + delete path; #endif if (!libHandle) { @@ -1938,7 +1943,7 @@ CORBA::Boolean SMESH_Gen_i::Compute( SMESH::SMESH_Mesh_ptr theMesh, try { // get mesh servant - SMESH_Mesh_i* meshServant = dynamic_cast( GetServant( theMesh ).in() ); + SMESH_Mesh_i* meshServant = SMESH::DownCast( theMesh ); ASSERT( meshServant ); if ( meshServant ) { meshServant->Load(); @@ -1960,6 +1965,7 @@ CORBA::Boolean SMESH_Gen_i::Compute( SMESH::SMESH_Mesh_ptr theMesh, meshServant->CreateGroupServants(); // algos can create groups (issue 0020918) myLocMesh.GetMeshDS()->Modified(); UpdateIcons( theMesh ); + HighLightInvalid( theMesh, /*isInvalid=*/!ok ); return ok; } } @@ -2724,10 +2730,12 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CopyMesh(SMESH::SMESH_IDSource_ptr meshPart, const char* meshName, CORBA::Boolean toCopyGroups, CORBA::Boolean toKeepIDs) + throw ( SALOME::SALOME_Exception ) { Unexpect aCatch(SALOME_SalomeException); TPythonDump* pyDump = new TPythonDump; // prevent dump from CreateMesh() + std::unique_ptr pyDumpDeleter( pyDump ); // 1. Get source mesh @@ -2930,7 +2938,7 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CopyMesh(SMESH::SMESH_IDSource_ptr meshPart, << toCopyGroups << ", " << toKeepIDs << ")"; - delete pyDump; pyDump = 0; // allow dump in GetGroups() + pyDumpDeleter.reset(); // allow dump in GetGroups() if ( nbNewGroups > 0 ) // dump created groups SMESH::ListOfGroups_var groups = newMesh->GetGroups(); @@ -2938,6 +2946,868 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CopyMesh(SMESH::SMESH_IDSource_ptr meshPart, return newMesh._retn(); } + +namespace // utils for CopyMeshWithGeom() +{ + typedef std::map< std::string, std::string > TStr2StrMap; + typedef std::map< std::string, std::set< std::string > > TStr2StrSetMap; + + //================================================================================ + /*! + * \brief Return a new sub-shape corresponding to an old one + */ + //================================================================================ + + struct ShapeMapper + { + SMESH_Mesh_i* mySrcMesh_i; + SMESH_Mesh_i* myNewMesh_i; + SMESH_Gen_i* myGen_i; + bool myToPublish; + bool myIsSameGeom; + + TStr2StrMap myOld2NewEntryMap; // map of study entries + + bool myGIPMapDone; + GEOM::ListOfListOfLong_var myGIPMap; // filled by GetInPlaceMap() + + // not directly relating to shape search + TStr2StrSetMap myInvalidMap; // blame shape -> invalid objects + + //================================================================================ + /*! + * \brief Constructor + */ + ShapeMapper( SMESH_Mesh_i* srcMesh_i, + SMESH_Mesh_i* newMesh_i, + SMESH_Gen_i* smeshGen_i ) + : mySrcMesh_i( srcMesh_i ), + myNewMesh_i( newMesh_i ), + myGen_i ( smeshGen_i ), + myToPublish( smeshGen_i->IsEnablePublish() ), + myGIPMapDone( false ) + { + // retrieve from the study shape mapping made thanks to + // "Set presentation parameters and sub-shapes from arguments" option + + GEOM::GEOM_Object_var mainShapeNew = myNewMesh_i->GetShapeToMesh(); + GEOM::GEOM_Object_var mainShapeOld = mySrcMesh_i->GetShapeToMesh(); + SALOMEDS::SObject_wrap oldSO = myGen_i->ObjectToSObject( mainShapeOld ); + SALOMEDS::SObject_wrap newSO = myGen_i->ObjectToSObject( mainShapeNew ); + if ( newSO->_is_nil() ) + { + myToPublish = false; + return; + } + if (( myIsSameGeom = mainShapeNew->_is_equivalent( mainShapeOld ))) + return; + CORBA::String_var oldEntry = oldSO->GetID(); + CORBA::String_var newEntry = newSO->GetID(); + myOld2NewEntryMap.insert( std::make_pair( std::string( oldEntry.in() ), + std::string( newEntry.in() ))); + + SALOMEDS::Study_var study = myGen_i->getStudyServant(); + GEOM::GEOM_Gen_var geomGen = myGen_i->GetGeomEngine(); + GEOM::GEOM_IShapesOperations_wrap op = geomGen->GetIShapesOperations(); + GEOM::ListOfGO_var subShapes = op->GetExistingSubObjects( mainShapeNew, + /*groupsOnly=*/false ); + for ( CORBA::ULong i = 0; i < subShapes->length(); ++i ) + { + newSO = myGen_i->ObjectToSObject( subShapes[ i ]); + SALOMEDS::ChildIterator_wrap anIter = study->NewChildIterator( newSO ); + for ( ; anIter->More(); anIter->Next() ) + { + SALOMEDS::SObject_wrap so = anIter->Value(); + if ( so->ReferencedObject( oldSO.inout() )) + { + oldEntry = oldSO->GetID(); + newEntry = newSO->GetID(); + myOld2NewEntryMap.insert( std::make_pair( std::string( oldEntry.in() ), + std::string( newEntry.in() ))); + } + } + } + } + + //================================================================================ + /*! + * \brief Find a new sub-shape corresponding to an old one + */ + GEOM::GEOM_Object_ptr FindNew( GEOM::GEOM_Object_ptr oldShape ) + { + if ( myIsSameGeom ) + return GEOM::GEOM_Object::_duplicate( oldShape ); + + GEOM::GEOM_Object_var newShape; + + if ( CORBA::is_nil( oldShape )) + return newShape._retn(); + + if ( !isChildOfOld( oldShape )) + return GEOM::GEOM_Object::_duplicate( oldShape ); // shape independent of the old shape + + GEOM::GEOM_Object_var mainShapeNew = myNewMesh_i->GetShapeToMesh(); + GEOM::GEOM_Gen_var geomGen = myGen_i->GetGeomEngine(); + + // try to find by entry + if ( myToPublish ) + { + CORBA::String_var oldEntry = oldShape->GetStudyEntry(); + TStr2StrMap::iterator o2nID = myOld2NewEntryMap.find( oldEntry.in() ); + if ( o2nID != myOld2NewEntryMap.end() ) + { + newShape = getShapeByEntry( o2nID->second ); + } + } + + if ( newShape->_is_nil() ) + { + // try to construct a new sub-shape using myGIPMap + buildGIPMap(); + std::vector< int > newIndices; + GEOM::ListOfLong_var oldIndices = oldShape->GetSubShapeIndices(); + for ( CORBA::ULong i = 0; i < oldIndices->length(); ++i ) + { + findNewIDs( oldIndices[i], newIndices ); + } + if ( !newIndices.empty() ) + { + try + { + if ( newIndices.size() > 1 || oldShape->GetType() == GEOM_GROUP ) + { + int groupType = getShapeType( myNewMesh_i, newIndices[0] ); + + GEOM::GEOM_IGroupOperations_wrap grOp = geomGen->GetIGroupOperations(); + newShape = grOp->CreateGroup( mainShapeNew, groupType ); + + GEOM::ListOfLong_var newIndicesList = new GEOM::ListOfLong(); + newIndicesList->length( newIndices.size() ); + for ( size_t i = 0; i < newIndices.size(); ++i ) + newIndicesList[ i ] = newIndices[ i ]; + grOp->UnionIDs( newShape, newIndicesList ); + } + else + { + GEOM::GEOM_IShapesOperations_wrap shOp = geomGen->GetIShapesOperations(); + newShape = shOp->GetSubShape( mainShapeNew, newIndices[0] ); + } + } + catch (...) + { + } + } + } + + if ( !newShape->_is_nil() && myToPublish ) + { + CORBA::String_var oldEntry, newEntry = newShape->GetStudyEntry(); + if ( !newEntry.in() || !newEntry.in()[0] ) + { + CORBA::String_var name = oldShape->GetName(); + SALOMEDS::SObject_wrap so = geomGen->AddInStudy( newShape, name, mainShapeNew ); + newEntry = newShape->GetStudyEntry(); + oldEntry = oldShape->GetStudyEntry(); + myOld2NewEntryMap.insert( std::make_pair( std::string( oldEntry.in() ), + std::string( newEntry.in() ))); + } + } + + return newShape._retn(); + } + + //================================================================================ + /*! + * \brief Return a study entry of a new shape by study entry of the old one + */ + std::string FindNew( const std::string & oldEntry ) + { + if ( myIsSameGeom ) + return oldEntry; + + TStr2StrMap::iterator o2nID = myOld2NewEntryMap.find( oldEntry ); + if ( o2nID != myOld2NewEntryMap.end() ) + return o2nID->second; + + GEOM::GEOM_Object_var oldShape = getShapeByEntry( oldEntry ); + if ( oldShape->_is_nil() || !isChildOfOld( oldShape )) + return oldEntry; + + GEOM::GEOM_Object_ptr newShape = FindNew( oldShape ); + if ( newShape->_is_nil() ) + return std::string(); + + CORBA::String_var newEntry = newShape->GetStudyEntry(); + return newEntry.in(); + } + + //================================================================================ + /*! + * \brief Return a sub-shape ID of a new shape by a sub-shape ID of the old one. + * Return zero if not found or there are more than one new ID + */ + int FindNew( int oldID ) + { + if ( myIsSameGeom ) + return oldID; + + buildGIPMap(); + + int newID = 0; + + if ( 0 < oldID && oldID < (int)myGIPMap->length() ) + { + if ( myGIPMap[ oldID ].length() == 1 ) + newID = myGIPMap[ oldID ][ 0 ]; + } + return newID; + } + + //================================================================================ + /*! + * \brief Return a sub-shape ID of a new shape by an old sub-mesh. + * Return zero if the old shape is not kept as is in the new shape. + */ + int FindNewNotChanged( SMESH_subMesh* oldSM ) + { + if ( myIsSameGeom ) + return oldSM->GetId(); + + int newID = FindNew( oldSM->GetId() ); + if ( !newID ) + return 0; + + SMESH_subMesh* newSM = myNewMesh_i->GetImpl().GetSubMeshContaining( newID ); + if ( !newSM ) + return 0; + + // consider a sub-shape as not changed if all its sub-shapes are mapped into + // one new sub-shape of the same type. + + if ( oldSM->DependsOn().size() != + newSM->DependsOn().size() ) + return 0; + + SMESH_subMeshIteratorPtr srcSMIt = oldSM->getDependsOnIterator( /*includeSelf=*/true ); + while ( srcSMIt->more() ) + { + oldSM = srcSMIt->next(); + int newSubID = FindNew( oldSM->GetId() ); + if ( getShapeType( myNewMesh_i, newSubID ) != + getShapeType( mySrcMesh_i, oldSM->GetId() )) + return 0; + } + return newID; + } + + //================================================================================ + /*! + * \brief Return shape by study entry + */ + GEOM::GEOM_Object_ptr getShapeByEntry( const std::string & entry ) + { + GEOM::GEOM_Object_var shape; + SALOMEDS::SObject_wrap so = myGen_i->getStudyServant()->FindObjectID( entry.c_str() ); + if ( !so->_is_nil() ) + { + CORBA::Object_var obj = so->GetObject(); + shape = GEOM::GEOM_Object::_narrow( obj ); + } + return shape._retn(); + } + + //================================================================================ + /*! + * \brief Fill myGIPMap by calling GetInPlaceMap() + */ + void buildGIPMap() + { + if ( !myGIPMapDone ) + { + myGIPMapDone = true; + + GEOM::GEOM_Object_var mainShapeNew = myNewMesh_i->GetShapeToMesh(); + GEOM::GEOM_Object_var mainShapeOld = mySrcMesh_i->GetShapeToMesh(); + GEOM::GEOM_Gen_var geomGen = myGen_i->GetGeomEngine(); + GEOM::GEOM_IShapesOperations_wrap op = geomGen->GetIShapesOperations(); + try + { + myGIPMap = op->GetInPlaceMap( mainShapeNew, mainShapeOld ); + } + catch( ... ) + { + myGIPMap = new GEOM::ListOfListOfLong(); + } + } + } + + //================================================================================ + /*! + * \brief Find a new sub-shape indices by an old one in myGIPMap. Return + * number of found IDs + */ + int findNewIDs( int oldID, std::vector< int >& newIDs ) + { + size_t prevNbIDs = newIDs.size(); + + if ( 0 < oldID && oldID < (int) myGIPMap->length() ) + { + for ( CORBA::ULong i = 0; i < myGIPMap[ oldID ].length(); ++i ) + newIDs.push_back( myGIPMap[ oldID ][ i ]); + } + return newIDs.size() - prevNbIDs; + } + + //================================================================================ + /*! + * \brief Check if an object relates to the old shape + */ + bool isChildOfOld( GEOM::GEOM_Object_ptr oldShape ) + { + if ( CORBA::is_nil( oldShape )) + return false; + GEOM::GEOM_Object_var mainShapeOld1 = mySrcMesh_i->GetShapeToMesh(); + GEOM::GEOM_Object_var mainShapeOld2 = oldShape->GetMainShape(); + return ( mainShapeOld1->_is_equivalent( mainShapeOld2 ) || + mainShapeOld1->_is_equivalent( oldShape )); + } + + //================================================================================ + /*! + * \brief Return shape type by shape ID + */ + TopAbs_ShapeEnum getShapeType( SMESH_Mesh_i* mesh_i, int shapeID ) + { + SMESHDS_Mesh* meshDS = mesh_i->GetImpl().GetMeshDS(); + const TopoDS_Shape& shape = meshDS->IndexToShape( shapeID ); + return shape.IsNull() ? TopAbs_SHAPE : shape.ShapeType(); + } + + //================================================================================ + /*! + * \brief Store a source sub-shape for which a counterpart not found and + * a smesh object invalid due to that + */ + void AddInvalid( GEOM::GEOM_Object_var srcShape, + SALOMEDS::SObject_wrap smeshSO ) + { + CORBA::String_var geomEntry = srcShape->GetStudyEntry(); + if ( geomEntry.in()[0] && !smeshSO->_is_nil() ) + { + CORBA::String_var smeshEntry = smeshSO->GetID(); + myInvalidMap[ geomEntry.in() ].insert( smeshEntry.in() ); + } + } + + //================================================================================ + /*! + * \brief Store a source sub-shape for which a counterpart not found and + * a smesh object invalid due to that + */ + void AddInvalid( std::string geomEntry, + SALOMEDS::SObject_wrap smeshSO ) + { + if ( !geomEntry.empty() ) + { + CORBA::String_var smeshEntry = smeshSO->GetID(); + myInvalidMap[ geomEntry ].insert( smeshEntry.in() ); + } + } + + //================================================================================ + /*! + * \brief Store a source sub-shape for which a counterpart not found and + * a smesh object invalid due to that + */ + void AddInvalid( int oldGeomID, + SALOMEDS::SObject_wrap smeshSO ) + { + int shapeType = getShapeType( mySrcMesh_i, oldGeomID ); + if ( shapeType < 0 || shapeType > TopAbs_SHAPE ) + return; + + const char* typeName[] = { "COMPOUND","COMPSOLID","SOLID","SHELL", + "FACE","WIRE","EDGE","VERTEX","SHAPE" }; + + SMESH_Comment geomName( typeName[ shapeType ]); + geomName << " #" << oldGeomID; + + CORBA::String_var smeshEntry = smeshSO->GetID(); + myInvalidMap[ geomName ].insert( smeshEntry.in() ); + } + + //================================================================================ + /*! + * \brief Return entries of a source sub-shape for which a counterpart not found and + * of smesh objects invalid due to that + */ + void GetInvalid( SMESH::string_array_out & theInvalidEntries, + std::vector< SALOMEDS::SObject_wrap > & theInvalidMeshSObjects) + { + int nbSO = 0; + TStr2StrSetMap::iterator entry2entrySet = myInvalidMap.begin(); + for ( ; entry2entrySet != myInvalidMap.end(); ++entry2entrySet ) + { + nbSO += 1 + entry2entrySet->second.size(); + } + int iSO = theInvalidMeshSObjects.size(), iEntry = 0; + theInvalidEntries->length ( nbSO ); + theInvalidMeshSObjects.resize( theInvalidMeshSObjects.size() + nbSO - myInvalidMap.size() ); + + entry2entrySet = myInvalidMap.begin(); + for ( ; entry2entrySet != myInvalidMap.end(); ++entry2entrySet ) + { + theInvalidEntries[ iEntry++ ] = entry2entrySet->first.c_str(); + + std::set< std::string > & entrySet = entry2entrySet->second; + std::set< std::string >::iterator entry = entrySet.begin(); + for ( ; entry != entrySet.end(); ++entry ) + { + theInvalidEntries[ iEntry++ ] = entry->c_str(); + + SALOMEDS::SObject_wrap so = myGen_i->getStudyServant()->FindObjectID( entry->c_str() ); + if ( !so->_is_nil() ) + theInvalidMeshSObjects[ iSO++ ] = so; + } + } + } + + }; // struct ShapeMapper + + //================================================================================ + /*! + * \brief Append an item to a CORBA sequence + */ + template < class CORBA_seq, class ITEM > + void append( CORBA_seq& seq, ITEM item ) + { + if ( !CORBA::is_nil( item )) + { + seq->length( 1 + seq->length() ); + seq[ seq->length() - 1 ] = item; + } + } +} + +//================================================================================ +/*! + * \brief Create a mesh by copying definitions of another mesh to a given geometry + * \param [in] sourceMesh - a mesh to copy + * \param [in] newGeometry - a new geometry + * \param [in] toCopyGroups - to create groups in the new mesh + * \param [in] toReuseHypotheses - if True, existing hypothesis will be used by the new mesh, + * otherwise new hypotheses with the same parameters will be created for the new mesh. + * \param [in] toCopyElements - to copy mesh elements of same sub-shapes of the two geometries + * \param [out] newMesh - return a new mesh + * \param [out] newGroups - return new groups + * \param [out] newSubmeshes - return new sub-meshes + * \param [out] newHypotheses - return new algorithms and hypotheses + * \param [out] invalidEntries - return study entries of objects whose + * counterparts are not found in the newGeometry, followed by entries + * of mesh sub-objects that are invalid because they depend on a not found + * preceeding sub-shape + * \return CORBA::Boolean - is a success + */ +//================================================================================ + +CORBA::Boolean SMESH_Gen_i::CopyMeshWithGeom( SMESH::SMESH_Mesh_ptr theSourceMesh, + GEOM::GEOM_Object_ptr theNewGeometry, + const char* theMeshName, + CORBA::Boolean theToCopyGroups, + CORBA::Boolean theToReuseHypotheses, + CORBA::Boolean theToCopyElements, + SMESH::SMESH_Mesh_out theNewMesh, + SMESH::ListOfGroups_out theNewGroups, + SMESH::submesh_array_out theNewSubmeshes, + SMESH::ListOfHypothesis_out theNewHypotheses, + SMESH::string_array_out theInvalidEntries) +throw ( SALOME::SALOME_Exception ) +{ + if ( CORBA::is_nil( theSourceMesh ) || + CORBA::is_nil( theNewGeometry )) + THROW_SALOME_CORBA_EXCEPTION( "NULL arguments", SALOME::BAD_PARAM ); + + if ( !theSourceMesh->HasShapeToMesh() ) + THROW_SALOME_CORBA_EXCEPTION( "Source mesh not on geometry", SALOME::BAD_PARAM ); + + bool ok = true; + SMESH_TRY; + + TPythonDump pyDump; // prevent dump from CreateMesh() + + theNewMesh = CreateMesh( theNewGeometry ); + theNewGroups = new SMESH::ListOfGroups(); + theNewSubmeshes = new SMESH::submesh_array(); + theNewHypotheses = new SMESH::ListOfHypothesis(); + theInvalidEntries = new SMESH::string_array(); + + std::vector< SALOMEDS::SObject_wrap > invalidSObjects; + + GEOM::GEOM_Object_var srcGeom = theSourceMesh->GetShapeToMesh(); + GEOM::GEOM_Object_var geom, newGeom; + SALOMEDS::SObject_wrap so; + + SMESH_Mesh_i* srcMesh_i = SMESH::DownCast( theSourceMesh ); + SMESH_Mesh_i* newMesh_i = SMESH::DownCast( theNewMesh ); + + ShapeMapper shapeMapper( srcMesh_i, newMesh_i, this ); + + // treat hypotheses of mesh and sub-meshes + SMESH::submesh_array_var smList = theSourceMesh->GetSubMeshes(); + for ( CORBA::ULong iSM = 0; iSM <= smList->length(); ++iSM ) + { + bool isSubMesh = ( iSM < smList->length() ); + if ( isSubMesh ) + { + // create a new sub-mesh + SMESH::SMESH_subMesh_var newSM; + geom = smList[iSM]->GetSubShape(); + so = ObjectToSObject( smList[iSM] ); + CORBA::String_var name; + if ( !so->_is_nil() ) + name = so->GetName(); + newGeom = shapeMapper.FindNew( geom ); + if ( newGeom->_is_nil() ) + { + newSM = createInvalidSubMesh( theNewMesh, geom, name.in() ); + shapeMapper.AddInvalid( geom, ObjectToSObject( newSM )); + ok = false; + } + else + { + newSM = theNewMesh->GetSubMesh( newGeom, name.in() ); + } + append( theNewSubmeshes, newSM ); + + if ( newGeom->_is_nil() ) + continue; // don't assign hypotheses + } + else + { + newGeom = GEOM::GEOM_Object::_duplicate( theNewGeometry ); + geom = srcGeom; + so = ObjectToSObject( theNewMesh ); + SetName( so, theMeshName, "Mesh" ); + } + + // assign hypotheses + SMESH::ListOfHypothesis_var hypList = theSourceMesh->GetHypothesisList( geom ); + for ( CORBA::ULong iHyp = 0; iHyp < hypList->length(); ++iHyp ) + { + SMESH::SMESH_Hypothesis_var hyp = hypList[ iHyp ]; + SMESH_Hypothesis_i* hyp_i = SMESH::DownCast< SMESH_Hypothesis_i* >( hyp ); + + // get geometry hyp depends on + std::vector< std::string > entryArray; + std::vector< int > subIDArray; + bool dependsOnGeom = hyp_i->getObjectsDependOn( entryArray, subIDArray ); + + if ( !theToReuseHypotheses || dependsOnGeom ) + { + // create a new hypothesis + CORBA::String_var type = hyp->GetName(); + CORBA::String_var lib = hyp->GetLibName(); + CORBA::String_var data = hyp_i->SaveTo(); + if ( data.in()[0] ) + { + hyp = CreateHypothesis( type, lib ); + hyp_i = SMESH::DownCast< SMESH_Hypothesis_i* >( hyp ); + hyp_i->LoadFrom( data.in() ); + append( theNewHypotheses, hyp ); + } + } + + // update geometry hyp depends on + if ( dependsOnGeom ) + { + for ( size_t iGeo = 0; iGeo < entryArray.size(); ++iGeo ) + { + if ( !entryArray[ iGeo ].empty() ) + { + std::string newEntry = shapeMapper.FindNew( entryArray[ iGeo ]); + if ( newEntry.empty() ) + { + ok = false; + shapeMapper.AddInvalid( entryArray[ iGeo ], ObjectToSObject( hyp )); + shapeMapper.AddInvalid( entryArray[ iGeo ], so ); // sub-mesh + } + entryArray[ iGeo ] = newEntry; + } + } + for ( size_t iGeo = 0; iGeo < subIDArray.size(); ++iGeo ) + { + if ( subIDArray[ iGeo ] > 0 ) + { + int newID = shapeMapper.FindNew( subIDArray[ iGeo ]); + if ( newID < 1 ) + { + ok = false; + shapeMapper.AddInvalid( subIDArray[ iGeo ], ObjectToSObject( hyp )); + shapeMapper.AddInvalid( subIDArray[ iGeo ], so ); // sub-mesh + } + subIDArray[ iGeo ] = newID; + } + } + if ( !hyp_i->setObjectsDependOn( entryArray, subIDArray )) + ok = false; + } + + CORBA::String_var errorText; + theNewMesh->AddHypothesis( newGeom, hyp, errorText.out() ); + if ( errorText.in()[0] ) + ok = false; + + } // loop on hypotheses + } // loop on sub-meshes and mesh + + + // copy mesh elements, keeping IDs + if ( theToCopyElements && theSourceMesh->NbNodes() > 0 ) + { + SMESHDS_Mesh* newMeshDS = newMesh_i->GetImpl().GetMeshDS(); + ::SMESH_MeshEditor editor( &newMesh_i->GetImpl() ); + ::SMESH_MeshEditor::ElemFeatures elemData; + + SMESH_subMesh* srcMainSM = srcMesh_i->GetImpl().GetSubMeshContaining( 1 ); + SMESH_subMeshIteratorPtr srcSMIt = srcMainSM->getDependsOnIterator( /*includeSelf=*/true, + /*vertexLast=*/false); + while ( srcSMIt->more() ) + { + SMESH_subMesh* srcSM = srcSMIt->next(); + if ( srcSM->IsEmpty() ) + continue; // not yet computed + int newID = shapeMapper.FindNewNotChanged( srcSM ); + if ( newID < 1 ) + continue; + + SMESHDS_SubMesh* srcSMDS = srcSM->GetSubMeshDS(); + SMDS_NodeIteratorPtr nIt = srcSMDS->GetNodes(); + while ( nIt->more() ) + { + SMESH_NodeXYZ node( nIt->next() ); + const SMDS_MeshNode* newNode = newMeshDS->AddNodeWithID( node.X(), node.Y(), node.Z(), + node->GetID() ); + const SMDS_PositionPtr pos = node->GetPosition(); + const double* uv = pos->GetParameters(); + switch ( pos->GetTypeOfPosition() ) + { + case SMDS_TOP_3DSPACE: newMeshDS->SetNodeInVolume( newNode, newID ); break; + case SMDS_TOP_FACE: newMeshDS->SetNodeOnFace ( newNode, newID, uv[0], uv[1] ); break; + case SMDS_TOP_EDGE: newMeshDS->SetNodeOnEdge ( newNode, newID, uv[0] ); break; + case SMDS_TOP_VERTEX: newMeshDS->SetNodeOnVertex( newNode, newID ); break; + default: ; + } + } + SMDS_ElemIteratorPtr eIt = srcSMDS->GetElements(); + while( eIt->more() ) + { + const SMDS_MeshElement* e = eIt->next(); + elemData.Init( e, /*basicOnly=*/false ); + elemData.SetID( e->GetID() ); + elemData.myNodes.resize( e->NbNodes() ); + SMDS_NodeIteratorPtr nnIt = e->nodeIterator(); + size_t iN; + for ( iN = 0; nnIt->more(); ++iN ) + { + const SMDS_MeshNode* srcNode = nnIt->next(); + elemData.myNodes[ iN ] = newMeshDS->FindNode( srcNode->GetID() ); + if ( !elemData.myNodes[ iN ]) + break; + } + if ( iN == elemData.myNodes.size() ) + if ( const SMDS_MeshElement * newElem = editor.AddElement( elemData.myNodes, elemData )) + newMeshDS->SetMeshElementOnShape( newElem, newID ); + } + if ( SMESH_subMesh* newSM = newMesh_i->GetImpl().GetSubMeshContaining( newID )) + newSM->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE ); + } + } + + + // treat groups + + TStr2StrMap old2newGroupMap; + + SALOME::GenericObj_wrap< SMESH::FilterManager > filterMgr = CreateFilterManager(); + + SMESH::ListOfGroups_var groups = theSourceMesh->GetGroups(); + CORBA::ULong nbGroups = groups->length(), nbAddedGroups = 0; + for ( CORBA::ULong i = 0; i < nbGroups + nbAddedGroups; ++i ) + { + SMESH::SMESH_Group_var stdlGroup = SMESH::SMESH_Group::_narrow ( groups[ i ]); + SMESH::SMESH_GroupOnGeom_var geomGroup = SMESH::SMESH_GroupOnGeom::_narrow ( groups[ i ]); + SMESH::SMESH_GroupOnFilter_var fltrGroup = SMESH::SMESH_GroupOnFilter::_narrow( groups[ i ]); + + CORBA::String_var name = groups[ i ]->GetName(); + SMESH::ElementType elemType = groups[ i ]->GetType(); + + SMESH::SMESH_GroupBase_var newGroup; + + if ( !stdlGroup->_is_nil() ) + { + if ( theToCopyElements ) + { + SMESH::long_array_var elemIDs = stdlGroup->GetIDs(); + stdlGroup = theNewMesh->CreateGroup( elemType, name ); + stdlGroup->Add( elemIDs ); + newGroup = SMESH::SMESH_GroupBase::_narrow( stdlGroup ); + } + } + else if ( !geomGroup->_is_nil() ) + { + GEOM::GEOM_Object_var geom = geomGroup->GetShape(); + GEOM::GEOM_Object_var newGeom = shapeMapper.FindNew( geom ); + if ( newGeom->_is_nil() ) + { + newGroup = theNewMesh->CreateGroup( elemType, name ); // just to notify the user + shapeMapper.AddInvalid( geom, ObjectToSObject( newGroup )); + ok = false; + } + else + { + newGroup = theNewMesh->CreateGroupFromGEOM( elemType, name, newGeom ); + } + } + else if ( !fltrGroup->_is_nil() ) + { + // replace geometry in a filter + SMESH::Filter_var filter = fltrGroup->GetFilter(); + SMESH::Filter::Criteria_var criteria; + filter->GetCriteria( criteria.out() ); + + bool isMissingGroup = false; + std::vector< std::string > badEntries; + + for ( CORBA::ULong iCr = 0; iCr < criteria->length(); ++iCr ) + { + const char* thresholdID = criteria[ iCr ].ThresholdID.in(); + switch ( criteria[ iCr ].Type ) + { + case SMESH::FT_BelongToMeshGroup: + { + SALOME::GenericObj_wrap< SMESH::BelongToMeshGroup > btgg = filterMgr->CreateBelongToMeshGroup(); + btgg->SetGroupID( thresholdID ); + SMESH::SMESH_GroupBase_ptr refGroup = btgg->GetGroup(); + SALOMEDS::SObject_wrap refGroupSO = ObjectToSObject( refGroup ); + if ( refGroupSO->_is_nil() ) + break; + CORBA::String_var refID = refGroupSO->GetID(); + TStr2StrMap::iterator o2nID = old2newGroupMap.find( refID.in() ); + if ( o2nID == old2newGroupMap.end() ) + { + isMissingGroup = true; // corresponding new group not yet created + break; + } + criteria[ iCr ].ThresholdID = o2nID->second.c_str(); + + if ( o2nID->second.empty() ) // new referred group is invalid + badEntries.push_back( refID.in() ); + break; + } + case SMESH::FT_BelongToGeom: + case SMESH::FT_BelongToPlane: + case SMESH::FT_BelongToCylinder: + case SMESH::FT_BelongToGenSurface: + case SMESH::FT_LyingOnGeom: + { + std::string newID = shapeMapper.FindNew( thresholdID ); + criteria[ iCr ].ThresholdID = newID.c_str(); + if ( newID.empty() ) + badEntries.push_back( thresholdID ); + break; + } + case SMESH::FT_ConnectedElements: + { + if ( thresholdID && thresholdID[0] ) + { + std::string newID = shapeMapper.FindNew( thresholdID ); + criteria[ iCr ].ThresholdID = newID.c_str(); + if ( newID.empty() ) + badEntries.push_back( thresholdID ); + } + break; + } + default:; + } + } // loop on criteria + + if ( isMissingGroup && i < nbGroups ) + { + // to treat the group again + append( groups, SMESH::SMESH_GroupBase::_duplicate( groups[ i ])); + ++nbAddedGroups; + continue; + } + SMESH::Filter_var newFilter = filterMgr->CreateFilter(); + newFilter->SetCriteria( criteria ); + + newGroup = theNewMesh->CreateGroupFromFilter( elemType, name, newFilter ); + newFilter->UnRegister(); + + SALOMEDS::SObject_wrap newSO = ObjectToSObject( newGroup ); + for ( size_t iEnt = 0; iEnt < badEntries.size(); ++iEnt ) + shapeMapper.AddInvalid( badEntries[ iEnt ], newSO ); + + if ( isMissingGroup ) // all groups treated but a referred groups still not found + { + invalidSObjects.push_back( ObjectToSObject( newGroup )); + ok = false; + } + if ( !badEntries.empty() ) + ok = false; + + } // treat a group on filter + + append( theNewGroups, newGroup ); + + // fill old2newGroupMap + SALOMEDS::SObject_wrap srcSO = ObjectToSObject( groups[i] ); + SALOMEDS::SObject_wrap newSO = ObjectToSObject( newGroup ); + if ( !srcSO->_is_nil() ) + { + CORBA::String_var srcID, newID; + srcID = srcSO->GetID(); + if ( !newSO->_is_nil() ) + newID = newSO->GetID(); + old2newGroupMap.insert( std::make_pair( std::string( srcID.in() ), + std::string( newID.in() ))); + } + + if ( newGroup->_is_nil() ) + ok = false; + + } // loop on groups + + // set mesh name + SALOMEDS::SObject_wrap soNew = ObjectToSObject( theNewMesh ); + SALOMEDS::SObject_wrap soOld = ObjectToSObject( theSourceMesh ); + CORBA::String_var oldName = soOld->GetName(); + SetName( soNew, oldName.in(), "Mesh" ); + + // mark invalid objects + shapeMapper.GetInvalid( theInvalidEntries, invalidSObjects ); + + for ( size_t i = 0; i < invalidSObjects.size(); ++i ) + highLightInvalid( invalidSObjects[i].in(), true ); + + pyDump << "ok, " + << theNewMesh << ", " + << theNewGroups << ", " + << *theNewSubmeshes.ptr() << ", " + << *theNewHypotheses.ptr() << ", " + << "invalidEntries = " << this << ".CopyMeshWithGeom( " + << theSourceMesh << ", " + << theNewGeometry << ", " + << "'" << theMeshName << "', " + << theToCopyGroups << ", " + << theToReuseHypotheses << ", " + << theToCopyElements << " )"; + + SMESH_CATCH( SMESH::throwCorbaException ); + + return ok; +} + //================================================================================ /*! * \brief Get version of MED format being used. diff --git a/src/SMESH_I/SMESH_Gen_i.hxx b/src/SMESH_I/SMESH_Gen_i.hxx index 21f55355e..1209ec7af 100644 --- a/src/SMESH_I/SMESH_Gen_i.hxx +++ b/src/SMESH_I/SMESH_Gen_i.hxx @@ -246,9 +246,24 @@ public: SMESH::SMESH_Mesh_ptr CopyMesh(SMESH::SMESH_IDSource_ptr meshPart, const char* meshName, CORBA::Boolean toCopyGroups, - CORBA::Boolean toKeepIDs); + CORBA::Boolean toKeepIDs) + throw ( SALOME::SALOME_Exception ); + + // Create a mesh by copying definitions of another mesh to a given geometry + CORBA::Boolean CopyMeshWithGeom( SMESH::SMESH_Mesh_ptr sourceMesh, + GEOM::GEOM_Object_ptr newGeometry, + const char* meshName, + CORBA::Boolean toCopyGroups, + CORBA::Boolean toReuseHypotheses, + CORBA::Boolean toCopyElements, + SMESH::SMESH_Mesh_out newMesh, + SMESH::ListOfGroups_out newGroups, + SMESH::submesh_array_out newSubmeshes, + SMESH::ListOfHypothesis_out newHypotheses, + SMESH::string_array_out invalidEntries) + throw ( SALOME::SALOME_Exception ); - // Compute mesh on a shape + // Compute mesh on a shape CORBA::Boolean Compute( SMESH::SMESH_Mesh_ptr theMesh, GEOM::GEOM_Object_ptr theShapeObject ) throw ( SALOME::SALOME_Exception ); @@ -504,6 +519,7 @@ public: GEOM::GEOM_Object_ptr theShapeObject, const char* theName = 0); void UpdateIcons(SMESH::SMESH_Mesh_ptr theMesh); + void HighLightInvalid(CORBA::Object_ptr theObject, bool isInvalid); bool AddHypothesisToShape(SMESH::SMESH_Mesh_ptr theMesh, GEOM::GEOM_Object_ptr theShapeObject, SMESH::SMESH_Hypothesis_ptr theHyp); @@ -608,6 +624,14 @@ private: SMESH::SMESH_Mesh_ptr createMesh() throw ( SALOME::SALOME_Exception ); + // Create a sub-mesh on a geometry that is not a sub-shape of the main shape + // for the case where a valid sub-shape not found by CopyMeshWithGeom() + SMESH::SMESH_subMesh_ptr createInvalidSubMesh( SMESH::SMESH_Mesh_ptr mesh, + GEOM::GEOM_Object_ptr strangerGeom, + const char* name ); + + void highLightInvalid( SALOMEDS::SObject_ptr theSObject, bool isInvalid ); + static void loadGeomData( SALOMEDS::SComponent_ptr theCompRoot ); SMESH::mesh_array* CreateMeshesFromMEDorSAUV( const char* theFileName, diff --git a/src/SMESH_I/SMESH_Gen_i_1.cxx b/src/SMESH_I/SMESH_Gen_i_1.cxx index 49e74979e..69a8f73b0 100644 --- a/src/SMESH_I/SMESH_Gen_i_1.cxx +++ b/src/SMESH_I/SMESH_Gen_i_1.cxx @@ -452,6 +452,9 @@ static void addReference (SALOMEDS::SObject_ptr theSObject, aStudyBuilder->Addreference( aReferenceSO, aToObjSO ); + // make the reference visible (invisible ref is created by createInvalidSubMesh()) + aStudyBuilder->RemoveAttribute( aReferenceSO, "AttributeDrawable" ); + // add reference to the use case tree // (to support tree representation customization and drag-n-drop) SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = aStudy->GetUseCaseBuilder(); @@ -689,6 +692,8 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishSubMesh (SMESH::SMESH_Mesh_ptr theM if ( theMesh->_is_nil() || theSubMesh->_is_nil() || theShapeObject->_is_nil() ) return SALOMEDS::SObject::_nil(); + std::string newName( theName ? theName : "" ); + SALOMEDS::SObject_wrap aSubMeshSO = ObjectToSObject( theSubMesh ); if ( aSubMeshSO->_is_nil() ) { @@ -740,15 +745,37 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishSubMesh (SMESH::SMESH_Mesh_ptr theM SetName( aRootSO, aRootName ); - // Add new submesh to corresponding sub-tree + // Add new sub-mesh to corresponding sub-tree + int tag = 0; // to use a new SObject + if ( theName && theName[0] == '0' ) + { + // theName can be an entry of an invalid sub-mesh which theSubMesh should replace + SALOMEDS::SObject_wrap aSObj = getStudyServant()->FindObjectID( theName ); + if ( aSObj ) + { + CORBA::String_var oldName = aSObj->GetName(); + newName = oldName.in(); + SALOMEDS::SObject_wrap aRootSO2 = aSObj->GetFather(); + if ( aRootSO->Tag() == aRootSO2->Tag() ) // same parent + tag = aSObj->Tag(); // to use the same SObject + else + { + CORBA::Object_var anObj = SObjectToObject( aSObj ); + SMESH::SMESH_subMesh_var sm = SMESH::SMESH_subMesh::_narrow( anObj ); + theMesh->RemoveSubMesh( sm ); + } + } + } SMESH::array_of_ElementType_var elemTypes = theSubMesh->GetTypes(); const int isEmpty = ( elemTypes->length() == 0 ); const char* pm[2] = { "ICON_SMESH_TREE_MESH", "ICON_SMESH_TREE_MESH_WARN" }; - aSubMeshSO = publish ( theSubMesh, aRootSO, 0, pm[isEmpty] ); + aSubMeshSO = publish ( theSubMesh, aRootSO, tag, pm[isEmpty] ); if ( aSubMeshSO->_is_nil() ) return aSubMeshSO._retn(); + + highLightInvalid( aSubMeshSO, false ); // now it is valid } - SetName( aSubMeshSO, theName, "SubMesh" ); + SetName( aSubMeshSO, newName.c_str(), "SubMesh" ); // Add reference to theShapeObject @@ -757,7 +784,8 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishSubMesh (SMESH::SMESH_Mesh_ptr theM // Publish hypothesis SMESH::ListOfHypothesis_var hypList = theMesh->GetHypothesisList( theShapeObject ); - for ( CORBA::ULong i = 0; i < hypList->length(); i++ ) { + for ( CORBA::ULong i = 0; i < hypList->length(); i++ ) + { SMESH::SMESH_Hypothesis_var aHyp = SMESH::SMESH_Hypothesis::_narrow( hypList[ i ]); SALOMEDS::SObject_wrap so = PublishHypothesis( aHyp ); AddHypothesisToShape( theMesh, theShapeObject, aHyp ); @@ -965,6 +993,42 @@ void SMESH_Gen_i::UpdateIcons( SMESH::SMESH_Mesh_ptr theMesh ) } } +//======================================================================= +//function : HighLightInvalid +//purpose : change font color of a object in the Object Browser +//======================================================================= + +void SMESH_Gen_i::HighLightInvalid( CORBA::Object_ptr theObject, bool isInvalid ) +{ + SALOMEDS::SObject_wrap so = ObjectToSObject(theObject); + highLightInvalid( so.in(), isInvalid ); +} + +//======================================================================= +//function : highLightInvalid +//purpose : change font color of a object in the Object Browser +//======================================================================= + +void SMESH_Gen_i::highLightInvalid( SALOMEDS::SObject_ptr theSObject, bool isInvalid ) +{ + if ( !theSObject->_is_nil() ) + { + SALOMEDS::StudyBuilder_var studyBuilder = getStudyServant()->NewBuilder(); + if ( isInvalid ) + { + SALOMEDS::Color red = { 178,34,34 }; // to differ from reference color + SALOMEDS::GenericAttribute_wrap attr = + studyBuilder->FindOrCreateAttribute( theSObject, "AttributeTextColor" ); + SALOMEDS::AttributeTextColor_wrap colorAttr = attr; + colorAttr->SetTextColor( red ); + } + else + { + studyBuilder->RemoveAttribute( theSObject, "AttributeTextColor" ); + } + } +} + //======================================================================= //function : GetMeshOrSubmeshByShape //purpose : @@ -1339,6 +1403,50 @@ char* SMESH_Gen_i::GetParameters(CORBA::Object_ptr theObject) return aResult._retn(); } +//================================================================================ +/*! + * \brief Create a sub-mesh on a geometry that is not a sub-shape of the main shape + * for the case where a valid sub-shape not found by CopyMeshWithGeom(). + * The invalid sub-mesh has GetId() < 0. + */ +//================================================================================ + +SMESH::SMESH_subMesh_ptr +SMESH_Gen_i::createInvalidSubMesh(SMESH::SMESH_Mesh_ptr theMesh, + GEOM::GEOM_Object_ptr theStrangerGeom, + const char* theName) +{ + SMESH::SMESH_subMesh_var subMesh; + + try + { + SMESH_Mesh_i* mesh_i = SMESH::DownCast( theMesh ); + subMesh = mesh_i->createSubMesh( theStrangerGeom ); + + if ( !subMesh->_is_nil() && CanPublishInStudy( subMesh )) + { + SALOMEDS::SObject_wrap so = PublishSubMesh( theMesh, subMesh, theStrangerGeom, theName ); + + // hide a reference to geometry + if ( !so->_is_nil() ) + { + SALOMEDS::SObject_wrap refSO; + if ( so->FindSubObject( GetRefOnShapeTag(), refSO.inout() )) + { + SALOMEDS::StudyBuilder_var studyBuilder = getStudyServant()->NewBuilder(); + SALOMEDS::GenericAttribute_wrap attr = + studyBuilder->FindOrCreateAttribute( refSO, "AttributeDrawable" ); + SALOMEDS::AttributeDrawable_wrap ga = attr; + ga->SetDrawable( false ); + } + } + } + } + catch (...) { + } + + return subMesh._retn(); +} // ============== diff --git a/src/SMESH_I/SMESH_Group_i.cxx b/src/SMESH_I/SMESH_Group_i.cxx index 354a1daf0..1c8257ddb 100644 --- a/src/SMESH_I/SMESH_Group_i.cxx +++ b/src/SMESH_I/SMESH_Group_i.cxx @@ -838,7 +838,13 @@ void SMESH_GroupOnFilter_i::SetFilter(SMESH::Filter_ptr theFilter) Modified(); // notify dependent Filter with FT_BelongToMeshGroup criterion } - TPythonDump()<< SMESH::SMESH_GroupOnFilter_var(_this()) <<".SetFilter( "<GetGen()->HighLightInvalid( me, false ); + + + TPythonDump()<< me <<".SetFilter( "<< theFilter <<" )"; } //================================================================================ diff --git a/src/SMESH_I/SMESH_Hypothesis_i.hxx b/src/SMESH_I/SMESH_Hypothesis_i.hxx index f713bfd2d..8523c787a 100644 --- a/src/SMESH_I/SMESH_Hypothesis_i.hxx +++ b/src/SMESH_I/SMESH_Hypothesis_i.hxx @@ -40,6 +40,7 @@ #include #include +#include class TCollection_AsciiString; @@ -97,7 +98,18 @@ public: // Persistence virtual char* SaveTo(); virtual void LoadFrom( const char* theStream ); - virtual void UpdateAsMeshesRestored(); // for hyps needing full data restored + virtual void UpdateAsMeshesRestored(); // for hyps needing full study data restored + + + // Methods for copying mesh definition to other geometry + + // Return geometry this hypothesis depends on. Return false if there is no geometry parameter + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const = 0; + + // Set new geometry instead of that returned by getObjectsDependOn() + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) = 0; protected: diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx index 8dc1b25b5..128dbed1c 100644 --- a/src/SMESH_I/SMESH_Mesh_i.cxx +++ b/src/SMESH_I/SMESH_Mesh_i.cxx @@ -2460,9 +2460,25 @@ SMESH::SMESH_subMesh_ptr SMESH_Mesh_i::createSubMesh( GEOM::GEOM_Object_ptr theS if(MYDEBUG) MESSAGE( "createSubMesh" ); TopoDS_Shape myLocSubShape = _gen_i->GeomObjectToShape(theSubShapeObject); ::SMESH_subMesh * mySubMesh = _impl->GetSubMesh(myLocSubShape); - const int subMeshId = mySubMesh->GetId(); + int subMeshId = 0; + + SMESH_subMesh_i * subMeshServant; + if ( mySubMesh ) + { + subMeshId = mySubMesh->GetId(); + subMeshServant = new SMESH_subMesh_i(myPOA, _gen_i, this, subMeshId); + } + else // "invalid sub-mesh" + { + // The invalid sub-mesh is created for the case where a valid sub-shape not found + // by SMESH_Gen_i::CopyMeshWithGeom(). The invalid sub-mesh has GetId() < 0. + if ( _mapSubMesh.empty() ) + subMeshId = -1; + else + subMeshId = _mapSubMesh.begin()->first - 1; + subMeshServant = new SMESH_Invalid_subMesh_i(myPOA, _gen_i, this, subMeshId, theSubShapeObject); + } - SMESH_subMesh_i * subMeshServant = new SMESH_subMesh_i(myPOA, _gen_i, this, subMeshId); SMESH::SMESH_subMesh_var subMesh = subMeshServant->_this(); _mapSubMesh [subMeshId] = mySubMesh; @@ -2477,7 +2493,8 @@ SMESH::SMESH_subMesh_ptr SMESH_Mesh_i::createSubMesh( GEOM::GEOM_Object_ptr theS else { nextId = 0; } // avoid "unused variable" warning // to track changes of GEOM groups - addGeomGroupData( theSubShapeObject, subMesh ); + if ( subMeshId > 0 ) + addGeomGroupData( theSubShapeObject, subMesh ); return subMesh._retn(); } @@ -2513,7 +2530,8 @@ bool SMESH_Mesh_i::removeSubMesh (SMESH::SMESH_subMesh_ptr theSubMesh, if ( theSubShapeObject->_is_nil() ) // not published shape (IPAL13617) { - if ( _mapSubMesh.find( subMeshId ) != _mapSubMesh.end()) + if ( _mapSubMesh.find( subMeshId ) != _mapSubMesh.end() && + _mapSubMesh[ subMeshId ]) { TopoDS_Shape S = _mapSubMesh[ subMeshId ]->GetSubShape(); if ( !S.IsNull() ) @@ -2735,7 +2753,7 @@ namespace SMESH_Mesh_i* _mesh; TCallUp_i(SMESH_Mesh_i* mesh):_mesh(mesh) {} virtual void RemoveGroup (const int theGroupID) { _mesh->removeGroup( theGroupID ); } - virtual void HypothesisModified () { _mesh->onHypothesisModified(); } + virtual void HypothesisModified (int theHypID) { _mesh->onHypothesisModified( theHypID ); } virtual void Load () { _mesh->Load(); } }; } @@ -2746,13 +2764,30 @@ namespace */ //================================================================================ -void SMESH_Mesh_i::onHypothesisModified() +void SMESH_Mesh_i::onHypothesisModified(int theHypID) { if ( _preMeshInfo ) _preMeshInfo->ForgetOrLoad(); SMESH::SMESH_Mesh_var mesh = _this(); _gen_i->UpdateIcons( mesh ); + + // mark a hypothesis as valid after edition + SALOMEDS::SComponent_wrap smeshComp = _gen_i->PublishComponent(); + SALOMEDS::SObject_wrap hypRoot; + if ( !smeshComp->_is_nil() && + smeshComp->FindSubObject( _gen_i->GetHypothesisRootTag(), hypRoot.inout() )) + { + SALOMEDS::ChildIterator_wrap anIter = _gen_i->getStudyServant()->NewChildIterator( hypRoot ); + for ( ; anIter->More(); anIter->Next() ) + { + SALOMEDS::SObject_wrap hypSO = anIter->Value(); + CORBA::Object_var obj = _gen_i->SObjectToObject( hypSO ); + SMESH::SMESH_Hypothesis_var hyp = SMESH::SMESH_Hypothesis::_narrow( obj ); + if ( !hyp->_is_nil() && hyp->GetId() == theHypID ) + _gen_i->HighLightInvalid( hyp, false ); + } + } } //============================================================================= diff --git a/src/SMESH_I/SMESH_Mesh_i.hxx b/src/SMESH_I/SMESH_Mesh_i.hxx index 867949a9d..7e612be13 100644 --- a/src/SMESH_I/SMESH_Mesh_i.hxx +++ b/src/SMESH_I/SMESH_Mesh_i.hxx @@ -439,7 +439,7 @@ public: const std::map& getGroups() { return _mapGroups; } // return existing group objects - void onHypothesisModified(); + void onHypothesisModified(int theHypID); // callback from _impl to forget not loaded mesh data (issue 0021208) void checkMeshLoaded(); diff --git a/src/SMESH_I/SMESH_PythonDump.cxx b/src/SMESH_I/SMESH_PythonDump.cxx index 7ffedf1d4..76a23315a 100644 --- a/src/SMESH_I/SMESH_PythonDump.cxx +++ b/src/SMESH_I/SMESH_PythonDump.cxx @@ -540,6 +540,16 @@ namespace SMESH DumpArray( theList, *this ); return *this; } + TPythonDump& TPythonDump::operator<<(const SMESH::submesh_array& theList) + { + DumpArray( theList, *this ); + return *this; + } + TPythonDump& TPythonDump::operator<<(const SMESH::ListOfHypothesis& theList) + { + DumpArray( theList, *this ); + return *this; + } TPythonDump& TPythonDump::operator<<(const SMESH::CoincidentFreeBorders& theCFB) { // dump CoincidentFreeBorders as a list of lists, each enclosed list diff --git a/src/SMESH_I/SMESH_PythonDump.hxx b/src/SMESH_I/SMESH_PythonDump.hxx index 793e4a4a1..37393b23f 100644 --- a/src/SMESH_I/SMESH_PythonDump.hxx +++ b/src/SMESH_I/SMESH_PythonDump.hxx @@ -227,6 +227,12 @@ namespace SMESH TPythonDump& operator<<(const SMESH::ListOfIDSources& theList); + TPythonDump& + operator<<(const SMESH::submesh_array& theList); + + TPythonDump& + operator<<(const SMESH::ListOfHypothesis& theList); + TPythonDump& operator<<(const SMESH::CoincidentFreeBorders& theCFB); diff --git a/src/SMESH_I/SMESH_subMesh_i.cxx b/src/SMESH_I/SMESH_subMesh_i.cxx index 4737a7b0e..92d6034e4 100644 --- a/src/SMESH_I/SMESH_subMesh_i.cxx +++ b/src/SMESH_I/SMESH_subMesh_i.cxx @@ -96,6 +96,8 @@ typedef list TListOfSubMeshes; bool getSubMeshes(::SMESH_subMesh* theSubMesh, TListOfSubMeshes& theSubMeshList) { + if ( !theSubMesh ) + return false; // "invalid sub-mesh" created by SMESH_Gen_i::CopyMeshWithGeom() size_t size = theSubMeshList.size(); // check all child sub-meshes of one complexity, @@ -582,3 +584,30 @@ SALOMEDS::TMPFile* SMESH_subMesh_i::GetVtkUgStream() SALOMEDS::TMPFile_var SeqFile; return SeqFile._retn(); } + +//======================================================================= +//function : SMESH_Invalid_subMesh_i +//purpose : constructor of "invalid sub-mesh" created by SMESH_Gen_i::CopyMeshWithGeom() +//======================================================================= + +SMESH_Invalid_subMesh_i::SMESH_Invalid_subMesh_i( PortableServer::POA_ptr thePOA, + SMESH_Gen_i* gen_i, + SMESH_Mesh_i* mesh_i, + int localId, + GEOM::GEOM_Object_ptr shape ) + : SALOME::GenericObj_i( thePOA ), + SMESH_subMesh_i( thePOA, gen_i, mesh_i, localId ) +{ + _geom = GEOM::GEOM_Object::_duplicate( shape ); +} + +//======================================================================= +//function : GetSubShape +//purpose : return geomtry which is not a sub-shape of the main shape +//======================================================================= + +GEOM::GEOM_Object_ptr SMESH_Invalid_subMesh_i::GetSubShape() + throw (SALOME::SALOME_Exception) +{ + return GEOM::GEOM_Object::_duplicate( _geom ); +} diff --git a/src/SMESH_I/SMESH_subMesh_i.hxx b/src/SMESH_I/SMESH_subMesh_i.hxx index b5a814080..cbdb796e0 100644 --- a/src/SMESH_I/SMESH_subMesh_i.hxx +++ b/src/SMESH_I/SMESH_subMesh_i.hxx @@ -130,4 +130,26 @@ protected: friend class SMESH_PreMeshInfo; }; + +class SMESH_I_EXPORT SMESH_Invalid_subMesh_i: + public virtual POA_SMESH::SMESH_subMesh, + public virtual SALOME::GenericObj_i, + public virtual SMESH_subMesh_i +{ + public: + SMESH_Invalid_subMesh_i( PortableServer::POA_ptr thePOA, + SMESH_Gen_i* gen_i, + SMESH_Mesh_i* mesh_i, + int localId, + GEOM::GEOM_Object_ptr shape); + + virtual GEOM::GEOM_Object_ptr GetSubShape() + throw (SALOME::SALOME_Exception); + + protected: + + GEOM::GEOM_Object_var _geom; + +}; + #endif diff --git a/src/SMESH_SWIG/smeshBuilder.py b/src/SMESH_SWIG/smeshBuilder.py index d0bb913c1..a93d9f732 100755 --- a/src/SMESH_SWIG/smeshBuilder.py +++ b/src/SMESH_SWIG/smeshBuilder.py @@ -782,11 +782,46 @@ class smeshBuilder( SMESH._objref_SMESH_Gen, object ): an instance of class :class:`Mesh` """ - if (isinstance( meshPart, Mesh )): + if isinstance( meshPart, Mesh ): meshPart = meshPart.GetMesh() mesh = SMESH._objref_SMESH_Gen.CopyMesh( self,meshPart,meshName,toCopyGroups,toKeepIDs ) return Mesh(self, self.geompyD, mesh) + def CopyMeshWithGeom( self, sourceMesh, newGeom, meshName="", toCopyGroups=True, + toReuseHypotheses=True, toCopyElements=True): + """ + Create a mesh by copying a mesh definition (hypotheses and groups) to a new geometry. + It is supposed that the new geometry is a modified geometry of *sourceMesh*. + To facilitate and speed up the operation, consider using + "Set presentation parameters and sub-shapes from arguments" option in + a dialog of geometrical operation used to create the new geometry. + + Parameters: + sourceMesh: the mesh to copy definition of. + newGeom: the new geomtry. + meshName: an optional name of the new mesh. If omitted, the mesh name is kept. + toCopyGroups: to create groups in the new mesh. + toReuseHypotheses: to reuse hypotheses of the *sourceMesh*. + toCopyElements: to copy mesh elements present on non-modified sub-shapes of + *sourceMesh*. + Returns: + tuple ( ok, newMesh, newGroups, newSubMeshes, newHypotheses, invalidEntries ) + *invalidEntries* are study entries of objects whose + counterparts are not found in the *newGeom*, followed by entries + of mesh sub-objects that are invalid because they depend on a not found + preceeding sub-shape + """ + if isinstance( sourceMesh, Mesh ): + sourceMesh = sourceMesh.GetMesh() + + ok, newMesh, newGroups, newSubMeshes, newHypotheses, invalidEntries = \ + SMESH._objref_SMESH_Gen.CopyMeshWithGeom( self, sourceMesh, newGeom, meshName, + toCopyGroups, + toReuseHypotheses, + toCopyElements) + return ( ok, Mesh(self, self.geompyD, newMesh), + newGroups, newSubMeshes, newHypotheses, invalidEntries ) + def GetSubShapesId( self, theMainObject, theListOfSubObjects ): """ Return IDs of sub-shapes @@ -6156,7 +6191,7 @@ class Mesh(metaclass = MeshMeta): Fill with 2D elements a hole defined by a SMESH.FreeBorder. Parameters: - FreeBorder: either a SMESH.FreeBorder or a list on node IDs. These nodes + holeNodes: either a SMESH.FreeBorder or a list on node IDs. These nodes must describe all sequential nodes of the hole border. The first and the last nodes must be the same. Use :meth:`FindFreeBorders` to get nodes of holes. groupName (string): name of a group to add new faces diff --git a/src/StdMeshers/StdMeshers_Arithmetic1D.cxx b/src/StdMeshers/StdMeshers_Arithmetic1D.cxx index 89cea269a..18f0da945 100644 --- a/src/StdMeshers/StdMeshers_Arithmetic1D.cxx +++ b/src/StdMeshers/StdMeshers_Arithmetic1D.cxx @@ -49,7 +49,7 @@ using namespace std; //============================================================================= StdMeshers_Arithmetic1D::StdMeshers_Arithmetic1D(int hypId, SMESH_Gen * gen) - :SMESH_Hypothesis(hypId, gen) + :StdMeshers_Reversible1D(hypId, gen) { _begLength = 1.; _endLength = 10.; @@ -105,21 +105,6 @@ double StdMeshers_Arithmetic1D::GetLength(bool isStartLength) const */ //============================================================================= -void StdMeshers_Arithmetic1D::SetReversedEdges( std::vector& ids ) -{ - if ( ids != _edgeIDs ) { - _edgeIDs = ids; - - NotifySubMeshesHypothesisModification(); - } -} - -//============================================================================= -/*! - * - */ -//============================================================================= - ostream & StdMeshers_Arithmetic1D::SaveTo(ostream & save) { int listSize = _edgeIDs.size(); @@ -165,28 +150,6 @@ istream & StdMeshers_Arithmetic1D::LoadFrom(istream & load) return load; } -//============================================================================= -/*! - * - */ -//============================================================================= - -ostream & operator <<(ostream & save, StdMeshers_Arithmetic1D & hyp) -{ - return hyp.SaveTo( save ); -} - -//============================================================================= -/*! - * - */ -//============================================================================= - -istream & operator >>(istream & load, StdMeshers_Arithmetic1D & hyp) -{ - return hyp.LoadFrom( load ); -} - //================================================================================ /*! * \brief Initialize start and end length by the mesh built on the geometry diff --git a/src/StdMeshers/StdMeshers_Arithmetic1D.hxx b/src/StdMeshers/StdMeshers_Arithmetic1D.hxx index e0b9cd9b7..eb1a8f437 100644 --- a/src/StdMeshers/StdMeshers_Arithmetic1D.hxx +++ b/src/StdMeshers/StdMeshers_Arithmetic1D.hxx @@ -32,13 +32,11 @@ #include "SMESH_StdMeshers.hxx" +#include "StdMeshers_Reversible1D.hxx" #include "SMESH_Hypothesis.hxx" #include "Utils_SALOME_Exception.hxx" -#include - -class STDMESHERS_EXPORT StdMeshers_Arithmetic1D: - public SMESH_Hypothesis +class STDMESHERS_EXPORT StdMeshers_Arithmetic1D: public StdMeshers_Reversible1D { public: StdMeshers_Arithmetic1D(int hypId, SMESH_Gen* gen); @@ -48,18 +46,8 @@ public: double GetLength(bool isStartLength) const; - void SetReversedEdges( std::vector& ids); - - void SetObjectEntry( const char* entry ) { _objEntry = entry; } - - const char* GetObjectEntry() { return _objEntry.c_str(); } - - const std::vector& GetReversedEdges() const { return _edgeIDs; } - virtual std::ostream & SaveTo(std::ostream & save); virtual std::istream & LoadFrom(std::istream & load); - friend std::ostream& operator << (std::ostream & save, StdMeshers_Arithmetic1D & hyp); - friend std::istream& operator >> (std::istream & load, StdMeshers_Arithmetic1D & hyp); /*! * \brief Initialize start and end length by the mesh built on the geometry @@ -77,8 +65,6 @@ public: protected: double _begLength, _endLength; - std::vector _edgeIDs; - std::string _objEntry; }; #endif diff --git a/src/StdMeshers/StdMeshers_FixedPoints1D.cxx b/src/StdMeshers/StdMeshers_FixedPoints1D.cxx index b5934045b..be0917ef2 100644 --- a/src/StdMeshers/StdMeshers_FixedPoints1D.cxx +++ b/src/StdMeshers/StdMeshers_FixedPoints1D.cxx @@ -35,9 +35,8 @@ using namespace std; */ //============================================================================= -StdMeshers_FixedPoints1D::StdMeshers_FixedPoints1D(int hypId, - SMESH_Gen * gen) - :SMESH_Hypothesis(hypId, gen) +StdMeshers_FixedPoints1D::StdMeshers_FixedPoints1D(int hypId, SMESH_Gen * gen) + :StdMeshers_Reversible1D(hypId, gen) { _name = "FixedPoints1D"; _param_algo_dim = 1; @@ -81,27 +80,6 @@ void StdMeshers_FixedPoints1D::SetNbSegments(std::vector& listNbSeg) NotifySubMeshesHypothesisModification(); } -//============================================================================= -/*! - * - */ -//============================================================================= - -void StdMeshers_FixedPoints1D::SetReversedEdges( std::vector& ids ) -{ - if ( ids != _edgeIDs ) { - _edgeIDs = ids; - - NotifySubMeshesHypothesisModification(); - } -} - -//============================================================================= -/*! - * - */ -//============================================================================= - ostream & StdMeshers_FixedPoints1D::SaveTo(ostream & save) { int listSize = _params.size(); diff --git a/src/StdMeshers/StdMeshers_FixedPoints1D.hxx b/src/StdMeshers/StdMeshers_FixedPoints1D.hxx index 05f903013..58b9be644 100644 --- a/src/StdMeshers/StdMeshers_FixedPoints1D.hxx +++ b/src/StdMeshers/StdMeshers_FixedPoints1D.hxx @@ -29,13 +29,13 @@ #include "SMESH_StdMeshers.hxx" +#include "StdMeshers_Reversible1D.hxx" #include "SMESH_Hypothesis.hxx" #include "Utils_SALOME_Exception.hxx" #include -class STDMESHERS_EXPORT StdMeshers_FixedPoints1D: - public SMESH_Hypothesis +class STDMESHERS_EXPORT StdMeshers_FixedPoints1D: public StdMeshers_Reversible1D { public: StdMeshers_FixedPoints1D(int hypId, SMESH_Gen* gen); @@ -51,14 +51,6 @@ public: const std::vector& GetNbSegments() const { return _nbsegs; } - void SetReversedEdges( std::vector& ids); - - void SetObjectEntry( const char* entry ) { _objEntry = entry; } - - const char* GetObjectEntry() { return _objEntry.c_str(); } - - const std::vector& GetReversedEdges() const { return _edgeIDs; } - virtual std::ostream & SaveTo(std::ostream & save); virtual std::istream & LoadFrom(std::istream & load); @@ -79,8 +71,6 @@ public: protected: std::vector _params; std::vector _nbsegs; - std::vector _edgeIDs; - std::string _objEntry; }; #endif diff --git a/src/StdMeshers/StdMeshers_NumberOfSegments.cxx b/src/StdMeshers/StdMeshers_NumberOfSegments.cxx index 5ba6e47d9..927613048 100644 --- a/src/StdMeshers/StdMeshers_NumberOfSegments.cxx +++ b/src/StdMeshers/StdMeshers_NumberOfSegments.cxx @@ -60,7 +60,7 @@ const double PRECISION = 1e-7; StdMeshers_NumberOfSegments::StdMeshers_NumberOfSegments(int hypId, SMESH_Gen * gen) - : SMESH_Hypothesis(hypId, gen), + : StdMeshers_Reversible1D(hypId, gen), _numberOfSegments(15),//issue 19923 _distrType(DT_Regular), _scaleFactor(1.), @@ -721,19 +721,3 @@ bool StdMeshers_NumberOfSegments::SetParametersByDefaults(const TDefaults& dflt { return (_numberOfSegments = dflts._nbSegments ); } - -//============================================================================= -/*! - * - */ -//============================================================================= - -void StdMeshers_NumberOfSegments::SetReversedEdges( std::vector& ids ) -{ - if ( ids != _edgeIDs ) { - _edgeIDs = ids; - - NotifySubMeshesHypothesisModification(); - } -} - diff --git a/src/StdMeshers/StdMeshers_NumberOfSegments.hxx b/src/StdMeshers/StdMeshers_NumberOfSegments.hxx index 6e9e59e3e..3a71f8e0d 100644 --- a/src/StdMeshers/StdMeshers_NumberOfSegments.hxx +++ b/src/StdMeshers/StdMeshers_NumberOfSegments.hxx @@ -29,10 +29,10 @@ #ifndef _SMESH_NUMBEROFSEGMENTS_HXX_ #define _SMESH_NUMBEROFSEGMENTS_HXX_ -#include "SMESH_StdMeshers.hxx" - +#include "StdMeshers_Reversible1D.hxx" #include "SMESH_Hypothesis.hxx" #include "Utils_SALOME_Exception.hxx" + #include /*! @@ -41,8 +41,7 @@ * It provides parameters for subdivision an edge by various * distribution types, considering the given number of resulting segments */ -class STDMESHERS_EXPORT StdMeshers_NumberOfSegments: - public SMESH_Hypothesis +class STDMESHERS_EXPORT StdMeshers_NumberOfSegments: public StdMeshers_Reversible1D { public: StdMeshers_NumberOfSegments(int hypId, SMESH_Gen* gen); @@ -171,14 +170,6 @@ public: int ConversionMode() const throw (SALOME_Exception); - void SetReversedEdges( std::vector& ids); - - void SetObjectEntry( const char* entry ) { _objEntry = entry; } - - const char* GetObjectEntry() { return _objEntry.c_str(); } - - const std::vector& GetReversedEdges() const { return _edgeIDs; } - /*! * \brief Initialize number of segments by the mesh built on the geometry * \param theMesh - the built mesh @@ -205,8 +196,6 @@ protected: std::vector _table, _distr; //!< the table for DT_TabFunc, a sequence of pairs of numbers std::string _func; //!< the expression of the function for DT_ExprFunc int _convMode; //!< flag of conversion mode: 0=exponent, 1=cut negative - std::vector _edgeIDs; //!< list of reversed edges ids - std::string _objEntry; //!< Entry of the main object to reverse edges }; #endif diff --git a/src/StdMeshers/StdMeshers_QuadrangleParams.hxx b/src/StdMeshers/StdMeshers_QuadrangleParams.hxx index 64247e0b6..392447eab 100644 --- a/src/StdMeshers/StdMeshers_QuadrangleParams.hxx +++ b/src/StdMeshers/StdMeshers_QuadrangleParams.hxx @@ -51,7 +51,7 @@ public: int GetTriaVertex() const { return _triaVertexID; } void SetObjectEntry (const char* entry) { _objEntry = entry; } - const char* GetObjectEntry() { return _objEntry.c_str(); } + const char* GetObjectEntry() const { return _objEntry.c_str(); } void SetQuadType (StdMeshers_QuadType type); StdMeshers_QuadType GetQuadType() const { return _quadType; } diff --git a/src/StdMeshers/StdMeshers_Reversible1D.hxx b/src/StdMeshers/StdMeshers_Reversible1D.hxx index 00d61a1da..e2651cd41 100644 --- a/src/StdMeshers/StdMeshers_Reversible1D.hxx +++ b/src/StdMeshers/StdMeshers_Reversible1D.hxx @@ -44,7 +44,7 @@ public: void SetObjectEntry( const char* entry ) { _objEntry = entry; } - const char* GetObjectEntry() { return _objEntry.c_str(); } + const char* GetObjectEntry() const { return _objEntry.c_str(); } const std::vector& GetReversedEdges() const { return _edgeIDs; } diff --git a/src/StdMeshers/StdMeshers_StartEndLength.cxx b/src/StdMeshers/StdMeshers_StartEndLength.cxx index a2bf0f7e1..b89af1677 100644 --- a/src/StdMeshers/StdMeshers_StartEndLength.cxx +++ b/src/StdMeshers/StdMeshers_StartEndLength.cxx @@ -47,9 +47,8 @@ using namespace std; */ //============================================================================= -StdMeshers_StartEndLength::StdMeshers_StartEndLength(int hypId, - SMESH_Gen * gen) - :SMESH_Hypothesis(hypId, gen) +StdMeshers_StartEndLength::StdMeshers_StartEndLength( int hypId, SMESH_Gen* gen ) + :StdMeshers_Reversible1D(hypId, gen) { _begLength = 1.; _endLength = 10.; @@ -105,21 +104,6 @@ double StdMeshers_StartEndLength::GetLength(bool isStartLength) const */ //============================================================================= -void StdMeshers_StartEndLength::SetReversedEdges( std::vector& ids ) -{ - if ( ids != _edgeIDs ) { - _edgeIDs = ids; - - NotifySubMeshesHypothesisModification(); - } -} - -//============================================================================= -/*! - * - */ -//============================================================================= - ostream & StdMeshers_StartEndLength::SaveTo(ostream & save) { int listSize = _edgeIDs.size(); @@ -166,28 +150,6 @@ istream & StdMeshers_StartEndLength::LoadFrom(istream & load) return load; } -//============================================================================= -/*! - * - */ -//============================================================================= - -ostream & operator <<(ostream & save, StdMeshers_StartEndLength & hyp) -{ - return hyp.SaveTo( save ); -} - -//============================================================================= -/*! - * - */ -//============================================================================= - -istream & operator >>(istream & load, StdMeshers_StartEndLength & hyp) -{ - return hyp.LoadFrom( load ); -} - //================================================================================ /*! * \brief Initialize start and end length by the mesh built on the geometry diff --git a/src/StdMeshers/StdMeshers_StartEndLength.hxx b/src/StdMeshers/StdMeshers_StartEndLength.hxx index 576d8e199..dbe7a501c 100644 --- a/src/StdMeshers/StdMeshers_StartEndLength.hxx +++ b/src/StdMeshers/StdMeshers_StartEndLength.hxx @@ -29,12 +29,13 @@ #include "SMESH_StdMeshers.hxx" +#include "StdMeshers_Reversible1D.hxx" #include "SMESH_Hypothesis.hxx" #include "Utils_SALOME_Exception.hxx" #include -class STDMESHERS_EXPORT StdMeshers_StartEndLength:public SMESH_Hypothesis +class STDMESHERS_EXPORT StdMeshers_StartEndLength: public StdMeshers_Reversible1D { public: StdMeshers_StartEndLength(int hypId, SMESH_Gen * gen); @@ -44,19 +45,8 @@ class STDMESHERS_EXPORT StdMeshers_StartEndLength:public SMESH_Hypothesis double GetLength(bool isStartLength) const; - void SetReversedEdges( std::vector& ids); - - const std::vector& GetReversedEdges() const { return _edgeIDs; } - - void SetObjectEntry( const char* entry ) { _objEntry = entry; } - - const char* GetObjectEntry() { return _objEntry.c_str(); } - virtual std::ostream & SaveTo(std::ostream & save); virtual std::istream & LoadFrom(std::istream & load); - friend std::ostream & operator <<(std::ostream & save, StdMeshers_StartEndLength & hyp); - friend std::istream & operator >>(std::istream & load, StdMeshers_StartEndLength & hyp); - /*! * \brief Initialize start and end length by the mesh built on the geometry @@ -74,8 +64,6 @@ class STDMESHERS_EXPORT StdMeshers_StartEndLength:public SMESH_Hypothesis protected: double _begLength, _endLength; - std::vector _edgeIDs; - std::string _objEntry; }; #endif diff --git a/src/StdMeshers_I/StdMeshers_Adaptive1D_i.hxx b/src/StdMeshers_I/StdMeshers_Adaptive1D_i.hxx index 060b8b42a..b83fc0ba5 100644 --- a/src/StdMeshers_I/StdMeshers_Adaptive1D_i.hxx +++ b/src/StdMeshers_I/StdMeshers_Adaptive1D_i.hxx @@ -83,6 +83,12 @@ class STDMESHERS_I_EXPORT StdMeshers_Adaptive1D_i: * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration) */ CORBA::Boolean IsDimSupported( SMESH::Dimension type ); + + // Methods for copying mesh definition to other geometry + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const { return false; } + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) { return true; } }; #endif diff --git a/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.cxx b/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.cxx index 9676549e2..a7cd08ead 100644 --- a/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.cxx @@ -48,7 +48,8 @@ using namespace std; StdMeshers_Arithmetic1D_i::StdMeshers_Arithmetic1D_i( PortableServer::POA_ptr thePOA, ::SMESH_Gen* theGenImpl ) : SALOME::GenericObj_i( thePOA ), - SMESH_Hypothesis_i( thePOA ) + SMESH_Hypothesis_i( thePOA ), + StdMeshers_Reversible1D_i( this ) { myBaseImpl = new ::StdMeshers_Arithmetic1D( theGenImpl->GetANewId(), theGenImpl ); @@ -131,98 +132,6 @@ CORBA::Double StdMeshers_Arithmetic1D_i::GetLength( CORBA::Boolean theIsStart) return this->GetImpl()->GetLength( theIsStart ); } -//============================================================================= -/*! - * StdMeshers_Arithmetic1D_i::SetReversedEdges - * - * Set edges to reverse - */ -//============================================================================= - -void StdMeshers_Arithmetic1D_i::SetReversedEdges( const SMESH::long_array& theIds ) -{ - ASSERT( myBaseImpl ); - try { - std::vector ids( theIds.length() ); - CORBA::Long iEnd = theIds.length(); - for ( CORBA::Long i = 0; i < iEnd; i++ ) - ids[ i ] = theIds[ i ]; - - this->GetImpl()->SetReversedEdges( ids ); - } - catch ( SALOME_Exception& S_ex ) { - THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), - SALOME::BAD_PARAM ); - } - - // Update Python script - SMESH::TPythonDump() << _this() << ".SetReversedEdges( " << theIds << " )"; -} - -//============================================================================= -/*! - * StdMeshers_Arithmetic1D_i::SetObjectEntry - * - * Set the Entry for the Main Object - */ -//============================================================================= - -void StdMeshers_Arithmetic1D_i::SetObjectEntry( const char* theEntry ) -{ - ASSERT( myBaseImpl ); - string entry(theEntry); // actually needed as theEntry is spoiled by moment of dumping - try { - this->GetImpl()->SetObjectEntry( entry.c_str() ); - // Update Python script - SMESH::TPythonDump() << _this() << ".SetObjectEntry( \"" << entry.c_str() << "\" )"; - } - catch ( SALOME_Exception& S_ex ) { - THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),SALOME::BAD_PARAM ); - } -} - -//============================================================================= -/*! - * StdMeshers_Arithmetic1D_i::GetObjectEntry - * - * Set the Entry for the Main Object - */ -//============================================================================= - -char* StdMeshers_Arithmetic1D_i::GetObjectEntry() -{ - ASSERT( myBaseImpl ); - const char* entry; - try { - entry = this->GetImpl()->GetObjectEntry(); - } - catch ( SALOME_Exception& S_ex ) { - THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), - SALOME::BAD_PARAM ); - } - return CORBA::string_dup( entry ); -} - -//============================================================================= -/*! - * StdMeshers_Arithmetic1D_i::GetReversedEdges - * - * Get reversed edges - */ -//============================================================================= - -SMESH::long_array* StdMeshers_Arithmetic1D_i::GetReversedEdges() -{ - ASSERT( myBaseImpl ); - SMESH::long_array_var anArray = new SMESH::long_array; - std::vector ids = this->GetImpl()->GetReversedEdges(); - anArray->length( ids.size() ); - for ( CORBA::ULong i = 0; i < ids.size(); i++) - anArray [ i ] = ids [ i ]; - - return anArray._retn(); -} - //============================================================================= /*! * StdMeshers_Arithmetic1D_i::GetImpl @@ -261,3 +170,30 @@ std::string StdMeshers_Arithmetic1D_i::getMethodOfParameter(const int paramIndex { return paramIndex == 0 ? "SetStartLength" : "SetEndLength"; } + + +//================================================================================ +/*! + * \brief Return geometry this hypothesis depends on. Return false if there is no geometry parameter + */ +//================================================================================ + +bool +StdMeshers_Arithmetic1D_i::getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const +{ + return StdMeshers_Reversible1D_i::getObjectsDependOn( entryArray, subIDArray ); +} + +//================================================================================ +/*! + * \brief Set new geometry instead of that returned by getObjectsDependOn() + */ +//================================================================================ + +bool +StdMeshers_Arithmetic1D_i::setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) +{ + return StdMeshers_Reversible1D_i::setObjectsDependOn( entryArray, subIDArray ); +} diff --git a/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.hxx b/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.hxx index f159f0c48..ad191a26a 100644 --- a/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.hxx +++ b/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.hxx @@ -33,7 +33,7 @@ #include #include CORBA_SERVER_HEADER(SMESH_BasicHypothesis) -#include "SMESH_Hypothesis_i.hxx" +#include "StdMeshers_Reversible1D_i.hxx" #include "StdMeshers_Arithmetic1D.hxx" // ====================================================== @@ -41,7 +41,8 @@ // ====================================================== class STDMESHERS_I_EXPORT StdMeshers_Arithmetic1D_i: public virtual POA_StdMeshers::StdMeshers_Arithmetic1D, - public virtual SMESH_Hypothesis_i + public virtual SMESH_Hypothesis_i, + public virtual StdMeshers_Reversible1D_i { public: // Constructor @@ -64,24 +65,23 @@ public: // Get length CORBA::Double GetLength(CORBA::Boolean theIsStart); - //Set Reversed Edges - void SetReversedEdges( const SMESH::long_array& theIDs); - - //Get Reversed Edges - SMESH::long_array* GetReversedEdges(); - - //Set the Entry of the Object - void SetObjectEntry( const char* theEntry); - - //Get Object Entry - char* GetObjectEntry(); - // Get implementation ::StdMeshers_Arithmetic1D* GetImpl(); // Verify whether hypothesis supports given entity type CORBA::Boolean IsDimSupported( SMESH::Dimension type ); + + // Methods for copying mesh definition to other geometry + + // Return geometry this hypothesis depends on. Return false if there is no geometry parameter + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const; + + // Set new geometry instead of that returned by getObjectsDependOn() + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ); + protected: virtual std::string getMethodOfParameter(const int paramIndex, int nbVars) const; }; diff --git a/src/StdMeshers_I/StdMeshers_AutomaticLength_i.hxx b/src/StdMeshers_I/StdMeshers_AutomaticLength_i.hxx index a2b4772e6..e7d4ae450 100644 --- a/src/StdMeshers_I/StdMeshers_AutomaticLength_i.hxx +++ b/src/StdMeshers_I/StdMeshers_AutomaticLength_i.hxx @@ -66,6 +66,12 @@ public: // Verify whether hypothesis supports given entity type CORBA::Boolean IsDimSupported( SMESH::Dimension type ); + + // Methods for copying mesh definition to other geometry + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const { return false; } + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) { return true; } }; #endif diff --git a/src/StdMeshers_I/StdMeshers_CartesianParameters3D_i.hxx b/src/StdMeshers_I/StdMeshers_CartesianParameters3D_i.hxx index d9f4d603a..4f37edc3a 100644 --- a/src/StdMeshers_I/StdMeshers_CartesianParameters3D_i.hxx +++ b/src/StdMeshers_I/StdMeshers_CartesianParameters3D_i.hxx @@ -141,6 +141,13 @@ class STDMESHERS_I_EXPORT StdMeshers_CartesianParameters3D_i: // Verify whether hypothesis supports given entity type CORBA::Boolean IsDimSupported( SMESH::Dimension type ); + + + // Methods for copying mesh definition to other geometry + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const { return false; } + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) { return true; } }; #endif diff --git a/src/StdMeshers_I/StdMeshers_Deflection1D_i.hxx b/src/StdMeshers_I/StdMeshers_Deflection1D_i.hxx index 9078455c6..71277100b 100644 --- a/src/StdMeshers_I/StdMeshers_Deflection1D_i.hxx +++ b/src/StdMeshers_I/StdMeshers_Deflection1D_i.hxx @@ -65,6 +65,11 @@ public: // Verify whether hypothesis supports given entity type CORBA::Boolean IsDimSupported( SMESH::Dimension type ); + // Methods for copying mesh definition to other geometry + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const { return false; } + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) { return true; } protected: virtual std::string getMethodOfParameter(const int paramIndex, int nbVars) const; }; diff --git a/src/StdMeshers_I/StdMeshers_FixedPoints1D_i.cxx b/src/StdMeshers_I/StdMeshers_FixedPoints1D_i.cxx index 08829204e..7dc131acf 100644 --- a/src/StdMeshers_I/StdMeshers_FixedPoints1D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_FixedPoints1D_i.cxx @@ -45,8 +45,9 @@ using namespace std; StdMeshers_FixedPoints1D_i::StdMeshers_FixedPoints1D_i( PortableServer::POA_ptr thePOA, ::SMESH_Gen* theGenImpl ) - : SALOME::GenericObj_i( thePOA ), - SMESH_Hypothesis_i( thePOA ) + : SALOME::GenericObj_i( thePOA ), + SMESH_Hypothesis_i( thePOA ), + StdMeshers_Reversible1D_i( this ) { myBaseImpl = new ::StdMeshers_FixedPoints1D(theGenImpl->GetANewId(), theGenImpl); @@ -156,98 +157,6 @@ SMESH::long_array* StdMeshers_FixedPoints1D_i::GetNbSegments() return anArray._retn(); } -//============================================================================= -/*! - * StdMeshers_FixedPoints1D_i::SetReversedEdges - * - * Set edges to reverse - */ -//============================================================================= - -void StdMeshers_FixedPoints1D_i::SetReversedEdges( const SMESH::long_array& theIds ) -{ - ASSERT( myBaseImpl ); - try { - std::vector ids( theIds.length() ); - CORBA::Long iEnd = theIds.length(); - for ( CORBA::Long i = 0; i < iEnd; i++ ) - ids[ i ] = theIds[ i ]; - - this->GetImpl()->SetReversedEdges( ids ); - } - catch ( SALOME_Exception& S_ex ) { - THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), - SALOME::BAD_PARAM ); - } - - // Update Python script - SMESH::TPythonDump() << _this() << ".SetReversedEdges( " << theIds << " )"; -} - -//============================================================================= -/*! - * StdMeshers_FixedPoints1D_i::SetObjectEntry - * - * Set the Entry for the Main Object - */ -//============================================================================= - -void StdMeshers_FixedPoints1D_i::SetObjectEntry( const char* theEntry ) -{ - ASSERT( myBaseImpl ); - string entry(theEntry); // actually needed as theEntry is spoiled by moment of dumping - try { - this->GetImpl()->SetObjectEntry( entry.c_str() ); - // Update Python script - SMESH::TPythonDump() << _this() << ".SetObjectEntry( \"" << entry.c_str() << "\" )"; - } - catch ( SALOME_Exception& S_ex ) { - THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),SALOME::BAD_PARAM ); - } -} - -//============================================================================= -/*! - * StdMeshers_FixedPoints1D_i::GetObjectEntry - * - * Set the Entry for the Main Object - */ -//============================================================================= - -char* StdMeshers_FixedPoints1D_i::GetObjectEntry() -{ - ASSERT( myBaseImpl ); - const char* entry; - try { - entry = this->GetImpl()->GetObjectEntry(); - } - catch ( SALOME_Exception& S_ex ) { - THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), - SALOME::BAD_PARAM ); - } - return CORBA::string_dup( entry ); -} - -//============================================================================= -/*! - * StdMeshers_FixedPoints1D_i::GetReversedEdges - * - * Get reversed edges - */ -//============================================================================= - -SMESH::long_array* StdMeshers_FixedPoints1D_i::GetReversedEdges() -{ - ASSERT( myBaseImpl ); - SMESH::long_array_var anArray = new SMESH::long_array; - std::vector ids = this->GetImpl()->GetReversedEdges(); - anArray->length( ids.size() ); - for ( CORBA::ULong i = 0; i < ids.size(); i++) - anArray [ i ] = ids [ i ]; - - return anArray._retn(); -} - //============================================================================= /*! * StdMeshers_FixedPoints1D_i::GetImpl @@ -269,9 +178,34 @@ SMESH::long_array* StdMeshers_FixedPoints1D_i::GetReversedEdges() * * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration) */ -//================================================================================ +//================================================================================ CORBA::Boolean StdMeshers_FixedPoints1D_i::IsDimSupported( SMESH::Dimension type ) { return type == SMESH::DIM_1D; } +//================================================================================ +/*! + * \brief Return geometry this hypothesis depends on. Return false if there is no geometry parameter + */ +//================================================================================ + +bool +StdMeshers_FixedPoints1D_i::getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const +{ + return StdMeshers_Reversible1D_i::getObjectsDependOn( entryArray, subIDArray ); +} + +//================================================================================ +/*! + * \brief Set new geometry instead of that returned by getObjectsDependOn() + */ +//================================================================================ + +bool +StdMeshers_FixedPoints1D_i::setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) +{ + return StdMeshers_Reversible1D_i::setObjectsDependOn( entryArray, subIDArray ); +} diff --git a/src/StdMeshers_I/StdMeshers_FixedPoints1D_i.hxx b/src/StdMeshers_I/StdMeshers_FixedPoints1D_i.hxx index 98d1aff47..0a86129ac 100644 --- a/src/StdMeshers_I/StdMeshers_FixedPoints1D_i.hxx +++ b/src/StdMeshers_I/StdMeshers_FixedPoints1D_i.hxx @@ -30,7 +30,7 @@ #include #include CORBA_SERVER_HEADER(SMESH_BasicHypothesis) -#include "SMESH_Hypothesis_i.hxx" +#include "StdMeshers_Reversible1D_i.hxx" #include "StdMeshers_FixedPoints1D.hxx" // ====================================================== @@ -38,7 +38,8 @@ // ====================================================== class STDMESHERS_I_EXPORT StdMeshers_FixedPoints1D_i: public virtual POA_StdMeshers::StdMeshers_FixedPoints1D, - public virtual SMESH_Hypothesis_i + public virtual SMESH_Hypothesis_i, + public virtual StdMeshers_Reversible1D_i { public: // Constructor @@ -62,23 +63,22 @@ public: // Returns list of numbers of segments SMESH::long_array* GetNbSegments(); - //Set Reversed Edges - void SetReversedEdges( const SMESH::long_array& theIDs); - - //Get Reversed Edges - SMESH::long_array* GetReversedEdges(); - - //Set the Entry of the Object - void SetObjectEntry( const char* theEntry); - - //Get Object Entry - char* GetObjectEntry(); - // Get implementation ::StdMeshers_FixedPoints1D* GetImpl(); // Verify whether hypothesis supports given entity type CORBA::Boolean IsDimSupported( SMESH::Dimension type ); + + + // Methods for copying mesh definition to other geometry + + // Return geometry this hypothesis depends on. Return false if there is no geometry parameter + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const; + + // Set new geometry instead of that returned by getObjectsDependOn() + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ); }; #endif diff --git a/src/StdMeshers_I/StdMeshers_Geometric1D_i.cxx b/src/StdMeshers_I/StdMeshers_Geometric1D_i.cxx index 1d213d975..2b5f241bc 100644 --- a/src/StdMeshers_I/StdMeshers_Geometric1D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_Geometric1D_i.cxx @@ -127,15 +127,41 @@ CORBA::Double StdMeshers_Geometric1D_i::GetCommonRatio() //================================================================================ /*! - * \brief Verify whether hypothesis supports given entity type - * \param type - dimension (see SMESH::Dimension enumeration) - * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise - * + * \brief Verify whether hypothesis supports given entity type + * \param type - dimension (see SMESH::Dimension enumeration) + * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise + * * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration) */ -//================================================================================ +//================================================================================ CORBA::Boolean StdMeshers_Geometric1D_i::IsDimSupported(::SMESH::Dimension type) { return type == SMESH::DIM_1D; } + +//================================================================================ +/*! + * \brief Return geometry this hypothesis depends on. Return false if there is no geometry parameter + */ +//================================================================================ + +bool +StdMeshers_Geometric1D_i::getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const +{ + return StdMeshers_Reversible1D_i::getObjectsDependOn( entryArray, subIDArray ); +} + +//================================================================================ +/*! + * \brief Set new geometry instead of that returned by getObjectsDependOn() + */ +//================================================================================ + +bool +StdMeshers_Geometric1D_i::setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) +{ + return StdMeshers_Reversible1D_i::setObjectsDependOn( entryArray, subIDArray ); +} diff --git a/src/StdMeshers_I/StdMeshers_Geometric1D_i.hxx b/src/StdMeshers_I/StdMeshers_Geometric1D_i.hxx index 542e88e5e..6ccb5d70a 100644 --- a/src/StdMeshers_I/StdMeshers_Geometric1D_i.hxx +++ b/src/StdMeshers_I/StdMeshers_Geometric1D_i.hxx @@ -59,6 +59,18 @@ class STDMESHERS_I_EXPORT StdMeshers_Geometric1D_i: // Get implementation ::StdMeshers_Geometric1D* GetImpl(); + + + + // Methods for copying mesh definition to other geometry + + // Return geometry this hypothesis depends on. Return false if there is no geometry parameter + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const; + + // Set new geometry instead of that returned by getObjectsDependOn() + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ); }; #endif diff --git a/src/StdMeshers_I/StdMeshers_ImportSource1D_i.hxx b/src/StdMeshers_I/StdMeshers_ImportSource1D_i.hxx index 61d62654e..ab1e9bb6c 100644 --- a/src/StdMeshers_I/StdMeshers_ImportSource1D_i.hxx +++ b/src/StdMeshers_I/StdMeshers_ImportSource1D_i.hxx @@ -64,6 +64,17 @@ class STDMESHERS_I_EXPORT StdMeshers_ImportSource1D_i: virtual void LoadFrom( const char* theStream ); virtual void UpdateAsMeshesRestored(); + + + // Methods for copying mesh definition to other geometry + + // Return geometry this hypothesis depends on. Return false if there is no geometry parameter + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const { return 0; } + + // Set new geometry instead of that returned by getObjectsDependOn() + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) { return true; } private: SMESH::string_array_var _groupEntries; std::vector< std::string > _groupIDs; diff --git a/src/StdMeshers_I/StdMeshers_ImportSource2D_i.hxx b/src/StdMeshers_I/StdMeshers_ImportSource2D_i.hxx index 8b346df67..f377bceb1 100644 --- a/src/StdMeshers_I/StdMeshers_ImportSource2D_i.hxx +++ b/src/StdMeshers_I/StdMeshers_ImportSource2D_i.hxx @@ -64,6 +64,17 @@ class STDMESHERS_I_EXPORT StdMeshers_ImportSource2D_i: virtual void LoadFrom( const char* theStream ); virtual void UpdateAsMeshesRestored(); + + + // Methods for copying mesh definition to other geometry + + // Return geometry this hypothesis depends on. Return false if there is no geometry parameter + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const { return 0; } + + // Set new geometry instead of that returned by getObjectsDependOn() + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) { return true; } private: SMESH::string_array_var _groupEntries; std::vector< std::string > _groupIDs; diff --git a/src/StdMeshers_I/StdMeshers_LayerDistribution2D_i.hxx b/src/StdMeshers_I/StdMeshers_LayerDistribution2D_i.hxx index 2831138b9..9b9ba7a52 100644 --- a/src/StdMeshers_I/StdMeshers_LayerDistribution2D_i.hxx +++ b/src/StdMeshers_I/StdMeshers_LayerDistribution2D_i.hxx @@ -54,6 +54,17 @@ public: // Verify whether hypothesis supports given entity type CORBA::Boolean IsDimSupported( SMESH::Dimension type ); + + + // Methods for copying mesh definition to other geometry + + // Return geometry this hypothesis depends on. Return false if there is no geometry parameter + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const { return 0; } + + // Set new geometry instead of that returned by getObjectsDependOn() + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) { return true; } }; #endif diff --git a/src/StdMeshers_I/StdMeshers_LayerDistribution_i.hxx b/src/StdMeshers_I/StdMeshers_LayerDistribution_i.hxx index 69050ee70..43942228c 100644 --- a/src/StdMeshers_I/StdMeshers_LayerDistribution_i.hxx +++ b/src/StdMeshers_I/StdMeshers_LayerDistribution_i.hxx @@ -77,6 +77,17 @@ public: virtual char* SaveTo(); virtual void LoadFrom( const char* theStream ); + + + // Methods for copying mesh definition to other geometry + + // Return geometry this hypothesis depends on. Return false if there is no geometry parameter + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const { return 0; } + + // Set new geometry instead of that returned by getObjectsDependOn() + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) { return true; } protected: // restore myMethod2VarParams by parameters stored in an old study virtual void setOldParameters (const char* theParameters); diff --git a/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.hxx b/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.hxx index 0318fd0e1..17cde7be8 100644 --- a/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.hxx +++ b/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.hxx @@ -66,6 +66,17 @@ public: // Verify whether hypothesis supports given entity type CORBA::Boolean IsDimSupported( SMESH::Dimension type ); + + + // Methods for copying mesh definition to other geometry + + // Return geometry this hypothesis depends on. Return false if there is no geometry parameter + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const { return 0; } + + // Set new geometry instead of that returned by getObjectsDependOn() + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) { return true; } }; #endif diff --git a/src/StdMeshers_I/StdMeshers_LocalLength_i.hxx b/src/StdMeshers_I/StdMeshers_LocalLength_i.hxx index 14a01b76d..0fcd0d089 100644 --- a/src/StdMeshers_I/StdMeshers_LocalLength_i.hxx +++ b/src/StdMeshers_I/StdMeshers_LocalLength_i.hxx @@ -71,6 +71,17 @@ public: // Verify whether hypothesis supports given entity type CORBA::Boolean IsDimSupported( SMESH::Dimension type ); + + + // Methods for copying mesh definition to other geometry + + // Return geometry this hypothesis depends on. Return false if there is no geometry parameter + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const { return 0; } + + // Set new geometry instead of that returned by getObjectsDependOn() + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) { return true; } protected: virtual std::string getMethodOfParameter(const int paramIndex, int nbVars) const; }; diff --git a/src/StdMeshers_I/StdMeshers_MaxElementArea_i.hxx b/src/StdMeshers_I/StdMeshers_MaxElementArea_i.hxx index 7f7fe254f..0651ac899 100644 --- a/src/StdMeshers_I/StdMeshers_MaxElementArea_i.hxx +++ b/src/StdMeshers_I/StdMeshers_MaxElementArea_i.hxx @@ -63,6 +63,18 @@ public: // Verify whether hypothesis supports given entity type CORBA::Boolean IsDimSupported( SMESH::Dimension type ); + + + // Methods for copying mesh definition to other geometry + + // Return geometry this hypothesis depends on. Return false if there is no geometry parameter + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const { return 0; } + + // Set new geometry instead of that returned by getObjectsDependOn() + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) { return true; } + protected: virtual std::string getMethodOfParameter(const int paramIndex, int nbVars) const; }; diff --git a/src/StdMeshers_I/StdMeshers_MaxElementVolume_i.hxx b/src/StdMeshers_I/StdMeshers_MaxElementVolume_i.hxx index d40369cb7..108b9804c 100644 --- a/src/StdMeshers_I/StdMeshers_MaxElementVolume_i.hxx +++ b/src/StdMeshers_I/StdMeshers_MaxElementVolume_i.hxx @@ -63,6 +63,17 @@ public: // Verify whether hypothesis supports given entity type CORBA::Boolean IsDimSupported( SMESH::Dimension type ); + + + // Methods for copying mesh definition to other geometry + + // Return geometry this hypothesis depends on. Return false if there is no geometry parameter + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const { return 0; } + + // Set new geometry instead of that returned by getObjectsDependOn() + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) { return true; } protected: virtual std::string getMethodOfParameter(const int paramIndex, int nbVars) const; }; diff --git a/src/StdMeshers_I/StdMeshers_MaxLength_i.hxx b/src/StdMeshers_I/StdMeshers_MaxLength_i.hxx index b4b633231..bd1ea6334 100644 --- a/src/StdMeshers_I/StdMeshers_MaxLength_i.hxx +++ b/src/StdMeshers_I/StdMeshers_MaxLength_i.hxx @@ -77,6 +77,17 @@ public: // Verify whether hypothesis supports given entity type CORBA::Boolean IsDimSupported( SMESH::Dimension type ); + + + // Methods for copying mesh definition to other geometry + + // Return geometry this hypothesis depends on. Return false if there is no geometry parameter + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const { return 0; } + + // Set new geometry instead of that returned by getObjectsDependOn() + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) { return true; } protected: virtual std::string getMethodOfParameter(const int paramIndex, int nbVars) const; }; diff --git a/src/StdMeshers_I/StdMeshers_NotConformAllowed_i.hxx b/src/StdMeshers_I/StdMeshers_NotConformAllowed_i.hxx index ee4107f10..510d0cf1a 100644 --- a/src/StdMeshers_I/StdMeshers_NotConformAllowed_i.hxx +++ b/src/StdMeshers_I/StdMeshers_NotConformAllowed_i.hxx @@ -50,6 +50,17 @@ public: // Verify whether hypothesis supports given entity type CORBA::Boolean IsDimSupported( SMESH::Dimension type ); + + + // Methods for copying mesh definition to other geometry + + // Return geometry this hypothesis depends on. Return false if there is no geometry parameter + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const { return 0; } + + // Set new geometry instead of that returned by getObjectsDependOn() + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) { return true; } protected: ::StdMeshers_NotConformAllowed* _impl; }; diff --git a/src/StdMeshers_I/StdMeshers_NumberOfLayers2D_i.hxx b/src/StdMeshers_I/StdMeshers_NumberOfLayers2D_i.hxx index 42672b838..4534245a9 100644 --- a/src/StdMeshers_I/StdMeshers_NumberOfLayers2D_i.hxx +++ b/src/StdMeshers_I/StdMeshers_NumberOfLayers2D_i.hxx @@ -52,6 +52,17 @@ public: // Verify whether hypothesis supports given entity type CORBA::Boolean IsDimSupported( SMESH::Dimension type ); + + + // Methods for copying mesh definition to other geometry + + // Return geometry this hypothesis depends on. Return false if there is no geometry parameter + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const { return 0; } + + // Set new geometry instead of that returned by getObjectsDependOn() + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) { return true; } }; #endif diff --git a/src/StdMeshers_I/StdMeshers_NumberOfLayers_i.hxx b/src/StdMeshers_I/StdMeshers_NumberOfLayers_i.hxx index 77a619883..13649309f 100644 --- a/src/StdMeshers_I/StdMeshers_NumberOfLayers_i.hxx +++ b/src/StdMeshers_I/StdMeshers_NumberOfLayers_i.hxx @@ -68,6 +68,17 @@ public: // Verify whether hypothesis supports given entity type CORBA::Boolean IsDimSupported( SMESH::Dimension type ); + + + // Methods for copying mesh definition to other geometry + + // Return geometry this hypothesis depends on. Return false if there is no geometry parameter + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const { return 0; } + + // Set new geometry instead of that returned by getObjectsDependOn() + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) { return true; } protected: virtual std::string getMethodOfParameter(const int paramIndex, int nbVars) const; }; diff --git a/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx b/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx index c61aa3785..1c5163385 100644 --- a/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx +++ b/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx @@ -36,7 +36,6 @@ #include -using namespace std; //============================================================================= /*! * StdMeshers_NumberOfSegments_i::StdMeshers_NumberOfSegments_i @@ -47,8 +46,9 @@ using namespace std; StdMeshers_NumberOfSegments_i::StdMeshers_NumberOfSegments_i( PortableServer::POA_ptr thePOA, ::SMESH_Gen* theGenImpl ) - : SALOME::GenericObj_i( thePOA ), - SMESH_Hypothesis_i( thePOA ) + : SALOME::GenericObj_i( thePOA ), + SMESH_Hypothesis_i( thePOA ), + StdMeshers_Reversible1D_i( this ) { myBaseImpl = new ::StdMeshers_NumberOfSegments( theGenImpl->GetANewId(), theGenImpl ); @@ -159,100 +159,6 @@ CORBA::Long StdMeshers_NumberOfSegments_i::GetNumberOfSegments() return this->GetImpl()->GetNumberOfSegments(); } -//============================================================================= -/*! - * StdMeshers_NumberOfSegments_i::SetReversedEdges - * - * Set edges to reverse - */ -//============================================================================= - -void StdMeshers_NumberOfSegments_i::SetReversedEdges( const SMESH::long_array& theIds ) -{ - ASSERT( myBaseImpl ); - try { - std::vector ids( theIds.length() ); - CORBA::Long iEnd = theIds.length(); - for ( CORBA::Long i = 0; i < iEnd; i++ ) - ids[ i ] = theIds[ i ]; - - this->GetImpl()->SetReversedEdges( ids ); - } - catch ( SALOME_Exception& S_ex ) { - THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), - SALOME::BAD_PARAM ); - } - - // Update Python script - SMESH::TPythonDump() << _this() << ".SetReversedEdges( " << theIds << " )"; -} - -//============================================================================= -/*! - * StdMeshers_NumberOfSegments_i::SetObjectEntry - * - * Set the Entry for the Main Object - */ -//============================================================================= - -void StdMeshers_NumberOfSegments_i::SetObjectEntry( const char* theEntry ) -{ - ASSERT( myBaseImpl ); - string entry(theEntry); // actually needed as theEntry is spoiled by moment of dumping - try { - this->GetImpl()->SetObjectEntry( entry.c_str() ); - } - catch ( SALOME_Exception& S_ex ) { - THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), - SALOME::BAD_PARAM ); - } - // Update Python script - SMESH::TPythonDump() << _this() << ".SetObjectEntry( \"" << entry.c_str() << "\" )"; -} - -//============================================================================= -/*! - * StdMeshers_NumberOfSegments_i::GetObjectEntry - * - * Set the Entry for the Main Object - */ -//============================================================================= - -char* StdMeshers_NumberOfSegments_i::GetObjectEntry() -{ - ASSERT( myBaseImpl ); - - const char* entry; - try { - entry = this->GetImpl()->GetObjectEntry(); - } - catch ( SALOME_Exception& S_ex ) { - THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), - SALOME::BAD_PARAM ); - } - return CORBA::string_dup( entry ); -} - -//============================================================================= -/*! - * StdMeshers_NumberOfSegments_i::GetReversedEdges - * - * Get reversed edges - */ -//============================================================================= - -SMESH::long_array* StdMeshers_NumberOfSegments_i::GetReversedEdges() -{ - ASSERT( myBaseImpl ); - SMESH::long_array_var anArray = new SMESH::long_array; - std::vector ids = this->GetImpl()->GetReversedEdges(); - anArray->length( ids.size() ); - for ( size_t i = 0; i < ids.size(); i++) - anArray [ i ] = ids [ i ]; - - return anArray._retn(); -} - //============================================================================= /*! */ @@ -497,3 +403,30 @@ std::string StdMeshers_NumberOfSegments_i::getMethodOfParameter(const int paramI { return paramIndex == 0 ? "SetNumberOfSegments" : "SetScaleFactor"; } + + +//================================================================================ +/*! + * \brief Return geometry this hypothesis depends on. Return false if there is no geometry parameter + */ +//================================================================================ + +bool +StdMeshers_NumberOfSegments_i::getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const +{ + return StdMeshers_Reversible1D_i::getObjectsDependOn( entryArray, subIDArray ); +} + +//================================================================================ +/*! + * \brief Set new geometry instead of that returned by getObjectsDependOn() + */ +//================================================================================ + +bool +StdMeshers_NumberOfSegments_i::setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) +{ + return StdMeshers_Reversible1D_i::setObjectsDependOn( entryArray, subIDArray ); +} diff --git a/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.hxx b/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.hxx index 09301653b..fc623af13 100644 --- a/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.hxx +++ b/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.hxx @@ -35,7 +35,7 @@ #include CORBA_SERVER_HEADER(SMESH_Mesh) #include CORBA_SERVER_HEADER(SMESH_BasicHypothesis) -#include "SMESH_Hypothesis_i.hxx" +#include "StdMeshers_Reversible1D_i.hxx" #include "StdMeshers_NumberOfSegments.hxx" // ====================================================== @@ -43,7 +43,8 @@ // ====================================================== class STDMESHERS_I_EXPORT StdMeshers_NumberOfSegments_i: public virtual POA_StdMeshers::StdMeshers_NumberOfSegments, - public virtual SMESH_Hypothesis_i + public virtual SMESH_Hypothesis_i, + public virtual StdMeshers_Reversible1D_i { public: // Constructor @@ -104,18 +105,16 @@ public: // Verify whether hypothesis supports given entity type CORBA::Boolean IsDimSupported( SMESH::Dimension type ); - //Set Reversed Edges - void SetReversedEdges( const SMESH::long_array& theIDs); - //Get Reversed Edges - SMESH::long_array* GetReversedEdges(); + // Methods for copying mesh definition to other geometry - //Set Object Entry - void SetObjectEntry( const char* entry); - - //Get Object Entry - char* GetObjectEntry(); + // Return geometry this hypothesis depends on. Return false if there is no geometry parameter + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const; + // Set new geometry instead of that returned by getObjectsDependOn() + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ); protected: virtual std::string getMethodOfParameter(const int paramIndex, int nbVars) const; }; diff --git a/src/StdMeshers_I/StdMeshers_ObjRefUlils.cxx b/src/StdMeshers_I/StdMeshers_ObjRefUlils.cxx index c7e3988b8..f9a2b7837 100644 --- a/src/StdMeshers_I/StdMeshers_ObjRefUlils.cxx +++ b/src/StdMeshers_I/StdMeshers_ObjRefUlils.cxx @@ -162,3 +162,21 @@ void StdMeshers_ObjRefUlils::SaveToStream( const std::string& studyEntry, else stream << " " << studyEntry; } + +//======================================================================= +//function : EntryToShape +//purpose : Return TopoDS_Shape by a study entry +//======================================================================= + +TopoDS_Shape StdMeshers_ObjRefUlils::EntryToShape(const std::string theEntry) +{ + TopoDS_Shape shape; + + if (SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen()) { + SALOMEDS::SObject_wrap sobj = SMESH_Gen_i::getStudyServant()->FindObjectID( theEntry.c_str() ); + CORBA::Object_var obj = gen->SObjectToObject( sobj ); + GEOM::GEOM_Object_var geom = GEOM::GEOM_Object::_narrow( obj ); + shape = gen->GeomObjectToShape( geom.in() ); + } + return shape; +} diff --git a/src/StdMeshers_I/StdMeshers_ObjRefUlils.hxx b/src/StdMeshers_I/StdMeshers_ObjRefUlils.hxx index fb2540c65..757cea482 100644 --- a/src/StdMeshers_I/StdMeshers_ObjRefUlils.hxx +++ b/src/StdMeshers_I/StdMeshers_ObjRefUlils.hxx @@ -65,6 +65,13 @@ public: return TopoDS_Shape(); } + /*! + * \brief Return TopoDS_Shape by a study entry + * \param theEntry - study entry + * \retval TopoDS_Shape - result TopoDS_Shape + */ + static TopoDS_Shape EntryToShape(const std::string theEntry); + /*! * \brief Return study entry of GEOM Object */ diff --git a/src/StdMeshers_I/StdMeshers_ProjectionSource1D_i.cxx b/src/StdMeshers_I/StdMeshers_ProjectionSource1D_i.cxx index 7b4048662..e0243b187 100644 --- a/src/StdMeshers_I/StdMeshers_ProjectionSource1D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_ProjectionSource1D_i.cxx @@ -298,3 +298,46 @@ void StdMeshers_ProjectionSource1D_i::LoadFrom( const char* theStream ) str >> myShapeEntries[ i ]; } +//================================================================================ +/*! + * \brief Return geometry this hypothesis depends on. Return false if there is no geometry parameter + */ +//================================================================================ + +bool +StdMeshers_ProjectionSource1D_i::getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const +{ + for ( int i = 0; i < NB_SHAPES; ++i ) + entryArray.push_back( myShapeEntries[ i ]); + + return true; +} + +//================================================================================ +/*! + * \brief Set new geometry instead of that returned by getObjectsDependOn() + */ +//================================================================================ + +bool +StdMeshers_ProjectionSource1D_i::setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) +{ + TopoDS_Shape shapes[ NB_SHAPES ]; + for ( int i = 0; i < NB_SHAPES; ++i ) + { + myShapeEntries[ i ] = entryArray[ i ]; + shapes[ i ] = StdMeshers_ObjRefUlils::EntryToShape( entryArray[ i ]); + } + + try { + GetImpl()->SetSourceEdge ( shapes[ SRC_EDGE ] ); + GetImpl()->SetVertexAssociation( shapes[ SRC_VERTEX ], + shapes[ TGT_VERTEX ]); + } + catch (...) { + return false; + } + return true; +} diff --git a/src/StdMeshers_I/StdMeshers_ProjectionSource1D_i.hxx b/src/StdMeshers_I/StdMeshers_ProjectionSource1D_i.hxx index 1b7c6981b..bbd1e5e58 100644 --- a/src/StdMeshers_I/StdMeshers_ProjectionSource1D_i.hxx +++ b/src/StdMeshers_I/StdMeshers_ProjectionSource1D_i.hxx @@ -109,6 +109,15 @@ public: virtual char* SaveTo(); virtual void LoadFrom( const char* theStream ); + // Methods for copying mesh definition to other geometry + + // Return geometry this hypothesis depends on. Return false if there is no geometry parameter + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const; + + // Set new geometry instead of that returned by getObjectsDependOn() + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ); private: // keep entries because the same shape can be published several times with // different names and in this case a correct name can't be restored by a TopoDS_Shape diff --git a/src/StdMeshers_I/StdMeshers_ProjectionSource2D_i.cxx b/src/StdMeshers_I/StdMeshers_ProjectionSource2D_i.cxx index ff0364603..5d3706d9f 100644 --- a/src/StdMeshers_I/StdMeshers_ProjectionSource2D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_ProjectionSource2D_i.cxx @@ -311,3 +311,48 @@ void StdMeshers_ProjectionSource2D_i::LoadFrom( const char* theStream ) str >> myShapeEntries[ i ]; } +//================================================================================ +/*! + * \brief Return geometry this hypothesis depends on. Return false if there is no geometry parameter + */ +//================================================================================ + +bool +StdMeshers_ProjectionSource2D_i::getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const +{ + for ( int i = 0; i < NB_SHAPES; ++i ) + entryArray.push_back( myShapeEntries[ i ]); + + return true; +} + +//================================================================================ +/*! + * \brief Set new geometry instead of that returned by getObjectsDependOn() + */ +//================================================================================ + +bool +StdMeshers_ProjectionSource2D_i::setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) +{ + TopoDS_Shape shapes[ NB_SHAPES ]; + for ( int i = 0; i < NB_SHAPES; ++i ) + { + myShapeEntries[ i ] = entryArray[ i ]; + shapes[ i ] = StdMeshers_ObjRefUlils::EntryToShape( entryArray[ i ]); + } + + try { + GetImpl()->SetSourceFace ( shapes[ SRC_FACE ] ); + GetImpl()->SetVertexAssociation( shapes[ SRC_VERTEX1 ], + shapes[ SRC_VERTEX2 ], + shapes[ TGT_VERTEX1 ], + shapes[ TGT_VERTEX2 ]); + } + catch (...) { + return false; + } + return true; +} diff --git a/src/StdMeshers_I/StdMeshers_ProjectionSource2D_i.hxx b/src/StdMeshers_I/StdMeshers_ProjectionSource2D_i.hxx index 2ba81dc0a..e8352df31 100644 --- a/src/StdMeshers_I/StdMeshers_ProjectionSource2D_i.hxx +++ b/src/StdMeshers_I/StdMeshers_ProjectionSource2D_i.hxx @@ -113,6 +113,16 @@ public: virtual char* SaveTo(); virtual void LoadFrom( const char* theStream ); + + // Methods for copying mesh definition to other geometry + + // Return geometry this hypothesis depends on. Return false if there is no geometry parameter + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const; + + // Set new geometry instead of that returned by getObjectsDependOn() + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ); private: // keep entries because the same shape can be published several times with // different names and in this case a correct name can't be restored by a TopoDS_Shape diff --git a/src/StdMeshers_I/StdMeshers_ProjectionSource3D_i.cxx b/src/StdMeshers_I/StdMeshers_ProjectionSource3D_i.cxx index 062602d89..bbbf9e3cb 100644 --- a/src/StdMeshers_I/StdMeshers_ProjectionSource3D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_ProjectionSource3D_i.cxx @@ -312,3 +312,48 @@ void StdMeshers_ProjectionSource3D_i::LoadFrom( const char* theStream ) str >> myShapeEntries[ i ]; } +//================================================================================ +/*! + * \brief Return geometry this hypothesis depends on. Return false if there is no geometry parameter + */ +//================================================================================ + +bool +StdMeshers_ProjectionSource3D_i::getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const +{ + for ( int i = 0; i < NB_SHAPES; ++i ) + entryArray.push_back( myShapeEntries[ i ]); + + return true; +} + +//================================================================================ +/*! + * \brief Set new geometry instead of that returned by getObjectsDependOn() + */ +//================================================================================ + +bool +StdMeshers_ProjectionSource3D_i::setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) +{ + TopoDS_Shape shapes[ NB_SHAPES ]; + for ( int i = 0; i < NB_SHAPES; ++i ) + { + myShapeEntries[ i ] = entryArray[ i ]; + shapes[ i ] = StdMeshers_ObjRefUlils::EntryToShape( entryArray[ i ]); + } + + try { + GetImpl()->SetSource3DShape ( shapes[ SRC_SHAPE3D ] ); + GetImpl()->SetVertexAssociation( shapes[ SRC_VERTEX1 ], + shapes[ SRC_VERTEX2 ], + shapes[ TGT_VERTEX1 ], + shapes[ TGT_VERTEX2 ]); + } + catch (...) { + return false; + } + return true; +} diff --git a/src/StdMeshers_I/StdMeshers_ProjectionSource3D_i.hxx b/src/StdMeshers_I/StdMeshers_ProjectionSource3D_i.hxx index 5a25111cd..003181849 100644 --- a/src/StdMeshers_I/StdMeshers_ProjectionSource3D_i.hxx +++ b/src/StdMeshers_I/StdMeshers_ProjectionSource3D_i.hxx @@ -114,6 +114,17 @@ public: virtual char* SaveTo(); virtual void LoadFrom( const char* theStream ); + + // Methods for copying mesh definition to other geometry + + // Return geometry this hypothesis depends on. Return false if there is no geometry parameter + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const; + + // Set new geometry instead of that returned by getObjectsDependOn() + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ); + private: // keep entries because the same shape can be published several times with // different names and in this case a correct name can't be restored by a TopoDS_Shape @@ -124,4 +135,3 @@ private: }; #endif - diff --git a/src/StdMeshers_I/StdMeshers_Propagation_i.hxx b/src/StdMeshers_I/StdMeshers_Propagation_i.hxx index 961f203d1..ae5819c31 100644 --- a/src/StdMeshers_I/StdMeshers_Propagation_i.hxx +++ b/src/StdMeshers_I/StdMeshers_Propagation_i.hxx @@ -52,6 +52,12 @@ public: // Verify whether hypothesis supports given entity type CORBA::Boolean IsDimSupported( SMESH::Dimension type ); + + // Methods for copying mesh definition to other geometry + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const { return false; } + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) { return true; } }; // ====================================================== @@ -69,6 +75,12 @@ public: // Verify whether hypothesis supports given entity type CORBA::Boolean IsDimSupported( SMESH::Dimension type ); + + // Methods for copying mesh definition to other geometry + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const { return false; } + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) { return true; } }; #endif diff --git a/src/StdMeshers_I/StdMeshers_QuadrangleParams_i.cxx b/src/StdMeshers_I/StdMeshers_QuadrangleParams_i.cxx index 78b2841e1..aa3f947dd 100644 --- a/src/StdMeshers_I/StdMeshers_QuadrangleParams_i.cxx +++ b/src/StdMeshers_I/StdMeshers_QuadrangleParams_i.cxx @@ -378,3 +378,54 @@ void StdMeshers_QuadrangleParams_i::LoadFrom( const char* theStream ) myBaseImpl->LoadFrom( is ); } + +//================================================================================ +/*! + * \brief Return geometry this hypothesis depends on. Return false if there is no geometry parameter + */ +//================================================================================ + +bool +StdMeshers_QuadrangleParams_i::getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const +{ + const ::StdMeshers_QuadrangleParams* impl = + static_cast( myBaseImpl ); + + subIDArray.push_back( impl->GetTriaVertex() ); + + entryArray.push_back( impl->GetObjectEntry() ); + entryArray.insert( entryArray.end(), myShapeEntries.begin(), myShapeEntries.end() ); + + return true; +} + +//================================================================================ +/*! + * \brief Set new geometry instead of that returned by getObjectsDependOn() + */ +//================================================================================ + +bool +StdMeshers_QuadrangleParams_i::setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) +{ + if ( !subIDArray.empty() ) + GetImpl()->SetTriaVertex( subIDArray[0] ); + + GetImpl()->SetObjectEntry( entryArray[0].c_str() ); + + myShapeEntries.assign( ++entryArray.begin(), entryArray.end() ); + + std::vector< TopoDS_Shape > shapes; + std::vector< gp_Pnt > points; + this->GetImpl()->GetEnforcedNodes( shapes, points ); + + shapes.clear(); + for ( size_t i = 0; i < myShapeEntries.size(); ++i ) + shapes.push_back( StdMeshers_ObjRefUlils::EntryToShape( myShapeEntries[i] )); + + this->GetImpl()->SetEnforcedNodes( shapes, points ); + + return true; +} diff --git a/src/StdMeshers_I/StdMeshers_QuadrangleParams_i.hxx b/src/StdMeshers_I/StdMeshers_QuadrangleParams_i.hxx index 227dd86af..822b501e5 100644 --- a/src/StdMeshers_I/StdMeshers_QuadrangleParams_i.hxx +++ b/src/StdMeshers_I/StdMeshers_QuadrangleParams_i.hxx @@ -84,6 +84,16 @@ public: virtual char* SaveTo(); virtual void LoadFrom( const char* theStream ); + + // Methods for copying mesh definition to other geometry + + // Return geometry this hypothesis depends on. Return false if there is no geometry parameter + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const; + + // Set new geometry instead of that returned by getObjectsDependOn() + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ); protected: std::vector myShapeEntries; diff --git a/src/StdMeshers_I/StdMeshers_QuadranglePreference_i.hxx b/src/StdMeshers_I/StdMeshers_QuadranglePreference_i.hxx index e60f07329..5e0455ac0 100644 --- a/src/StdMeshers_I/StdMeshers_QuadranglePreference_i.hxx +++ b/src/StdMeshers_I/StdMeshers_QuadranglePreference_i.hxx @@ -58,6 +58,12 @@ public: // Verify whether hypothesis supports given entity type CORBA::Boolean IsDimSupported( SMESH::Dimension type ); + + // Methods for copying mesh definition to other geometry + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const { return false; } + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) { return true; } }; #endif diff --git a/src/StdMeshers_I/StdMeshers_QuadraticMesh_i.hxx b/src/StdMeshers_I/StdMeshers_QuadraticMesh_i.hxx index 71c17acad..433b73734 100644 --- a/src/StdMeshers_I/StdMeshers_QuadraticMesh_i.hxx +++ b/src/StdMeshers_I/StdMeshers_QuadraticMesh_i.hxx @@ -59,6 +59,12 @@ public: // Verify whether hypothesis supports given entity type CORBA::Boolean IsDimSupported( SMESH::Dimension type ); + + // Methods for copying mesh definition to other geometry + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const { return false; } + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) { return true; } }; #endif diff --git a/src/StdMeshers_I/StdMeshers_Reversible1D_i.cxx b/src/StdMeshers_I/StdMeshers_Reversible1D_i.cxx index 315f30b15..644aa7075 100644 --- a/src/StdMeshers_I/StdMeshers_Reversible1D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_Reversible1D_i.cxx @@ -139,5 +139,46 @@ SMESH::long_array* StdMeshers_Reversible1D_i::GetReversedEdges() ::StdMeshers_Reversible1D* StdMeshers_Reversible1D_i::GetImpl() { - return ( ::StdMeshers_Reversible1D* )myHyp->GetImpl(); + return static_cast<::StdMeshers_Reversible1D* >( myHyp->GetImpl() ); +} + +//================================================================================ +/*! + * \brief Return geometry this hypothesis depends on. Return false if there is no geometry parameter + */ +//================================================================================ + +bool +StdMeshers_Reversible1D_i::getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const +{ + const ::StdMeshers_Reversible1D* impl = ( const ::StdMeshers_Reversible1D* ) myHyp->GetImpl(); + subIDArray = impl->GetReversedEdges(); + entryArray.push_back( impl->GetObjectEntry() ); + + return true; +} + +//================================================================================ +/*! + * \brief Set new geometry instead of that returned by getObjectsDependOn() + */ +//================================================================================ + +bool +StdMeshers_Reversible1D_i::setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) +{ + std::vector< int > newIDs; + newIDs.reserve( subIDArray.size() ); + + for ( size_t i = 0; i < subIDArray.size(); ++i ) + if ( subIDArray[ i ] > 0 ) + newIDs.push_back( subIDArray[ i ]); + GetImpl()->SetReversedEdges( newIDs ); + + if ( !entryArray.empty() ) + GetImpl()->SetObjectEntry( entryArray[0].c_str() ); + + return true; } diff --git a/src/StdMeshers_I/StdMeshers_Reversible1D_i.hxx b/src/StdMeshers_I/StdMeshers_Reversible1D_i.hxx index 8e24f9102..e80041c88 100644 --- a/src/StdMeshers_I/StdMeshers_Reversible1D_i.hxx +++ b/src/StdMeshers_I/StdMeshers_Reversible1D_i.hxx @@ -36,7 +36,7 @@ #include "StdMeshers_Reversible1D.hxx" // ====================================================== -// Common metrhods of Reversible 1D hypotheses +// Common methods of Reversible 1D hypotheses // ====================================================== class STDMESHERS_I_EXPORT StdMeshers_Reversible1D_i: public virtual POA_StdMeshers::Reversible1D @@ -59,8 +59,17 @@ class STDMESHERS_I_EXPORT StdMeshers_Reversible1D_i: // Get implementation ::StdMeshers_Reversible1D* GetImpl(); + + // Methods for copying mesh definition to other geometry + + // Return geometry this hypothesis depends on. Return false if there is no geometry parameter + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const; + + // Set new geometry instead of that returned by getObjectsDependOn() + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ); private: SMESH_Hypothesis_i* myHyp; }; - #endif diff --git a/src/StdMeshers_I/StdMeshers_SegmentLengthAroundVertex_i.hxx b/src/StdMeshers_I/StdMeshers_SegmentLengthAroundVertex_i.hxx index 30ee53023..c1491a4e1 100644 --- a/src/StdMeshers_I/StdMeshers_SegmentLengthAroundVertex_i.hxx +++ b/src/StdMeshers_I/StdMeshers_SegmentLengthAroundVertex_i.hxx @@ -63,6 +63,16 @@ public: // Verify whether hypothesis supports given entity type CORBA::Boolean IsDimSupported( SMESH::Dimension type ); + + // Methods for copying mesh definition to other geometry + + // Return geometry this hypothesis depends on. Return false if there is no geometry parameter + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const { return 0; } + + // Set new geometry instead of that returned by getObjectsDependOn() + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) { return true; } protected: virtual std::string getMethodOfParameter(const int paramIndex, int nbVars) const; }; diff --git a/src/StdMeshers_I/StdMeshers_StartEndLength_i.cxx b/src/StdMeshers_I/StdMeshers_StartEndLength_i.cxx index aa38fc2ad..622474605 100644 --- a/src/StdMeshers_I/StdMeshers_StartEndLength_i.cxx +++ b/src/StdMeshers_I/StdMeshers_StartEndLength_i.cxx @@ -49,7 +49,8 @@ using namespace std; StdMeshers_StartEndLength_i::StdMeshers_StartEndLength_i( PortableServer::POA_ptr thePOA, ::SMESH_Gen* theGenImpl ) : SALOME::GenericObj_i( thePOA ), - SMESH_Hypothesis_i( thePOA ) + SMESH_Hypothesis_i( thePOA ), + StdMeshers_Reversible1D_i( this ) { myBaseImpl = new ::StdMeshers_StartEndLength( theGenImpl->GetANewId(), theGenImpl ); @@ -132,97 +133,6 @@ CORBA::Double StdMeshers_StartEndLength_i::GetLength( CORBA::Boolean theIsStart) return this->GetImpl()->GetLength( theIsStart ); } -//============================================================================= -/*! - * StdMeshers_StartEndLength_i::SetReversedEdges - * - * Set edges to reverse - */ -//============================================================================= - -void StdMeshers_StartEndLength_i::SetReversedEdges( const SMESH::long_array& theIds ) -{ - ASSERT( myBaseImpl ); - try { - std::vector ids( theIds.length() ); - CORBA::Long iEnd = theIds.length(); - for ( CORBA::Long i = 0; i < iEnd; i++ ) - ids[ i ] = theIds[ i ]; - - this->GetImpl()->SetReversedEdges( ids ); - } - catch ( SALOME_Exception& S_ex ) { - THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), - SALOME::BAD_PARAM ); - } - - // Update Python script - SMESH::TPythonDump() << _this() << ".SetReversedEdges( " << theIds << " )"; -} - -//============================================================================= -/*! - * StdMeshers_StartEndLength_i::SetObjectEntry - * - * Set the Entry for the Main Object - */ -//============================================================================= - -void StdMeshers_StartEndLength_i::SetObjectEntry( const char* theEntry ) -{ - ASSERT( myBaseImpl ); - string entry(theEntry); // actually needed as theEntry is spoiled by moment of dumping - try { - this->GetImpl()->SetObjectEntry( entry.c_str() ); - // Update Python script - SMESH::TPythonDump() << _this() << ".SetObjectEntry( '" << entry.c_str() << "' )"; - } - catch ( SALOME_Exception& S_ex ) { - THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),SALOME::BAD_PARAM ); - } -} - -//============================================================================= -/*! - * StdMeshers_StartEndLength_i::GetObjectEntry - * - * Set the Entry for the Main Object - */ -//============================================================================= - -char* StdMeshers_StartEndLength_i::GetObjectEntry() -{ - ASSERT( myBaseImpl ); - const char* entry; - try { - entry = this->GetImpl()->GetObjectEntry(); - } - catch ( SALOME_Exception& S_ex ) { - THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM ); - } - return CORBA::string_dup( entry ); -} - -//============================================================================= -/*! - * StdMeshers_StartEndLength_i::GetReversedEdges - * - * Get reversed edges - */ -//============================================================================= - -SMESH::long_array* StdMeshers_StartEndLength_i::GetReversedEdges() -{ - ASSERT( myBaseImpl ); - SMESH::long_array_var anArray = new SMESH::long_array; - std::vector ids = this->GetImpl()->GetReversedEdges(); - anArray->length( ids.size() ); - for ( CORBA::ULong i = 0; i < ids.size(); i++) - anArray [ i ] = ids [ i ]; - - return anArray._retn(); -} - //============================================================================= /*! * StdMeshers_StartEndLength_i::GetImpl @@ -261,3 +171,29 @@ std::string StdMeshers_StartEndLength_i::getMethodOfParameter(const int paramInd { return paramIndex == 0 ? "SetStartLength" : "SetEndLength"; } + +//================================================================================ +/*! + * \brief Return geometry this hypothesis depends on. Return false if there is no geometry parameter + */ +//================================================================================ + +bool +StdMeshers_StartEndLength_i::getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const +{ + return StdMeshers_Reversible1D_i::getObjectsDependOn( entryArray, subIDArray ); +} + +//================================================================================ +/*! + * \brief Set new geometry instead of that returned by getObjectsDependOn() + */ +//================================================================================ + +bool +StdMeshers_StartEndLength_i::setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) +{ + return StdMeshers_Reversible1D_i::setObjectsDependOn( entryArray, subIDArray ); +} diff --git a/src/StdMeshers_I/StdMeshers_StartEndLength_i.hxx b/src/StdMeshers_I/StdMeshers_StartEndLength_i.hxx index 50e989105..24fdb86a7 100644 --- a/src/StdMeshers_I/StdMeshers_StartEndLength_i.hxx +++ b/src/StdMeshers_I/StdMeshers_StartEndLength_i.hxx @@ -34,7 +34,7 @@ #include #include CORBA_SERVER_HEADER(SMESH_BasicHypothesis) -#include "SMESH_Hypothesis_i.hxx" +#include "StdMeshers_Reversible1D_i.hxx" #include "StdMeshers_StartEndLength.hxx" class SMESH_Gen; @@ -44,7 +44,8 @@ class SMESH_Gen; // ====================================================== class STDMESHERS_I_EXPORT StdMeshers_StartEndLength_i: public virtual POA_StdMeshers::StdMeshers_StartEndLength, - public virtual SMESH_Hypothesis_i + public virtual SMESH_Hypothesis_i, + public virtual StdMeshers_Reversible1D_i { public: // Constructor @@ -73,17 +74,16 @@ public: // Verify whether hypothesis supports given entity type CORBA::Boolean IsDimSupported( SMESH::Dimension type ); - //Set Reversed Edges - void SetReversedEdges( const SMESH::long_array& theIDs); - //Get Reversed Edges - SMESH::long_array* GetReversedEdges(); + // Methods for copying mesh definition to other geometry - //Set Object Entry - void SetObjectEntry( const char* entry); + // Return geometry this hypothesis depends on. Return false if there is no geometry parameter + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const; - //Get Object Entry - char* GetObjectEntry(); + // Set new geometry instead of that returned by getObjectsDependOn() + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ); protected: virtual std::string getMethodOfParameter(const int paramIndex, int nbVars) const; diff --git a/src/StdMeshers_I/StdMeshers_ViscousLayers2D_i.cxx b/src/StdMeshers_I/StdMeshers_ViscousLayers2D_i.cxx index 638d03d95..c5877c77f 100644 --- a/src/StdMeshers_I/StdMeshers_ViscousLayers2D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_ViscousLayers2D_i.cxx @@ -235,13 +235,13 @@ throw ( SALOME::SALOME_Exception ) //================================================================================ /*! - * \brief Verify whether hypothesis supports given entity type - * \param type - dimension (see SMESH::Dimension enumeration) - * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise - * + * \brief Verify whether hypothesis supports given entity type + * \param type - dimension (see SMESH::Dimension enumeration) + * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise + * * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration) */ -//================================================================================ +//================================================================================ CORBA::Boolean StdMeshers_ViscousLayers2D_i::IsDimSupported( SMESH::Dimension type ) { @@ -251,7 +251,7 @@ CORBA::Boolean StdMeshers_ViscousLayers2D_i::IsDimSupported( SMESH::Dimension ty //================================================================================ /*! * \brief Sets sub-mesh event listeners to clear sub-meshes of edges - * shrinked by viscous layers + * shrinked by viscous layers */ //================================================================================ @@ -259,3 +259,43 @@ void StdMeshers_ViscousLayers2D_i::UpdateAsMeshesRestored() { GetImpl()->RestoreListeners(); } + +//================================================================================ +/*! + * \brief Return geometry this hypothesis depends on. Return false if there is no geometry parameter + */ +//================================================================================ + +bool +StdMeshers_ViscousLayers2D_i::getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const +{ + const ::StdMeshers_ViscousLayers2D* impl = + static_cast( myBaseImpl ); + + subIDArray = impl->GetBndShapes(); + + return true; +} + +//================================================================================ +/*! + * \brief Set new geometry instead of that returned by getObjectsDependOn() + */ +//================================================================================ + +bool +StdMeshers_ViscousLayers2D_i::setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) +{ + std::vector< int > newIDs; + newIDs.reserve( subIDArray.size() ); + + for ( size_t i = 0; i < subIDArray.size(); ++i ) + if ( subIDArray[ i ] > 0 ) + newIDs.push_back( subIDArray[ i ]); + + GetImpl()->SetBndShapes( newIDs, GetIsToIgnoreEdges() ); + + return true; +} diff --git a/src/StdMeshers_I/StdMeshers_ViscousLayers2D_i.hxx b/src/StdMeshers_I/StdMeshers_ViscousLayers2D_i.hxx index 0b28e8597..2ca1310f5 100644 --- a/src/StdMeshers_I/StdMeshers_ViscousLayers2D_i.hxx +++ b/src/StdMeshers_I/StdMeshers_ViscousLayers2D_i.hxx @@ -73,6 +73,17 @@ class STDMESHERS_I_EXPORT StdMeshers_ViscousLayers2D_i: // Sets sub-mesh event listeners to clear sub-meshes of edges // shrinked by viscous layers virtual void UpdateAsMeshesRestored(); + + + // Methods for copying mesh definition to other geometry + + // Return geometry this hypothesis depends on. Return false if there is no geometry parameter + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const; + + // Set new geometry instead of that returned by getObjectsDependOn() + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ); }; #endif diff --git a/src/StdMeshers_I/StdMeshers_ViscousLayers_i.cxx b/src/StdMeshers_I/StdMeshers_ViscousLayers_i.cxx index 6ae54c6e8..914d92260 100644 --- a/src/StdMeshers_I/StdMeshers_ViscousLayers_i.cxx +++ b/src/StdMeshers_I/StdMeshers_ViscousLayers_i.cxx @@ -295,3 +295,44 @@ std::string StdMeshers_ViscousLayers_i::getMethodOfParameter(const int paramInde } return ""; } + + +//================================================================================ +/*! + * \brief Return geometry this hypothesis depends on. Return false if there is no geometry parameter + */ +//================================================================================ + +bool +StdMeshers_ViscousLayers_i::getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const +{ + const ::StdMeshers_ViscousLayers* impl = + static_cast( myBaseImpl ); + + subIDArray = impl->GetBndShapes(); + + return true; +} + +//================================================================================ +/*! + * \brief Set new geometry instead of that returned by getObjectsDependOn() + */ +//================================================================================ + +bool +StdMeshers_ViscousLayers_i::setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) +{ + std::vector< int > newIDs; + newIDs.reserve( subIDArray.size() ); + + for ( size_t i = 0; i < subIDArray.size(); ++i ) + if ( subIDArray[ i ] > 0 ) + newIDs.push_back( subIDArray[ i ]); + + GetImpl()->SetBndShapes( newIDs, GetIsToIgnoreFaces() ); + + return true; +} diff --git a/src/StdMeshers_I/StdMeshers_ViscousLayers_i.hxx b/src/StdMeshers_I/StdMeshers_ViscousLayers_i.hxx index 19f5835b0..246a91442 100644 --- a/src/StdMeshers_I/StdMeshers_ViscousLayers_i.hxx +++ b/src/StdMeshers_I/StdMeshers_ViscousLayers_i.hxx @@ -73,6 +73,15 @@ class STDMESHERS_I_EXPORT StdMeshers_ViscousLayers_i: // Verify whether hypothesis supports given entity type CORBA::Boolean IsDimSupported( SMESH::Dimension type ); + // Methods for copying mesh definition to other geometry + + // Return geometry this hypothesis depends on. Return false if there is no geometry parameter + virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const; + + // Set new geometry instead of that returned by getObjectsDependOn() + virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ); protected: virtual std::string getMethodOfParameter(const int paramIndex, int nbVars) const; }; -- 2.39.2