- // invalid path
- Error = SMESH::SMESH_MeshEditor::EXTR_BAD_PATH_SHAPE;
- return EmptyGr;
- }
-
- Error = convExtrError( error );
-
- if ( MakeGroups ) {
- list<int> groupIDs = myMesh->GetGroupIds();
- list<int>::iterator newBegin = groupIDs.begin();
- std::advance( newBegin, nbOldGroups ); // skip old groups
- groupIDs.erase( groupIDs.begin(), newBegin );
- return getGroups( & groupIDs );
- }
- return EmptyGr;
-
- SMESH_CATCH( SMESH::throwCorbaException );
- return 0;
-}
-
-//=======================================================================
-//function : ExtrusionAlongPath
-//purpose :
-//=======================================================================
-
-SMESH::SMESH_MeshEditor::Extrusion_Error
-SMESH_MeshEditor_i::ExtrusionAlongPath(const SMESH::long_array & theIDsOfElements,
- SMESH::SMESH_Mesh_ptr thePathMesh,
- GEOM::GEOM_Object_ptr thePathShape,
- CORBA::Long theNodeStart,
- CORBA::Boolean theHasAngles,
- const SMESH::double_array & theAngles,
- CORBA::Boolean theHasRefPoint,
- const SMESH::PointStruct & theRefPoint)
- throw (SALOME::SALOME_Exception)
-{
- MESSAGE("ExtrusionAlongPath");
- if ( !myIsPreviewMode ) {
- TPythonDump() << "error = " << this << ".ExtrusionAlongPath( "
- << theIDsOfElements << ", "
- << thePathMesh << ", "
- << thePathShape << ", "
- << theNodeStart << ", "
- << theHasAngles << ", "
- << theAngles << ", "
- << theHasRefPoint << ", "
- << "SMESH.PointStruct( "
- << ( theHasRefPoint ? theRefPoint.x : 0 ) << ", "
- << ( theHasRefPoint ? theRefPoint.y : 0 ) << ", "
- << ( theHasRefPoint ? theRefPoint.z : 0 ) << " ) )";
- }
- SMESH::SMESH_MeshEditor::Extrusion_Error anError;
- extrusionAlongPath( theIDsOfElements,
- thePathMesh,
- thePathShape,
- theNodeStart,
- theHasAngles,
- theAngles,
- theHasRefPoint,
- theRefPoint,
- false,
- anError);
- return anError;
-}
-
-//=======================================================================
-//function : ExtrusionAlongPathObject
-//purpose :
-//=======================================================================
-
-SMESH::SMESH_MeshEditor::Extrusion_Error
-SMESH_MeshEditor_i::ExtrusionAlongPathObject(SMESH::SMESH_IDSource_ptr theObject,
- SMESH::SMESH_Mesh_ptr thePathMesh,
- GEOM::GEOM_Object_ptr thePathShape,
- CORBA::Long theNodeStart,
- CORBA::Boolean theHasAngles,
- const SMESH::double_array & theAngles,
- CORBA::Boolean theHasRefPoint,
- const SMESH::PointStruct & theRefPoint)
- throw (SALOME::SALOME_Exception)
-{
- if ( !myIsPreviewMode ) {
- TPythonDump() << "error = " << this << ".ExtrusionAlongPathObject( "
- << theObject << ", "
- << thePathMesh << ", "
- << thePathShape << ", "
- << theNodeStart << ", "
- << theHasAngles << ", "
- << theAngles << ", "
- << theHasRefPoint << ", "
- << "SMESH.PointStruct( "
- << ( theHasRefPoint ? theRefPoint.x : 0 ) << ", "
- << ( theHasRefPoint ? theRefPoint.y : 0 ) << ", "
- << ( theHasRefPoint ? theRefPoint.z : 0 ) << " ) )";
- }
- SMESH::SMESH_MeshEditor::Extrusion_Error anError;
- prepareIdSource( theObject );
- SMESH::long_array_var anElementsId = theObject->GetIDs();
- extrusionAlongPath( anElementsId,
- thePathMesh,
- thePathShape,
- theNodeStart,
- theHasAngles,
- theAngles,
- theHasRefPoint,
- theRefPoint,
- false,
- anError);
- return anError;
-}
-
-//=======================================================================
-//function : ExtrusionAlongPathObject1D
-//purpose :
-//=======================================================================
-
-SMESH::SMESH_MeshEditor::Extrusion_Error
-SMESH_MeshEditor_i::ExtrusionAlongPathObject1D(SMESH::SMESH_IDSource_ptr theObject,
- SMESH::SMESH_Mesh_ptr thePathMesh,
- GEOM::GEOM_Object_ptr thePathShape,
- CORBA::Long theNodeStart,
- CORBA::Boolean theHasAngles,
- const SMESH::double_array & theAngles,
- CORBA::Boolean theHasRefPoint,
- const SMESH::PointStruct & theRefPoint)
- throw (SALOME::SALOME_Exception)
-{
- if ( !myIsPreviewMode ) {
- TPythonDump() << "error = " << this << ".ExtrusionAlongPathObject1D( "
- << theObject << ", "
- << thePathMesh << ", "
- << thePathShape << ", "
- << theNodeStart << ", "
- << theHasAngles << ", "
- << theAngles << ", "
- << theHasRefPoint << ", "
- << "SMESH.PointStruct( "
- << ( theHasRefPoint ? theRefPoint.x : 0 ) << ", "
- << ( theHasRefPoint ? theRefPoint.y : 0 ) << ", "
- << ( theHasRefPoint ? theRefPoint.z : 0 ) << " ) )";
- }
- SMESH::SMESH_MeshEditor::Extrusion_Error anError;
- prepareIdSource( theObject );
- SMESH::long_array_var anElementsId = theObject->GetIDs();
- extrusionAlongPath( anElementsId,
- thePathMesh,
- thePathShape,
- theNodeStart,
- theHasAngles,
- theAngles,
- theHasRefPoint,
- theRefPoint,
- false,
- anError,
- SMDSAbs_Edge);
- return anError;
-}
-
-//=======================================================================
-//function : ExtrusionAlongPathObject2D
-//purpose :
-//=======================================================================
-
-SMESH::SMESH_MeshEditor::Extrusion_Error
-SMESH_MeshEditor_i::ExtrusionAlongPathObject2D(SMESH::SMESH_IDSource_ptr theObject,
- SMESH::SMESH_Mesh_ptr thePathMesh,
- GEOM::GEOM_Object_ptr thePathShape,
- CORBA::Long theNodeStart,
- CORBA::Boolean theHasAngles,
- const SMESH::double_array & theAngles,
- CORBA::Boolean theHasRefPoint,
- const SMESH::PointStruct & theRefPoint)
- throw (SALOME::SALOME_Exception)
-{
- if ( !myIsPreviewMode ) {
- TPythonDump() << "error = " << this << ".ExtrusionAlongPathObject2D( "
- << theObject << ", "
- << thePathMesh << ", "
- << thePathShape << ", "
- << theNodeStart << ", "
- << theHasAngles << ", "
- << theAngles << ", "
- << theHasRefPoint << ", "
- << "SMESH.PointStruct( "
- << ( theHasRefPoint ? theRefPoint.x : 0 ) << ", "
- << ( theHasRefPoint ? theRefPoint.y : 0 ) << ", "
- << ( theHasRefPoint ? theRefPoint.z : 0 ) << " ) )";
- }
- SMESH::SMESH_MeshEditor::Extrusion_Error anError;
- prepareIdSource( theObject );
- SMESH::long_array_var anElementsId = theObject->GetIDs();
- extrusionAlongPath( anElementsId,
- thePathMesh,
- thePathShape,
- theNodeStart,
- theHasAngles,
- theAngles,
- theHasRefPoint,
- theRefPoint,
- false,
- anError,
- SMDSAbs_Face);
- return anError;
-}
-
-
-//=======================================================================
-//function : ExtrusionAlongPathMakeGroups
-//purpose :
-//=======================================================================
-
-SMESH::ListOfGroups*
-SMESH_MeshEditor_i::ExtrusionAlongPathMakeGroups(const SMESH::long_array& theIDsOfElements,
- SMESH::SMESH_Mesh_ptr thePathMesh,
- GEOM::GEOM_Object_ptr thePathShape,
- CORBA::Long theNodeStart,
- CORBA::Boolean theHasAngles,
- const SMESH::double_array& theAngles,
- CORBA::Boolean theHasRefPoint,
- const SMESH::PointStruct& theRefPoint,
- SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
- throw (SALOME::SALOME_Exception)
-{
- TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
-
- SMESH::ListOfGroups * aGroups = extrusionAlongPath( theIDsOfElements,
- thePathMesh,
- thePathShape,
- theNodeStart,
- theHasAngles,
- theAngles,
- theHasRefPoint,
- theRefPoint,
- true,
- Error);
- if (!myIsPreviewMode) {
- bool isDumpGroups = aGroups && aGroups->length() > 0;
- if (isDumpGroups)
- aPythonDump << "(" << aGroups << ", error)";
- else
- aPythonDump <<"error";
-
- aPythonDump<<" = "<< this << ".ExtrusionAlongPathMakeGroups( "
- << theIDsOfElements << ", "
- << thePathMesh << ", "
- << thePathShape << ", "
- << theNodeStart << ", "
- << theHasAngles << ", "
- << theAngles << ", "
- << theHasRefPoint << ", "
- << "SMESH.PointStruct( "
- << ( theHasRefPoint ? theRefPoint.x : 0 ) << ", "
- << ( theHasRefPoint ? theRefPoint.y : 0 ) << ", "
- << ( theHasRefPoint ? theRefPoint.z : 0 ) << " ) )";
- }
- return aGroups;
-}
-
-//=======================================================================
-//function : ExtrusionAlongPathObjectMakeGroups
-//purpose :
-//=======================================================================
-
-SMESH::ListOfGroups* SMESH_MeshEditor_i::
-ExtrusionAlongPathObjectMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
- SMESH::SMESH_Mesh_ptr thePathMesh,
- GEOM::GEOM_Object_ptr thePathShape,
- CORBA::Long theNodeStart,
- CORBA::Boolean theHasAngles,
- const SMESH::double_array& theAngles,
- CORBA::Boolean theHasRefPoint,
- const SMESH::PointStruct& theRefPoint,
- SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
- throw (SALOME::SALOME_Exception)
-{
- TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
-
- prepareIdSource( theObject );
- SMESH::long_array_var anElementsId = theObject->GetIDs();
- SMESH::ListOfGroups * aGroups = extrusionAlongPath( anElementsId,
- thePathMesh,
- thePathShape,
- theNodeStart,
- theHasAngles,
- theAngles,
- theHasRefPoint,
- theRefPoint,
- true,
- Error);
-
- if (!myIsPreviewMode) {
- bool isDumpGroups = aGroups && aGroups->length() > 0;
- if (isDumpGroups)
- aPythonDump << "(" << aGroups << ", error)";
- else
- aPythonDump <<"error";
-
- aPythonDump << " = " << this << ".ExtrusionAlongPathObjectMakeGroups( "
- << theObject << ", "
- << thePathMesh << ", "
- << thePathShape << ", "
- << theNodeStart << ", "
- << theHasAngles << ", "
- << theAngles << ", "
- << theHasRefPoint << ", "
- << "SMESH.PointStruct( "
- << ( theHasRefPoint ? theRefPoint.x : 0 ) << ", "
- << ( theHasRefPoint ? theRefPoint.y : 0 ) << ", "
- << ( theHasRefPoint ? theRefPoint.z : 0 ) << " ) )";