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=6a4799a73c29c14fdb8e5f74f920b41a3f10a5cd;hp=a908b3d1441408fcb5fa1379a7220ef060fe90d1;hb=7411bcf53c885c39859a769c4adbc2a256448d75;hpb=22496e8ddca45c3f0307628bf2c6661c212d11fd diff --git a/src/SMESH_I/SMESH_MeshEditor_i.cxx b/src/SMESH_I/SMESH_MeshEditor_i.cxx index a908b3d14..6a4799a73 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.cxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.cxx @@ -533,6 +533,62 @@ void SMESH_MeshEditor_i::ExtrusionSweepObject(SMESH::SMESH_IDSource_ptr theObjec ExtrusionSweep(anElementsId, theStepVector, theNbOfSteps); } +//======================================================================= +//function : ExtrusionSweepObject1D +//purpose : +//======================================================================= + +void SMESH_MeshEditor_i::ExtrusionSweepObject1D(SMESH::SMESH_IDSource_ptr theObject, + const SMESH::DirStruct & theStepVector, + CORBA::Long theNbOfSteps) +{ + SMESHDS_Mesh* aMesh = GetMeshDS(); + + SMESH::long_array_var allElementsId = theObject->GetIDs(); + + set elements; + for (int i = 0; i < allElementsId->length(); i++) + { + CORBA::Long index = allElementsId[i]; + const SMDS_MeshElement * elem = aMesh->FindElement(index); + if ( elem && elem->GetType() == SMDSAbs_Edge ) + elements.insert( elem ); + } + const SMESH::PointStruct * P = &theStepVector.PS; + gp_Vec stepVec( P->x, P->y, P->z ); + + ::SMESH_MeshEditor anEditor( _myMesh ); + anEditor.ExtrusionSweep (elements, stepVec, theNbOfSteps); +} + +//======================================================================= +//function : ExtrusionSweepObject2D +//purpose : +//======================================================================= + +void SMESH_MeshEditor_i::ExtrusionSweepObject2D(SMESH::SMESH_IDSource_ptr theObject, + const SMESH::DirStruct & theStepVector, + CORBA::Long theNbOfSteps) +{ + SMESHDS_Mesh* aMesh = GetMeshDS(); + + SMESH::long_array_var allElementsId = theObject->GetIDs(); + + set elements; + for (int i = 0; i < allElementsId->length(); i++) + { + CORBA::Long index = allElementsId[i]; + const SMDS_MeshElement * elem = aMesh->FindElement(index); + if ( elem && elem->GetType() == SMDSAbs_Face ) + elements.insert( elem ); + } + const SMESH::PointStruct * P = &theStepVector.PS; + gp_Vec stepVec( P->x, P->y, P->z ); + + ::SMESH_MeshEditor anEditor( _myMesh ); + anEditor.ExtrusionSweep (elements, stepVec, theNbOfSteps); +} + #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 )