mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-11-13 17:18:35 +05:00
PAL8267: two new API methods added: ExtrusionSweepObject1(2)D()
This commit is contained in:
parent
22496e8ddc
commit
7411bcf53c
@ -545,6 +545,14 @@ module SMESH
|
|||||||
in DirStruct StepVector,
|
in DirStruct StepVector,
|
||||||
in long NbOfSteps);
|
in long NbOfSteps);
|
||||||
|
|
||||||
|
void ExtrusionSweepObject1D(in SMESH_IDSource theObject,
|
||||||
|
in DirStruct StepVector,
|
||||||
|
in long NbOfSteps);
|
||||||
|
|
||||||
|
void ExtrusionSweepObject2D(in SMESH_IDSource theObject,
|
||||||
|
in DirStruct StepVector,
|
||||||
|
in long NbOfSteps);
|
||||||
|
|
||||||
enum Extrusion_Error {
|
enum Extrusion_Error {
|
||||||
EXTR_OK,
|
EXTR_OK,
|
||||||
EXTR_NO_ELEMENTS,
|
EXTR_NO_ELEMENTS,
|
||||||
|
@ -533,6 +533,62 @@ void SMESH_MeshEditor_i::ExtrusionSweepObject(SMESH::SMESH_IDSource_ptr theObjec
|
|||||||
ExtrusionSweep(anElementsId, theStepVector, theNbOfSteps);
|
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<const SMDS_MeshElement*> 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<const SMDS_MeshElement*> 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;
|
#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 )
|
static SMESH::SMESH_MeshEditor::Extrusion_Error convExtrError( const::SMESH_MeshEditor::Extrusion_Error e )
|
||||||
|
@ -104,6 +104,12 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
|
|||||||
void ExtrusionSweepObject(SMESH::SMESH_IDSource_ptr theObject,
|
void ExtrusionSweepObject(SMESH::SMESH_IDSource_ptr theObject,
|
||||||
const SMESH::DirStruct & StepVector,
|
const SMESH::DirStruct & StepVector,
|
||||||
CORBA::Long NbOfSteps);
|
CORBA::Long NbOfSteps);
|
||||||
|
void ExtrusionSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
|
||||||
|
const SMESH::DirStruct & StepVector,
|
||||||
|
CORBA::Long NbOfSteps);
|
||||||
|
void ExtrusionSweepObject2D(SMESH::SMESH_IDSource_ptr theObject,
|
||||||
|
const SMESH::DirStruct & StepVector,
|
||||||
|
CORBA::Long NbOfSteps);
|
||||||
|
|
||||||
SMESH::SMESH_MeshEditor::Extrusion_Error
|
SMESH::SMESH_MeshEditor::Extrusion_Error
|
||||||
ExtrusionAlongPath(const SMESH::long_array & IDsOfElements,
|
ExtrusionAlongPath(const SMESH::long_array & IDsOfElements,
|
||||||
|
Loading…
Reference in New Issue
Block a user