X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_MeshEditor_i.cxx;h=76f79d76b37b6cf36603842e64b0c609247dfdf8;hp=0c46be9fe4b994850d2c7639fea6db5369e61fc3;hb=868e306e098d4ca6bfd1d183f0a57fb9cb805086;hpb=9efbaa6f5e4947bdcfdd04e5412ae1ece49b02fd diff --git a/src/SMESH_I/SMESH_MeshEditor_i.cxx b/src/SMESH_I/SMESH_MeshEditor_i.cxx index 0c46be9fe..76f79d76b 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.cxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.cxx @@ -45,6 +45,9 @@ #include +typedef map > TElemOfElemListMap; + using namespace std; //======================================================================= @@ -950,7 +953,9 @@ void SMESH_MeshEditor_i::ExtrusionSweep(const SMESH::long_array & theIDsOfElemen gp_Vec stepVec( P->x, P->y, P->z ); ::SMESH_MeshEditor anEditor( _myMesh ); - anEditor.ExtrusionSweep (elements, stepVec, theNbOfSteps); + //anEditor.ExtrusionSweep (elements, stepVec, theNbOfSteps); + TElemOfElemListMap aHystory; + anEditor.ExtrusionSweep (elements, stepVec, theNbOfSteps, aHystory); // Update Python script TCollection_AsciiString str = "stepVector = SMESH.DirStruct( SMESH.PointStruct ( "; @@ -987,6 +992,7 @@ void SMESH_MeshEditor_i::ExtrusionSweepObject(SMESH::SMESH_IDSource_ptr theObjec str += TCollection_AsciiString((int)theNbOfSteps) + " )"; SMESH_Gen_i::AddToCurrentPyScript( str ); } + //======================================================================= //function : ExtrusionSweepObject1D //purpose : @@ -1012,7 +1018,9 @@ void SMESH_MeshEditor_i::ExtrusionSweepObject1D(SMESH::SMESH_IDSource_ptr theObj gp_Vec stepVec( P->x, P->y, P->z ); ::SMESH_MeshEditor anEditor( _myMesh ); - anEditor.ExtrusionSweep (elements, stepVec, theNbOfSteps); + //anEditor.ExtrusionSweep (elements, stepVec, theNbOfSteps); + TElemOfElemListMap aHystory; + anEditor.ExtrusionSweep (elements, stepVec, theNbOfSteps, aHystory); } //======================================================================= @@ -1040,9 +1048,56 @@ void SMESH_MeshEditor_i::ExtrusionSweepObject2D(SMESH::SMESH_IDSource_ptr theObj gp_Vec stepVec( P->x, P->y, P->z ); ::SMESH_MeshEditor anEditor( _myMesh ); - anEditor.ExtrusionSweep (elements, stepVec, theNbOfSteps); + //anEditor.ExtrusionSweep (elements, stepVec, theNbOfSteps); + TElemOfElemListMap aHystory; + anEditor.ExtrusionSweep (elements, stepVec, theNbOfSteps, aHystory); +} + + +//======================================================================= +//function : AdvancedExtrusion +//purpose : +//======================================================================= + +void SMESH_MeshEditor_i::AdvancedExtrusion(const SMESH::long_array & theIDsOfElements, + const SMESH::DirStruct & theStepVector, + CORBA::Long theNbOfSteps, + CORBA::Long theExtrFlags, + CORBA::Double theSewTolerance) +{ + SMESHDS_Mesh* aMesh = GetMeshDS(); + + set elements; + for (int i = 0; i < theIDsOfElements.length(); i++) + { + CORBA::Long index = theIDsOfElements[i]; + const SMDS_MeshElement * elem = aMesh->FindElement(index); + if ( elem ) + elements.insert( elem ); + } + const SMESH::PointStruct * P = &theStepVector.PS; + gp_Vec stepVec( P->x, P->y, P->z ); + + ::SMESH_MeshEditor anEditor( _myMesh ); + TElemOfElemListMap aHystory; + anEditor.ExtrusionSweep (elements, stepVec, theNbOfSteps, aHystory, + theExtrFlags, theSewTolerance); + + // Update Python script + TCollection_AsciiString str = "stepVector = SMESH.DirStruct( SMESH.PointStruct ( "; + str += (TCollection_AsciiString) stepVec.X() + ", "; + str += (TCollection_AsciiString) stepVec.Y() + ", "; + str += (TCollection_AsciiString) stepVec.Z() + " ))"; + SMESH_Gen_i::AddToCurrentPyScript( str ); + str = ("mesh_editor.AdvancedExtrusion("); + SMESH_Gen_i::AddArray( str, theIDsOfElements ) += ", stepVector, "; + str += TCollection_AsciiString((int)theNbOfSteps) + ","; + str += TCollection_AsciiString((int)theExtrFlags) + ", "; + str += TCollection_AsciiString((double)theSewTolerance) + " )"; + SMESH_Gen_i::AddToCurrentPyScript( str ); } + #define RETCASE(enm) case ::SMESH_MeshEditor::enm: return SMESH::SMESH_MeshEditor::enm; static SMESH::SMESH_MeshEditor::Extrusion_Error convExtrError( const::SMESH_MeshEditor::Extrusion_Error e )