// Update Python script
TPythonDump() << "isDone = " << this << ".RemoveElements( " << IDsOfElements << " )";
+
+ if ( IDsOfElements.length() )
+ myMesh->SetIsModified( true ); // issue 0020693
+
// Remove Elements
return anEditor.Remove( IdList, false );
}
// Update Python script
TPythonDump() << "isDone = " << this << ".RemoveNodes( " << IDsOfNodes << " )";
+ if ( IDsOfNodes.length() )
+ myMesh->SetIsModified( true ); // issue 0020693
+
return anEditor.Remove( IdList, true );
}
TPythonDump() << "nodeID = " << this << ".AddNode( "
<< x << ", " << y << ", " << z << " )";
+ myMesh->SetIsModified( true ); // issue 0020693
+
return N->GetID();
}
// Update Python script
TPythonDump() << "elem0d = " << this << ".Add0DElement( " << IDOfNode <<" )";
+ myMesh->SetIsModified( true ); // issue 0020693
+
if (elem)
return elem->GetID();
}
if(elem)
- return elem->GetID();
+ return myMesh->SetIsModified( true ), elem->GetID();
return 0;
}
TPythonDump() << "faceID = " << this << ".AddFace( " << IDsOfNodes << " )";
if(elem)
- return elem->GetID();
+ return myMesh->SetIsModified( true ), elem->GetID();
return 0;
}
// Update Python script
TPythonDump() <<"faceID = "<<this<<".AddPolygonalFace( "<<IDsOfNodes<<" )";
- return elem ? elem->GetID() : 0;
+ return elem ? ( myMesh->SetIsModified( true ), elem->GetID()) : 0;
}
//=============================================================================
TPythonDump() << "volID = " << this << ".AddVolume( " << IDsOfNodes << " )";
if(elem)
- return elem->GetID();
+ return myMesh->SetIsModified( true ), elem->GetID();
return 0;
}
TPythonDump() << "volID = " << this << ".AddPolyhedralVolume( "
<< IDsOfNodes << ", " << Quantities << " )";
- return elem ? elem->GetID() : 0;
+ return elem ? ( myMesh->SetIsModified( true ), elem->GetID()) : 0;
}
//=============================================================================
TPythonDump() << "volID = " << this << ".AddPolyhedralVolumeByFaces( "
<< IdsOfFaces << " )";
- return elem ? elem->GetID() : 0;
+ return elem ? ( myMesh->SetIsModified( true ), elem->GetID()) : 0;
}
//=============================================================================
THROW_SALOME_CORBA_EXCEPTION("Invalid VertexID", SALOME::BAD_PARAM);
mesh->SetNodeOnVertex( node, VertexID );
+
+ myMesh->SetIsModified( true );
}
//=============================================================================
THROW_SALOME_CORBA_EXCEPTION("Invalid paramOnEdge", SALOME::BAD_PARAM);
mesh->SetNodeOnEdge( node, EdgeID, paramOnEdge );
+
+ myMesh->SetIsModified( true );
}
//=============================================================================
}
mesh->SetNodeOnFace( node, FaceID, u, v );
+
+ myMesh->SetIsModified( true );
}
//=============================================================================
THROW_SALOME_CORBA_EXCEPTION("Invalid SolidID", SALOME::BAD_PARAM);
mesh->SetNodeInVolume( node, SolidID );
+
+ // myMesh->SetIsModified( true ); - SetNodeInVolume() can't prevent re-compute, I believe
}
//=============================================================================
THROW_SALOME_CORBA_EXCEPTION("Invalid shape type", SALOME::BAD_PARAM);
mesh->SetMeshElementOnShape( elem, ShapeID );
+
+ myMesh->SetIsModified( true );
}
//=============================================================================
TPythonDump() << "isDone = " << this << ".InverseDiag( "
<< NodeID1 << ", " << NodeID2 << " )";
+ myMesh->SetIsModified( true );
+
::SMESH_MeshEditor aMeshEditor( myMesh );
return aMeshEditor.InverseDiag ( n1, n2 );
}
bool stat = aMeshEditor.DeleteDiag ( n1, n2 );
+ if ( stat )
+ myMesh->SetIsModified( true ); // issue 0020693
+
storeResult(aMeshEditor);
return stat;
// Update Python script
TPythonDump() << "isDone = " << this << ".Reorient( " << IDsOfElements << " )";
+ if ( IDsOfElements.length() )
+ myMesh->SetIsModified( true ); // issue 0020693
+
return true;
}
{
initData();
+ TPythonDump aTPythonDump; // suppress dump in Reorient()
+
SMESH::long_array_var anElementsId = theObject->GetIDs();
CORBA::Boolean isDone = Reorient(anElementsId);
- // Clear python line, created by Reorient()
- SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
- aSMESHGen->RemoveLastFromPythonScript(aSMESHGen->GetCurrentStudyID());
-
// Update Python script
- TPythonDump() << "isDone = " << this << ".ReorientObject( " << theObject << " )";
+ aTPythonDump << "isDone = " << this << ".ReorientObject( " << theObject << " )";
return isDone;
}
::SMESH_MeshEditor anEditor( myMesh );
bool stat = anEditor.TriToQuad( faces, aCrit, MaxAngle );
+ if ( stat )
+ myMesh->SetIsModified( true ); // issue 0020693
storeResult(anEditor);
{
initData();
+ TPythonDump aTPythonDump; // suppress dump in TriToQuad()
SMESH::long_array_var anElementsId = theObject->GetIDs();
CORBA::Boolean isDone = TriToQuad(anElementsId, Criterion, MaxAngle);
- // Clear python line(s), created by TriToQuad()
- SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
- aSMESHGen->RemoveLastFromPythonScript(aSMESHGen->GetCurrentStudyID());
-
SMESH::NumericalFunctor_i* aNumericalFunctor =
SMESH::DownCast<SMESH::NumericalFunctor_i*>( Criterion );
// Update Python script
- TPythonDump() << "isDone = " << this << ".TriToQuadObject("
- << theObject << ", " << aNumericalFunctor << ", " << MaxAngle << " )";
+ aTPythonDump << "isDone = " << this << ".TriToQuadObject("
+ << theObject << ", " << aNumericalFunctor << ", " << MaxAngle << " )";
return isDone;
}
::SMESH_MeshEditor anEditor( myMesh );
CORBA::Boolean stat = anEditor.QuadToTri( faces, aCrit );
+ if ( stat )
+ myMesh->SetIsModified( true ); // issue 0020693
storeResult(anEditor);
{
initData();
+ TPythonDump aTPythonDump; // suppress dump in QuadToTri()
+
SMESH::long_array_var anElementsId = theObject->GetIDs();
CORBA::Boolean isDone = QuadToTri(anElementsId, Criterion);
- // Clear python line(s), created by QuadToTri()
- SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
- aSMESHGen->RemoveLastFromPythonScript(aSMESHGen->GetCurrentStudyID());
-
SMESH::NumericalFunctor_i* aNumericalFunctor =
SMESH::DownCast<SMESH::NumericalFunctor_i*>( Criterion );
// Update Python script
- TPythonDump() << "isDone = " << this << ".QuadToTriObject( " << theObject << ", " << aNumericalFunctor << " )";
+ aTPythonDump << "isDone = " << this << ".QuadToTriObject( " << theObject << ", " << aNumericalFunctor << " )";
return isDone;
}
::SMESH_MeshEditor anEditor( myMesh );
CORBA::Boolean stat = anEditor.QuadToTri( faces, Diag13 );
+ if ( stat )
+ myMesh->SetIsModified( true ); // issue 0020693
+
storeResult(anEditor);
{
initData();
+ TPythonDump aTPythonDump; // suppress dump in SplitQuad()
+
SMESH::long_array_var anElementsId = theObject->GetIDs();
CORBA::Boolean isDone = SplitQuad(anElementsId, Diag13);
- // Clear python line(s), created by SplitQuad()
- SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
- aSMESHGen->RemoveLastFromPythonScript(aSMESHGen->GetCurrentStudyID());
-
// Update Python script
- TPythonDump() << "isDone = " << this << ".SplitQuadObject( "
- << theObject << ", " << Diag13 << " )";
+ aTPythonDump << "isDone = " << this << ".SplitQuadObject( "
+ << theObject << ", " << Diag13 << " )";
return isDone;
}
::SMESH_MeshEditor anEditor (myMesh);
anEditor.SplitVolumesIntoTetra( elemSet, int( methodFlags ));
+ storeResult(anEditor);
+
+// if ( myLastCreatedElems.length() ) - it does not influence Compute()
+// myMesh->SetIsModified( true ); // issue 0020693
+
TPythonDump() << this << ".SplitVolumesIntoTetra( "
<< elems << ", " << methodFlags << " )";
}
anEditor.Smooth(elements, fixedNodes, method,
MaxNbOfIterations, MaxAspectRatio, IsParametric );
+ myMesh->SetIsModified( true ); // issue 0020693
+
storeResult(anEditor);
// Update Python script
{
initData();
+ TPythonDump aTPythonDump; // suppress dump in smooth()
+
SMESH::long_array_var anElementsId = theObject->GetIDs();
CORBA::Boolean isDone = smooth (anElementsId, IDsOfFixedNodes, MaxNbOfIterations,
MaxAspectRatio, Method, IsParametric);
- // Clear python line(s), created by Smooth()
- SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
- aSMESHGen->RemoveLastFromPythonScript(aSMESHGen->GetCurrentStudyID());
-
// Update Python script
- TPythonDump() << "isDone = " << this << "."
- << (IsParametric ? "SmoothParametricObject( " : "SmoothObject( ")
- << theObject << ", " << IDsOfFixedNodes << ", "
- << MaxNbOfIterations << ", " << MaxAspectRatio << ", "
- << "SMESH.SMESH_MeshEditor."
- << ( Method == SMESH::SMESH_MeshEditor::CENTROIDAL_SMOOTH ?
- "CENTROIDAL_SMOOTH )" : "LAPLACIAN_SMOOTH )");
+ aTPythonDump << "isDone = " << this << "."
+ << (IsParametric ? "SmoothParametricObject( " : "SmoothObject( ")
+ << theObject << ", " << IDsOfFixedNodes << ", "
+ << MaxNbOfIterations << ", " << MaxAspectRatio << ", "
+ << "SMESH.SMESH_MeshEditor."
+ << ( Method == SMESH::SMESH_MeshEditor::CENTROIDAL_SMOOTH ?
+ "CENTROIDAL_SMOOTH )" : "LAPLACIAN_SMOOTH )");
return isDone;
}
theNbOfSteps, theTolerance, theMakeGroups, makeWalls);
storeResult(anEditor);
+ // myMesh->SetIsModified( true ); -- it does not influence Compute()
+
return theMakeGroups ? getGroups(groupIds.get()) : 0;
}
::SMESH_MeshEditor::PGroupIDs groupIds =
anEditor.Transform (elements, aTrsf, theCopy, theMakeGroups, theTargetMesh);
- if(theCopy) {
+ if(theCopy)
storeResult(anEditor);
- }
+ else
+ myMesh->SetIsModified( true );
+
return theMakeGroups ? getGroups(groupIds.get()) : 0;
}
if(theCopy)
storeResult(anEditor);
+ else
+ myMesh->SetIsModified( true );
return theMakeGroups ? getGroups(groupIds.get()) : 0;
}
::SMESH_MeshEditor::PGroupIDs groupIds =
anEditor.Transform (elements, aTrsf, theCopy, theMakeGroups, theTargetMesh);
- if(theCopy) {
+ if(theCopy)
storeResult(anEditor);
- }
+ else
+ myMesh->SetIsModified( true );
+
return theMakeGroups ? getGroups(groupIds.get()) : 0;
}
if(theCopy)
storeResult(anEditor);
+ else
+ myMesh->SetIsModified( true );
return theMakeGroups ? getGroups(groupIds.get()) : 0;
}
SMESHDS_Mesh* aMesh = GetMeshDS();
set<const SMDS_MeshNode*> nodes;
- if ( !CORBA::is_nil(SMESH::SMESH_GroupBase::_narrow(theObject)) &&
- SMESH::SMESH_GroupBase::_narrow(theObject)->GetType() == SMESH::NODE) {
+ SMESH::SMESH_GroupBase_var group = SMESH::SMESH_GroupBase::_narrow(theObject);
+ if ( !group->_is_nil() && group->GetType() == SMESH::NODE)
+ {
for(int i = 0; i < aElementsId->length(); i++) {
CORBA::Long ind = aElementsId[i];
const SMDS_MeshNode * elem = aMesh->FindNode(ind);
anEditor.MergeNodes( aListOfListOfNodes );
aTPythonDump << "])";
+
+ myMesh->SetIsModified( true );
}
//=======================================================================
SMESH::array_of_long_array_out GroupsOfElementsID)
{
initData();
- if ( !(!CORBA::is_nil(SMESH::SMESH_GroupBase::_narrow(theObject)) &&
- SMESH::SMESH_GroupBase::_narrow(theObject)->GetType() == SMESH::NODE) ) {
+
+ SMESH::SMESH_GroupBase_var group = SMESH::SMESH_GroupBase::_narrow(theObject);
+ if ( !(!group->_is_nil() && group->GetType() == SMESH::NODE) )
+ {
typedef list<int> TListOfIDs;
set<const SMDS_MeshElement*> elems;
SMESH::long_array_var aElementsId = theObject->GetIDs();
::SMESH_MeshEditor anEditor( myMesh );
anEditor.MergeElements(aListOfListOfElementsID);
+ myMesh->SetIsModified( true );
+
aTPythonDump << "] )";
}
TPythonDump() << "isDone = " << this << ".MoveNode( "
<< NodeID << ", " << x << ", " << y << ", " << z << " )";
+ myMesh->SetIsModified( true );
+
return true;
}
}
}
- if ( !myPreviewMode ) {
+ if ( !myPreviewMode )
+ {
TPythonDump() << "nodeID = " << this
<< ".MoveClosestNodeToPoint( "<< x << ", " << y << ", " << z
<< ", " << nodeID << " )";
+
+ myMesh->SetIsModified( true );
}
return nodeID;
storeResult(anEditor);
+ myMesh->SetIsModified( true );
+
return error;
}
storeResult(anEditor);
+ myMesh->SetIsModified( true );
+
return error;
}
storeResult(anEditor);
+ myMesh->SetIsModified( true );
+
return error;
}
storeResult(anEditor);
+ myMesh->SetIsModified( true );
+
return error;
}
TPythonDump() << "isDone = " << this << ".ChangeElemNodes( "
<< ide << ", " << newIDs << " )";
- return GetMeshDS()->ChangeElementNodes( elem, & aNodes[0], nbn1+1 );
+ bool res = GetMeshDS()->ChangeElementNodes( elem, & aNodes[0], nbn1+1 );
+
+ if ( res )
+ myMesh->SetIsModified( true );
+
+ return res;
}
//================================================================================
::SMESH_MeshEditor anEditor( myMesh );
anEditor.ConvertToQuadratic(theForce3d);
TPythonDump() << this << ".ConvertToQuadratic( " << theForce3d << " )";
+ myMesh->SetIsModified( true );
}
//=======================================================================
::SMESH_MeshEditor anEditor( myMesh );
CORBA::Boolean isDone = anEditor.ConvertFromQuadratic();
TPythonDump() << this << ".ConvertFromQuadratic()";
+ if ( isDone )
+ myMesh->SetIsModified( true );
return isDone;
}
bool aResult = aMeshEditor.DoubleNodes( aListOfNodes, aListOfElems );
storeResult( aMeshEditor) ;
+ if ( aResult )
+ myMesh->SetIsModified( true );
return aResult;
}
SMESH::long_array_var aNodes = new SMESH::long_array;
aNodes->length( 1 );
aNodes[ 0 ] = theNodeId;
- return DoubleNodes( aNodes, theModifiedElems );
+ bool done = DoubleNodes( aNodes, theModifiedElems );
+ if ( done )
+ myMesh->SetIsModified( true );
+ return done;
}
//================================================================================
aModifiedElems->length( 0 );
}
- return DoubleNodes( aNodes, aModifiedElems );
+ bool done = DoubleNodes( aNodes, aModifiedElems );
+
+ if ( done )
+ myMesh->SetIsModified( true );
+
+ return done;
}
//================================================================================
storeResult( aMeshEditor) ;
+ if ( aResult )
+ myMesh->SetIsModified( true );
+
return aResult;
}
storeResult( aMeshEditor) ;
+ if ( aResult )
+ myMesh->SetIsModified( true );
+
// Update Python script
TPythonDump() << "isDone = " << this << ".DoubleNodes( " << theElems << ", "
<< theNodesNot << ", " << theAffectedElems << " )";
storeResult( aMeshEditor) ;
+ if ( aResult )
+ myMesh->SetIsModified( true );
+
// Update Python script
TPythonDump() << "isDone = " << this << ".DoubleNodesInRegion( " << theElems << ", "
<< theNodesNot << ", " << theShape << " )";
arrayToSet( anIDs, theMeshDS, theElemSet, theType);
}
-CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElemGroup(
- SMESH::SMESH_GroupBase_ptr theElems,
+CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElemGroup(SMESH::SMESH_GroupBase_ptr theElems,
SMESH::SMESH_GroupBase_ptr theNodesNot,
- SMESH::SMESH_GroupBase_ptr theAffectedElems )
-
+ SMESH::SMESH_GroupBase_ptr theAffectedElems)
{
if ( CORBA::is_nil( theElems ) && theElems->GetType() == SMESH::NODE )
return false;
storeResult( aMeshEditor) ;
+ if ( aResult )
+ myMesh->SetIsModified( true );
+
// Update Python script
TPythonDump() << "isDone = " << this << ".DoubleNodeGroup( " << theElems << ", "
<< theNodesNot << ", " << theAffectedElems << " )";
storeResult( aMeshEditor) ;
+ if ( aResult )
+ myMesh->SetIsModified( true );
+
// Update Python script
TPythonDump() << "isDone = " << this << ".DoubleNodeGroupInRegion( " << theElems << ", "
<< theNodesNot << ", " << theShape << " )";
}
}
-CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElemGroups(
- const SMESH::ListOfGroups& theElems,
+CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElemGroups(const SMESH::ListOfGroups& theElems,
const SMESH::ListOfGroups& theNodesNot,
- const SMESH::ListOfGroups& theAffectedElems )
+ const SMESH::ListOfGroups& theAffectedElems)
{
initData();
storeResult( aMeshEditor) ;
+ if ( aResult )
+ myMesh->SetIsModified( true );
+
// Update Python script
TPythonDump() << "isDone = " << this << ".DoubleNodeElemGroups( " << &theElems << ", "
<< &theNodesNot << ", " << &theAffectedElems << " )";
*/
//================================================================================
-CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElemGroupsInRegion(
- const SMESH::ListOfGroups& theElems,
- const SMESH::ListOfGroups& theNodesNot,
- GEOM::GEOM_Object_ptr theShape )
+CORBA::Boolean
+SMESH_MeshEditor_i::DoubleNodeElemGroupsInRegion(const SMESH::ListOfGroups& theElems,
+ const SMESH::ListOfGroups& theNodesNot,
+ GEOM::GEOM_Object_ptr theShape )
{
initData();
storeResult( aMeshEditor) ;
+ if ( aResult )
+ myMesh->SetIsModified( true );
+
// Update Python script
TPythonDump() << "isDone = " << this << ".DoubleNodeGroupsInRegion( " << &theElems << ", "
<< &theNodesNot << ", " << theShape << " )";