mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-24 16:30:34 +05:00
Implementation of the "0021374: EDF 1898 SMESH: Extrusion of a node to have an edge" issue.
This commit is contained in:
parent
f39558c4e3
commit
a0e4f31fde
@ -388,6 +388,15 @@ module SMESH
|
|||||||
void ExtrusionSweep(in long_array IDsOfElements,
|
void ExtrusionSweep(in long_array IDsOfElements,
|
||||||
in DirStruct StepVector,
|
in DirStruct StepVector,
|
||||||
in long NbOfSteps);
|
in long NbOfSteps);
|
||||||
|
/*!
|
||||||
|
* \brief Genarate dim+1 elements by extrusion of elements along vector
|
||||||
|
* \param IDsOfElements - elements to sweep
|
||||||
|
* \param StepVector - vector giving direction and distance of an extrusion step
|
||||||
|
* \param NbOfSteps - number of elements to generate from one element
|
||||||
|
*/
|
||||||
|
void ExtrusionSweep0D(in long_array IDsOfElements,
|
||||||
|
in DirStruct StepVector,
|
||||||
|
in long NbOfSteps);
|
||||||
/*!
|
/*!
|
||||||
* \brief Same as previous but additionally create groups of elements
|
* \brief Same as previous but additionally create groups of elements
|
||||||
* generated from elements belonging to preexisting groups
|
* generated from elements belonging to preexisting groups
|
||||||
@ -395,6 +404,12 @@ module SMESH
|
|||||||
ListOfGroups ExtrusionSweepMakeGroups(in long_array IDsOfElements,
|
ListOfGroups ExtrusionSweepMakeGroups(in long_array IDsOfElements,
|
||||||
in DirStruct StepVector,
|
in DirStruct StepVector,
|
||||||
in long NbOfSteps);
|
in long NbOfSteps);
|
||||||
|
/*!
|
||||||
|
* \brief Same as previous but elements are nodes
|
||||||
|
*/
|
||||||
|
ListOfGroups ExtrusionSweepMakeGroups0D(in long_array IDsOfElements,
|
||||||
|
in DirStruct StepVector,
|
||||||
|
in long NbOfSteps);
|
||||||
/*!
|
/*!
|
||||||
* Generate new elements by extrusion of theElements
|
* Generate new elements by extrusion of theElements
|
||||||
* by StepVector by NbOfSteps
|
* by StepVector by NbOfSteps
|
||||||
@ -424,6 +439,13 @@ module SMESH
|
|||||||
in DirStruct StepVector,
|
in DirStruct StepVector,
|
||||||
in long NbOfSteps);
|
in long NbOfSteps);
|
||||||
|
|
||||||
|
void ExtrusionSweepObject0D(in SMESH_IDSource theObject,
|
||||||
|
in DirStruct StepVector,
|
||||||
|
in long NbOfSteps);
|
||||||
|
ListOfGroups ExtrusionSweepObject0DMakeGroups(in SMESH_IDSource theObject,
|
||||||
|
in DirStruct StepVector,
|
||||||
|
in long NbOfSteps);
|
||||||
|
|
||||||
void ExtrusionSweepObject1D(in SMESH_IDSource theObject,
|
void ExtrusionSweepObject1D(in SMESH_IDSource theObject,
|
||||||
in DirStruct StepVector,
|
in DirStruct StepVector,
|
||||||
in long NbOfSteps);
|
in long NbOfSteps);
|
||||||
|
@ -97,6 +97,7 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule)
|
|||||||
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_EDGE")));
|
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_EDGE")));
|
||||||
QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_TRIANGLE")));
|
QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_TRIANGLE")));
|
||||||
QPixmap image2 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
|
QPixmap image2 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
|
||||||
|
QPixmap image3 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_NODE")));
|
||||||
|
|
||||||
setModal( false );
|
setModal( false );
|
||||||
setAttribute( Qt::WA_DeleteOnClose, true );
|
setAttribute( Qt::WA_DeleteOnClose, true );
|
||||||
@ -114,16 +115,20 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule)
|
|||||||
ConstructorsBoxLayout->setSpacing(SPACING);
|
ConstructorsBoxLayout->setSpacing(SPACING);
|
||||||
ConstructorsBoxLayout->setMargin(MARGIN);
|
ConstructorsBoxLayout->setMargin(MARGIN);
|
||||||
|
|
||||||
|
RadioButton0= new QRadioButton(ConstructorsBox);
|
||||||
|
RadioButton0->setIcon(image3);
|
||||||
RadioButton1= new QRadioButton(ConstructorsBox);
|
RadioButton1= new QRadioButton(ConstructorsBox);
|
||||||
RadioButton1->setIcon(image0);
|
RadioButton1->setIcon(image0);
|
||||||
RadioButton2= new QRadioButton(ConstructorsBox);
|
RadioButton2= new QRadioButton(ConstructorsBox);
|
||||||
RadioButton2->setIcon(image1);
|
RadioButton2->setIcon(image1);
|
||||||
|
|
||||||
|
ConstructorsBoxLayout->addWidget(RadioButton0);
|
||||||
ConstructorsBoxLayout->addWidget(RadioButton1);
|
ConstructorsBoxLayout->addWidget(RadioButton1);
|
||||||
ConstructorsBoxLayout->addWidget(RadioButton2);
|
ConstructorsBoxLayout->addWidget(RadioButton2);
|
||||||
|
|
||||||
GroupConstructors->addButton(RadioButton1, 0);
|
GroupConstructors->addButton(RadioButton0, 0);
|
||||||
GroupConstructors->addButton(RadioButton2, 1);
|
GroupConstructors->addButton(RadioButton1, 1);
|
||||||
|
GroupConstructors->addButton(RadioButton2, 2);
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
GroupButtons = new QGroupBox(this);
|
GroupButtons = new QGroupBox(this);
|
||||||
@ -150,7 +155,7 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule)
|
|||||||
GroupButtonsLayout->addWidget(buttonHelp);
|
GroupButtonsLayout->addWidget(buttonHelp);
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
GroupArguments = new QGroupBox(tr("EXTRUSION_1D"), this);
|
GroupArguments = new QGroupBox(tr("EXTRUSION_0D"), this);
|
||||||
QGridLayout* GroupArgumentsLayout = new QGridLayout(GroupArguments);
|
QGridLayout* GroupArgumentsLayout = new QGridLayout(GroupArguments);
|
||||||
GroupArgumentsLayout->setSpacing(SPACING);
|
GroupArgumentsLayout->setSpacing(SPACING);
|
||||||
GroupArgumentsLayout->setMargin(MARGIN);
|
GroupArgumentsLayout->setMargin(MARGIN);
|
||||||
@ -266,7 +271,7 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule)
|
|||||||
SpinBox_NbSteps->setRange(1, 999999);
|
SpinBox_NbSteps->setRange(1, 999999);
|
||||||
SpinBox_VDist->RangeStepAndValidator(0, COORD_MAX, 10.0, "length_precision");
|
SpinBox_VDist->RangeStepAndValidator(0, COORD_MAX, 10.0, "length_precision");
|
||||||
|
|
||||||
RadioButton1->setChecked(true);
|
RadioButton0->setChecked(true);
|
||||||
RadioButton3->setChecked(true);
|
RadioButton3->setChecked(true);
|
||||||
MakeGroupsCheck->setChecked(true);
|
MakeGroupsCheck->setChecked(true);
|
||||||
|
|
||||||
@ -427,26 +432,38 @@ void SMESHGUI_ExtrusionDlg::ConstructorsClicked (int constructorId)
|
|||||||
switch (constructorId) {
|
switch (constructorId) {
|
||||||
case 0:
|
case 0:
|
||||||
{
|
{
|
||||||
GroupArguments->setTitle(tr("EXTRUSION_1D"));
|
GroupArguments->setTitle(tr("EXTRUSION_0D"));
|
||||||
if (!CheckBoxMesh->isChecked())
|
if (!CheckBoxMesh->isChecked())
|
||||||
{
|
{
|
||||||
LineEditElements->clear();
|
LineEditElements->clear();
|
||||||
myIDs.clear();
|
myIDs.clear();
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(EdgeSelection);
|
aViewWindow->SetSelectionMode(NodeSelection);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
|
{
|
||||||
|
GroupArguments->setTitle(tr("EXTRUSION_1D"));
|
||||||
|
if (!CheckBoxMesh->isChecked())
|
||||||
|
{
|
||||||
|
LineEditElements->clear();
|
||||||
|
myIDs.clear();
|
||||||
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
|
aViewWindow->SetSelectionMode(EdgeSelection);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2:
|
||||||
{
|
{
|
||||||
GroupArguments->setTitle(tr("EXTRUSION_2D"));
|
GroupArguments->setTitle(tr("EXTRUSION_2D"));
|
||||||
if (!CheckBoxMesh->isChecked())
|
if (!CheckBoxMesh->isChecked())
|
||||||
{
|
{
|
||||||
LineEditElements->clear();
|
LineEditElements->clear();
|
||||||
myIDs.clear();
|
myIDs.clear();
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(FaceSelection);
|
aViewWindow->SetSelectionMode(FaceSelection);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -550,27 +567,61 @@ bool SMESHGUI_ExtrusionDlg::ClickOnApply()
|
|||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
||||||
|
|
||||||
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) {
|
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) {
|
||||||
if( CheckBoxMesh->isChecked() ) {
|
if( CheckBoxMesh->isChecked() )
|
||||||
if( GetConstructorId() == 0 )
|
switch (GetConstructorId() ) {
|
||||||
SMESH::ListOfGroups_var groups =
|
case 0:
|
||||||
aMeshEditor->ExtrusionSweepObject1DMakeGroups(mySelectedObject, aVector, aNbSteps);
|
{
|
||||||
else
|
SMESH::ListOfGroups_var groups =
|
||||||
SMESH::ListOfGroups_var groups =
|
aMeshEditor->ExtrusionSweepObject0DMakeGroups(mySelectedObject, aVector, aNbSteps);
|
||||||
aMeshEditor->ExtrusionSweepObject2DMakeGroups(mySelectedObject, aVector, aNbSteps);
|
break;
|
||||||
}
|
}
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
SMESH::ListOfGroups_var groups =
|
||||||
|
aMeshEditor->ExtrusionSweepObject1DMakeGroups(mySelectedObject, aVector, aNbSteps);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2:
|
||||||
|
{
|
||||||
|
SMESH::ListOfGroups_var groups =
|
||||||
|
aMeshEditor->ExtrusionSweepObject2DMakeGroups(mySelectedObject, aVector, aNbSteps);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
SMESH::ListOfGroups_var groups =
|
{
|
||||||
aMeshEditor->ExtrusionSweepMakeGroups(myElementsId.inout(), aVector, aNbSteps);
|
SMESH::ListOfGroups_var groups;
|
||||||
|
if (GetConstructorId() == 0)
|
||||||
|
groups = aMeshEditor->ExtrusionSweepMakeGroups0D(myElementsId.inout(), aVector, aNbSteps);
|
||||||
|
else
|
||||||
|
groups = aMeshEditor->ExtrusionSweepMakeGroups(myElementsId.inout(), aVector, aNbSteps);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if( CheckBoxMesh->isChecked() ) {
|
if( CheckBoxMesh->isChecked() )
|
||||||
if( GetConstructorId() == 0 )
|
switch( GetConstructorId() ) {
|
||||||
aMeshEditor->ExtrusionSweepObject1D(mySelectedObject, aVector, aNbSteps);
|
case 0:
|
||||||
else
|
{
|
||||||
aMeshEditor->ExtrusionSweepObject2D(mySelectedObject, aVector, aNbSteps);
|
aMeshEditor->ExtrusionSweepObject0D(mySelectedObject, aVector, aNbSteps);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
aMeshEditor->ExtrusionSweepObject1D(mySelectedObject, aVector, aNbSteps);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2:
|
||||||
|
{
|
||||||
|
aMeshEditor->ExtrusionSweepObject2D(mySelectedObject, aVector, aNbSteps);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
aMeshEditor->ExtrusionSweep(myElementsId.inout(), aVector, aNbSteps);
|
if (GetConstructorId() == 0)
|
||||||
|
aMeshEditor->ExtrusionSweep0D(myElementsId.inout(), aVector, aNbSteps);
|
||||||
|
else
|
||||||
|
aMeshEditor->ExtrusionSweep(myElementsId.inout(), aVector, aNbSteps);
|
||||||
}
|
}
|
||||||
|
|
||||||
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
||||||
@ -660,9 +711,28 @@ void SMESHGUI_ExtrusionDlg::onTextChange (const QString& theNewText)
|
|||||||
if (send == LineEditElements)
|
if (send == LineEditElements)
|
||||||
{
|
{
|
||||||
SMDS_Mesh* aMesh = myActor ? myActor->GetObject()->GetMesh() : 0;
|
SMDS_Mesh* aMesh = myActor ? myActor->GetObject()->GetMesh() : 0;
|
||||||
SMESH::ElementType SMESHType = GetConstructorId() ? SMESH::FACE : SMESH::EDGE;
|
SMESH::ElementType SMESHType;
|
||||||
SMDSAbs_ElementType SMDSType = GetConstructorId() ? SMDSAbs_Face: SMDSAbs_Edge;
|
SMDSAbs_ElementType SMDSType;
|
||||||
|
switch (GetConstructorId()) {
|
||||||
|
case 0:
|
||||||
|
{
|
||||||
|
SMESHType = SMESH::NODE;
|
||||||
|
SMDSType = SMDSAbs_Node;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
SMESHType = SMESH::EDGE;
|
||||||
|
SMDSType = SMDSAbs_Edge;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2:
|
||||||
|
{
|
||||||
|
SMESHType = SMESH::FACE;
|
||||||
|
SMDSType = SMDSAbs_Face;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
myElementsId = new SMESH::long_array;
|
myElementsId = new SMESH::long_array;
|
||||||
myElementsId->length( aListId.count() );
|
myElementsId->length( aListId.count() );
|
||||||
TColStd_MapOfInteger newIndices;
|
TColStd_MapOfInteger newIndices;
|
||||||
@ -827,16 +897,26 @@ void SMESHGUI_ExtrusionDlg::SetEditCurrentArgument()
|
|||||||
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
|
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
|
||||||
} else {
|
} else {
|
||||||
int aConstructorId = GetConstructorId();
|
int aConstructorId = GetConstructorId();
|
||||||
if (aConstructorId == 0)
|
switch(aConstructorId) {
|
||||||
{
|
case 0:
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
{
|
||||||
aViewWindow->SetSelectionMode(EdgeSelection);
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
}
|
aViewWindow->SetSelectionMode(NodeSelection);
|
||||||
else if (aConstructorId == 1)
|
break;
|
||||||
{
|
}
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
case 1:
|
||||||
|
{
|
||||||
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
|
aViewWindow->SetSelectionMode(EdgeSelection);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2:
|
||||||
|
{
|
||||||
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(FaceSelection);
|
aViewWindow->SetSelectionMode(FaceSelection);
|
||||||
}
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (send == SelectVectorButton){
|
else if (send == SelectVectorButton){
|
||||||
@ -949,17 +1029,26 @@ void SMESHGUI_ExtrusionDlg::onSelectMesh (bool toSelectMesh)
|
|||||||
LineEditElements->setValidator(0);
|
LineEditElements->setValidator(0);
|
||||||
} else {
|
} else {
|
||||||
int aConstructorId = GetConstructorId();
|
int aConstructorId = GetConstructorId();
|
||||||
if (aConstructorId == 0)
|
switch(aConstructorId) {
|
||||||
{
|
case 0:
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
{
|
||||||
aViewWindow->SetSelectionMode(EdgeSelection);
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
}
|
aViewWindow->SetSelectionMode(NodeSelection);
|
||||||
else if (aConstructorId == 1)
|
break;
|
||||||
{
|
}
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
case 1:
|
||||||
aViewWindow->SetSelectionMode(FaceSelection);
|
{
|
||||||
}
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
|
aViewWindow->SetSelectionMode(EdgeSelection);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2:
|
||||||
|
{
|
||||||
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
|
aViewWindow->SetSelectionMode(FaceSelection);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
LineEditElements->setReadOnly(false);
|
LineEditElements->setReadOnly(false);
|
||||||
LineEditElements->setValidator(myIdValidator);
|
LineEditElements->setValidator(myIdValidator);
|
||||||
onTextChange(LineEditElements->text());
|
onTextChange(LineEditElements->text());
|
||||||
@ -1011,11 +1100,29 @@ void SMESHGUI_ExtrusionDlg::setFilters()
|
|||||||
if ( !myFilterDlg )
|
if ( !myFilterDlg )
|
||||||
{
|
{
|
||||||
QList<int> types;
|
QList<int> types;
|
||||||
|
types.append( SMESH::NODE );
|
||||||
types.append( SMESH::EDGE );
|
types.append( SMESH::EDGE );
|
||||||
types.append( SMESH::FACE );
|
types.append( SMESH::FACE );
|
||||||
myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, types );
|
myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, types );
|
||||||
}
|
}
|
||||||
myFilterDlg->Init( GetConstructorId() ? SMESH::FACE : SMESH::EDGE );
|
switch( GetConstructorId() ){
|
||||||
|
case 0:
|
||||||
|
{
|
||||||
|
myFilterDlg->Init( SMESH::NODE );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
myFilterDlg->Init( SMESH::EDGE );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2:
|
||||||
|
{
|
||||||
|
myFilterDlg->Init( SMESH::FACE );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
myFilterDlg->SetSelection();
|
myFilterDlg->SetSelection();
|
||||||
myFilterDlg->SetMesh( myMesh );
|
myFilterDlg->SetMesh( myMesh );
|
||||||
@ -1072,13 +1179,29 @@ void SMESHGUI_ExtrusionDlg::onDisplaySimulation( bool toDisplayPreview ) {
|
|||||||
SUIT_OverrideCursor aWaitCursor;
|
SUIT_OverrideCursor aWaitCursor;
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
|
||||||
if( CheckBoxMesh->isChecked() ) {
|
if( CheckBoxMesh->isChecked() ) {
|
||||||
if( GetConstructorId() == 0 )
|
switch (GetConstructorId()) {
|
||||||
aMeshEditor->ExtrusionSweepObject1D(mySelectedObject, aVector, aNbSteps);
|
case 0:
|
||||||
else
|
{
|
||||||
aMeshEditor->ExtrusionSweepObject2D(mySelectedObject, aVector, aNbSteps);
|
aMeshEditor->ExtrusionSweepObject0D(mySelectedObject, aVector, aNbSteps);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
aMeshEditor->ExtrusionSweepObject1D(mySelectedObject, aVector, aNbSteps);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2:
|
||||||
|
{
|
||||||
|
aMeshEditor->ExtrusionSweepObject2D(mySelectedObject, aVector, aNbSteps);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
aMeshEditor->ExtrusionSweep(myElementsId.inout(), aVector, aNbSteps);
|
if(GetConstructorId() == 0)
|
||||||
|
aMeshEditor->ExtrusionSweep0D(myElementsId.inout(), aVector, aNbSteps);
|
||||||
|
else
|
||||||
|
aMeshEditor->ExtrusionSweep(myElementsId.inout(), aVector, aNbSteps);
|
||||||
|
|
||||||
SMESH::MeshPreviewStruct_var aMeshPreviewStruct = aMeshEditor->GetPreviewData();
|
SMESH::MeshPreviewStruct_var aMeshPreviewStruct = aMeshEditor->GetPreviewData();
|
||||||
mySimulation->SetData(aMeshPreviewStruct._retn());
|
mySimulation->SetData(aMeshPreviewStruct._retn());
|
||||||
|
@ -99,6 +99,7 @@ private:
|
|||||||
// widgets
|
// widgets
|
||||||
QGroupBox* ConstructorsBox;
|
QGroupBox* ConstructorsBox;
|
||||||
QButtonGroup* GroupConstructors;
|
QButtonGroup* GroupConstructors;
|
||||||
|
QRadioButton* RadioButton0;
|
||||||
QRadioButton* RadioButton1;
|
QRadioButton* RadioButton1;
|
||||||
QRadioButton* RadioButton2;
|
QRadioButton* RadioButton2;
|
||||||
QRadioButton* RadioButton3;
|
QRadioButton* RadioButton3;
|
||||||
|
@ -4325,6 +4325,10 @@ Please select a group and try again</translation>
|
|||||||
<source>CANT_GET_TANGENT</source>
|
<source>CANT_GET_TANGENT</source>
|
||||||
<translation>Can't get tangent for one of the path nodes</translation>
|
<translation>Can't get tangent for one of the path nodes</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>EXTRUSION_0D</source>
|
||||||
|
<translation>Extrusion of 0D elements</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>EXTRUSION_1D</source>
|
<source>EXTRUSION_1D</source>
|
||||||
<translation>Extrusion of 1D elements</translation>
|
<translation>Extrusion of 1D elements</translation>
|
||||||
|
@ -111,8 +111,12 @@ namespace {
|
|||||||
if ( type == theAvoidType ||
|
if ( type == theAvoidType ||
|
||||||
( theSelectType != SMDSAbs_All && type != theSelectType ))
|
( theSelectType != SMDSAbs_All && type != theSelectType ))
|
||||||
continue;
|
continue;
|
||||||
|
const SMDS_MeshElement* anElemCopy;
|
||||||
if ( const SMDS_MeshElement* anElemCopy = Copy( anElem ))
|
if ( type == SMDSAbs_Node)
|
||||||
|
anElemCopy = Copy( cast2Node(anElem) );
|
||||||
|
else
|
||||||
|
anElemCopy = Copy( anElem );
|
||||||
|
if ( anElemCopy )
|
||||||
theCopyElements.insert( theCopyElements.end(), anElemCopy );
|
theCopyElements.insert( theCopyElements.end(), anElemCopy );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1887,9 +1891,17 @@ SMESH_MeshEditor_i::extrusionSweep(const SMESH::long_array & theIDsOfElements,
|
|||||||
gp_Vec stepVec( P->x, P->y, P->z );
|
gp_Vec stepVec( P->x, P->y, P->z );
|
||||||
|
|
||||||
TIDSortedElemSet* workElements = & elements;
|
TIDSortedElemSet* workElements = & elements;
|
||||||
TPreviewMesh tmpMesh( SMDSAbs_Face );
|
|
||||||
SMESH_Mesh* mesh = myMesh;
|
SMDSAbs_ElementType aType = SMDSAbs_Face;
|
||||||
|
::SMESH_MeshEditor::ExtrusionFlags aFlag = ::SMESH_MeshEditor::ExtrusionFlags::EXTRUSION_FLAG_BOUNDARY;
|
||||||
|
if (theElementType == SMDSAbs_Node)
|
||||||
|
{
|
||||||
|
aType = SMDSAbs_Edge;
|
||||||
|
aFlag = ::SMESH_MeshEditor::ExtrusionFlags::EXTRUSION_FLAG_SEW;
|
||||||
|
}
|
||||||
|
TPreviewMesh tmpMesh( aType );
|
||||||
|
SMESH_Mesh* mesh = myMesh;
|
||||||
|
|
||||||
if ( myPreviewMode ) {
|
if ( myPreviewMode ) {
|
||||||
SMDSAbs_ElementType select = SMDSAbs_All, avoid = SMDSAbs_Volume;
|
SMDSAbs_ElementType select = SMDSAbs_All, avoid = SMDSAbs_Volume;
|
||||||
tmpMesh.Copy( elements, copyElements, select, avoid );
|
tmpMesh.Copy( elements, copyElements, select, avoid );
|
||||||
@ -1900,8 +1912,8 @@ SMESH_MeshEditor_i::extrusionSweep(const SMESH::long_array & theIDsOfElements,
|
|||||||
|
|
||||||
TElemOfElemListMap aHystory;
|
TElemOfElemListMap aHystory;
|
||||||
::SMESH_MeshEditor anEditor( mesh );
|
::SMESH_MeshEditor anEditor( mesh );
|
||||||
::SMESH_MeshEditor::PGroupIDs groupIds =
|
::SMESH_MeshEditor::PGroupIDs groupIds =
|
||||||
anEditor.ExtrusionSweep (*workElements, stepVec, theNbOfSteps, aHystory, theMakeGroups);
|
anEditor.ExtrusionSweep (*workElements, stepVec, theNbOfSteps, aHystory, theMakeGroups, aFlag);
|
||||||
|
|
||||||
myMesh->GetMeshDS()->Modified();
|
myMesh->GetMeshDS()->Modified();
|
||||||
storeResult(anEditor);
|
storeResult(anEditor);
|
||||||
@ -1931,6 +1943,21 @@ void SMESH_MeshEditor_i::ExtrusionSweep(const SMESH::long_array & theIDsOfElemen
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : ExtrusionSweep0D
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
|
void SMESH_MeshEditor_i::ExtrusionSweep0D(const SMESH::long_array & theIDsOfElements,
|
||||||
|
const SMESH::DirStruct & theStepVector,
|
||||||
|
CORBA::Long theNbOfSteps)
|
||||||
|
{
|
||||||
|
extrusionSweep (theIDsOfElements, theStepVector, theNbOfSteps, false, SMDSAbs_Node );
|
||||||
|
if (!myPreviewMode) {
|
||||||
|
TPythonDump() << this << ".ExtrusionSweep0D( "
|
||||||
|
<< theIDsOfElements << ", " << theStepVector <<", " << theNbOfSteps << " )";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : ExtrusionSweepObject
|
//function : ExtrusionSweepObject
|
||||||
@ -1949,6 +1976,23 @@ void SMESH_MeshEditor_i::ExtrusionSweepObject(SMESH::SMESH_IDSource_ptr theObjec
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : ExtrusionSweepObject0D
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
|
void SMESH_MeshEditor_i::ExtrusionSweepObject0D(SMESH::SMESH_IDSource_ptr theObject,
|
||||||
|
const SMESH::DirStruct & theStepVector,
|
||||||
|
CORBA::Long theNbOfSteps)
|
||||||
|
{
|
||||||
|
SMESH::long_array_var anElementsId = theObject->GetIDs();
|
||||||
|
extrusionSweep (anElementsId, theStepVector, theNbOfSteps, false, SMDSAbs_Node );
|
||||||
|
if ( !myPreviewMode ) {
|
||||||
|
TPythonDump() << this << ".ExtrusionSweepObject0D( "
|
||||||
|
<< theObject << ", " << theStepVector << ", " << theNbOfSteps << " )";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : ExtrusionSweepObject1D
|
//function : ExtrusionSweepObject1D
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -2005,6 +2049,28 @@ SMESH_MeshEditor_i::ExtrusionSweepMakeGroups(const SMESH::long_array& theIDsOfEl
|
|||||||
return aGroups;
|
return aGroups;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : ExtrusionSweepMakeGroups0D
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
|
SMESH::ListOfGroups*
|
||||||
|
SMESH_MeshEditor_i::ExtrusionSweepMakeGroups0D(const SMESH::long_array& theIDsOfElements,
|
||||||
|
const SMESH::DirStruct& theStepVector,
|
||||||
|
CORBA::Long theNbOfSteps)
|
||||||
|
{
|
||||||
|
TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
|
||||||
|
|
||||||
|
SMESH::ListOfGroups* aGroups = extrusionSweep(theIDsOfElements, theStepVector, theNbOfSteps, true,SMDSAbs_Node);
|
||||||
|
|
||||||
|
if (!myPreviewMode) {
|
||||||
|
DumpGroupsList(aPythonDump, aGroups);
|
||||||
|
aPythonDump << this << ".ExtrusionSweepMakeGroups0D( " << theIDsOfElements
|
||||||
|
<< ", " << theStepVector <<", " << theNbOfSteps << " )";
|
||||||
|
}
|
||||||
|
return aGroups;
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : ExtrusionSweepObjectMakeGroups
|
//function : ExtrusionSweepObjectMakeGroups
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -2028,6 +2094,29 @@ SMESH_MeshEditor_i::ExtrusionSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr the
|
|||||||
return aGroups;
|
return aGroups;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : ExtrusionSweepObject0DMakeGroups
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
|
SMESH::ListOfGroups*
|
||||||
|
SMESH_MeshEditor_i::ExtrusionSweepObject0DMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
|
||||||
|
const SMESH::DirStruct& theStepVector,
|
||||||
|
CORBA::Long theNbOfSteps)
|
||||||
|
{
|
||||||
|
TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
|
||||||
|
|
||||||
|
SMESH::long_array_var anElementsId = theObject->GetIDs();
|
||||||
|
SMESH::ListOfGroups * aGroups = extrusionSweep(anElementsId, theStepVector,
|
||||||
|
theNbOfSteps, true, SMDSAbs_Node);
|
||||||
|
if (!myPreviewMode) {
|
||||||
|
DumpGroupsList(aPythonDump, aGroups);
|
||||||
|
aPythonDump << this << ".ExtrusionSweepObject0DMakeGroups( " << theObject
|
||||||
|
<< ", " << theStepVector << ", " << theNbOfSteps << " )";
|
||||||
|
}
|
||||||
|
return aGroups;
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : ExtrusionSweepObject1DMakeGroups
|
//function : ExtrusionSweepObject1DMakeGroups
|
||||||
//purpose :
|
//purpose :
|
||||||
|
@ -212,9 +212,17 @@ public:
|
|||||||
void ExtrusionSweep(const SMESH::long_array & IDsOfElements,
|
void ExtrusionSweep(const SMESH::long_array & IDsOfElements,
|
||||||
const SMESH::DirStruct & StepVector,
|
const SMESH::DirStruct & StepVector,
|
||||||
CORBA::Long NbOfSteps);
|
CORBA::Long NbOfSteps);
|
||||||
|
void ExtrusionSweep0D(const SMESH::long_array & IDsOfElements,
|
||||||
|
const SMESH::DirStruct & StepVector,
|
||||||
|
CORBA::Long NbOfSteps);
|
||||||
|
|
||||||
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 ExtrusionSweepObject0D(SMESH::SMESH_IDSource_ptr theObject,
|
||||||
|
const SMESH::DirStruct & StepVector,
|
||||||
|
CORBA::Long NbOfSteps);
|
||||||
void ExtrusionSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
|
void ExtrusionSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
|
||||||
const SMESH::DirStruct & StepVector,
|
const SMESH::DirStruct & StepVector,
|
||||||
CORBA::Long NbOfSteps);
|
CORBA::Long NbOfSteps);
|
||||||
@ -315,6 +323,10 @@ public:
|
|||||||
SMESH::ListOfGroups* ExtrusionSweepMakeGroups(const SMESH::long_array& IDsOfElements,
|
SMESH::ListOfGroups* ExtrusionSweepMakeGroups(const SMESH::long_array& IDsOfElements,
|
||||||
const SMESH::DirStruct& StepVector,
|
const SMESH::DirStruct& StepVector,
|
||||||
CORBA::Long NbOfSteps);
|
CORBA::Long NbOfSteps);
|
||||||
|
SMESH::ListOfGroups* ExtrusionSweepMakeGroups0D(const SMESH::long_array& IDsOfElements,
|
||||||
|
const SMESH::DirStruct& StepVector,
|
||||||
|
CORBA::Long NbOfSteps);
|
||||||
|
|
||||||
SMESH::ListOfGroups* AdvancedExtrusionMakeGroups(const SMESH::long_array& IDsOfElements,
|
SMESH::ListOfGroups* AdvancedExtrusionMakeGroups(const SMESH::long_array& IDsOfElements,
|
||||||
const SMESH::DirStruct& StepVector,
|
const SMESH::DirStruct& StepVector,
|
||||||
CORBA::Long NbOfSteps,
|
CORBA::Long NbOfSteps,
|
||||||
@ -323,6 +335,9 @@ public:
|
|||||||
SMESH::ListOfGroups* ExtrusionSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
|
SMESH::ListOfGroups* ExtrusionSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
|
||||||
const SMESH::DirStruct& StepVector,
|
const SMESH::DirStruct& StepVector,
|
||||||
CORBA::Long NbOfSteps);
|
CORBA::Long NbOfSteps);
|
||||||
|
SMESH::ListOfGroups* ExtrusionSweepObject0DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
|
||||||
|
const SMESH::DirStruct& StepVector,
|
||||||
|
CORBA::Long NbOfSteps);
|
||||||
SMESH::ListOfGroups* ExtrusionSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
|
SMESH::ListOfGroups* ExtrusionSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
|
||||||
const SMESH::DirStruct& StepVector,
|
const SMESH::DirStruct& StepVector,
|
||||||
CORBA::Long NbOfSteps);
|
CORBA::Long NbOfSteps);
|
||||||
|
@ -3490,9 +3490,10 @@ class Mesh:
|
|||||||
# @param StepVector vector or DirStruct, defining the direction and value of extrusion for one step (the total extrusion length will be NbOfSteps * ||StepVector||)
|
# @param StepVector vector or DirStruct, defining the direction and value of extrusion for one step (the total extrusion length will be NbOfSteps * ||StepVector||)
|
||||||
# @param NbOfSteps the number of steps
|
# @param NbOfSteps the number of steps
|
||||||
# @param MakeGroups forces the generation of new groups from existing ones
|
# @param MakeGroups forces the generation of new groups from existing ones
|
||||||
|
# @param IsNodes is True if elements with given ids are nodes
|
||||||
# @return the list of created groups (SMESH_GroupBase) if MakeGroups=True, empty list otherwise
|
# @return the list of created groups (SMESH_GroupBase) if MakeGroups=True, empty list otherwise
|
||||||
# @ingroup l2_modif_extrurev
|
# @ingroup l2_modif_extrurev
|
||||||
def ExtrusionSweep(self, IDsOfElements, StepVector, NbOfSteps, MakeGroups=False):
|
def ExtrusionSweep(self, IDsOfElements, StepVector, NbOfSteps, MakeGroups=False, IsNodes = False):
|
||||||
if IDsOfElements == []:
|
if IDsOfElements == []:
|
||||||
IDsOfElements = self.GetElementsId()
|
IDsOfElements = self.GetElementsId()
|
||||||
if ( isinstance( StepVector, geompyDC.GEOM._objref_GEOM_Object)):
|
if ( isinstance( StepVector, geompyDC.GEOM._objref_GEOM_Object)):
|
||||||
@ -3502,8 +3503,14 @@ class Mesh:
|
|||||||
Parameters = StepVectorParameters + var_separator + Parameters
|
Parameters = StepVectorParameters + var_separator + Parameters
|
||||||
self.mesh.SetParameters(Parameters)
|
self.mesh.SetParameters(Parameters)
|
||||||
if MakeGroups:
|
if MakeGroups:
|
||||||
return self.editor.ExtrusionSweepMakeGroups(IDsOfElements, StepVector, NbOfSteps)
|
if(IsNodes):
|
||||||
self.editor.ExtrusionSweep(IDsOfElements, StepVector, NbOfSteps)
|
return self.editor.ExtrusionSweepMakeGroups0D(IDsOfElements, StepVector, NbOfSteps)
|
||||||
|
else:
|
||||||
|
return self.editor.ExtrusionSweepMakeGroups(IDsOfElements, StepVector, NbOfSteps)
|
||||||
|
if(IsNodes):
|
||||||
|
self.editor.ExtrusionSweep0D(IDsOfElements, StepVector, NbOfSteps)
|
||||||
|
else:
|
||||||
|
self.editor.ExtrusionSweep(IDsOfElements, StepVector, NbOfSteps)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
## Generates new elements by extrusion of the elements with given ids
|
## Generates new elements by extrusion of the elements with given ids
|
||||||
@ -3533,9 +3540,10 @@ class Mesh:
|
|||||||
# @param StepVector vector, defining the direction and value of extrusion for one step (the total extrusion length will be NbOfSteps * ||StepVector||)
|
# @param StepVector vector, defining the direction and value of extrusion for one step (the total extrusion length will be NbOfSteps * ||StepVector||)
|
||||||
# @param NbOfSteps the number of steps
|
# @param NbOfSteps the number of steps
|
||||||
# @param MakeGroups forces the generation of new groups from existing ones
|
# @param MakeGroups forces the generation of new groups from existing ones
|
||||||
|
# @param IsNodes is True if elements which belong to the object are nodes
|
||||||
# @return list of created groups (SMESH_GroupBase) if MakeGroups=True, empty list otherwise
|
# @return list of created groups (SMESH_GroupBase) if MakeGroups=True, empty list otherwise
|
||||||
# @ingroup l2_modif_extrurev
|
# @ingroup l2_modif_extrurev
|
||||||
def ExtrusionSweepObject(self, theObject, StepVector, NbOfSteps, MakeGroups=False):
|
def ExtrusionSweepObject(self, theObject, StepVector, NbOfSteps, MakeGroups=False, IsNodes=False):
|
||||||
if ( isinstance( theObject, Mesh )):
|
if ( isinstance( theObject, Mesh )):
|
||||||
theObject = theObject.GetMesh()
|
theObject = theObject.GetMesh()
|
||||||
if ( isinstance( StepVector, geompyDC.GEOM._objref_GEOM_Object)):
|
if ( isinstance( StepVector, geompyDC.GEOM._objref_GEOM_Object)):
|
||||||
@ -3545,8 +3553,14 @@ class Mesh:
|
|||||||
Parameters = StepVectorParameters + var_separator + Parameters
|
Parameters = StepVectorParameters + var_separator + Parameters
|
||||||
self.mesh.SetParameters(Parameters)
|
self.mesh.SetParameters(Parameters)
|
||||||
if MakeGroups:
|
if MakeGroups:
|
||||||
return self.editor.ExtrusionSweepObjectMakeGroups(theObject, StepVector, NbOfSteps)
|
if(IsNodes):
|
||||||
self.editor.ExtrusionSweepObject(theObject, StepVector, NbOfSteps)
|
return self.editor.ExtrusionSweepObject0DMakeGroups(theObject, StepVector, NbOfSteps)
|
||||||
|
else:
|
||||||
|
return self.editor.ExtrusionSweepObjectMakeGroups(theObject, StepVector, NbOfSteps)
|
||||||
|
if(IsNodes):
|
||||||
|
self.editor.ExtrusionSweepObject0D(IDsOfElements, StepVector, NbOfSteps)
|
||||||
|
else:
|
||||||
|
self.editor.ExtrusionSweepObject(theObject, StepVector, NbOfSteps)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
## Generates new elements by extrusion of the elements which belong to the object
|
## Generates new elements by extrusion of the elements which belong to the object
|
||||||
|
Loading…
Reference in New Issue
Block a user