mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-28 02:10:35 +05:00
Dump Puthon extension
This commit is contained in:
parent
eb02acbf12
commit
bbd637f132
@ -281,6 +281,48 @@ module SMESH
|
|||||||
in double AngleInRadians,
|
in double AngleInRadians,
|
||||||
in long NbOfSteps,
|
in long NbOfSteps,
|
||||||
in double Tolerance);
|
in double Tolerance);
|
||||||
|
/*!
|
||||||
|
* \brief Genarate dim+1 elements by rotation of the object around axis
|
||||||
|
* \param theObject - object containing elements to ratate
|
||||||
|
* \param Axix - rotation axis
|
||||||
|
* \param AngleInRadians - rotation angle
|
||||||
|
* \param NbOfSteps - number of elements to generate from one element
|
||||||
|
*/
|
||||||
|
void RotationSweepObject1D(in SMESH_IDSource theObject,
|
||||||
|
in AxisStruct Axix,
|
||||||
|
in double AngleInRadians,
|
||||||
|
in long NbOfSteps,
|
||||||
|
in double Tolerance);
|
||||||
|
/*!
|
||||||
|
* \brief Same as previous but additionally create groups of elements
|
||||||
|
* generated from elements belonging to preexisting groups
|
||||||
|
*/
|
||||||
|
ListOfGroups RotationSweepObject1DMakeGroups(in SMESH_IDSource theObject,
|
||||||
|
in AxisStruct Axix,
|
||||||
|
in double AngleInRadians,
|
||||||
|
in long NbOfSteps,
|
||||||
|
in double Tolerance);
|
||||||
|
/*!
|
||||||
|
* \brief Genarate dim+1 elements by rotation of the object around axis
|
||||||
|
* \param theObject - object containing elements to ratate
|
||||||
|
* \param Axix - rotation axis
|
||||||
|
* \param AngleInRadians - rotation angle
|
||||||
|
* \param NbOfSteps - number of elements to generate from one element
|
||||||
|
*/
|
||||||
|
void RotationSweepObject2D(in SMESH_IDSource theObject,
|
||||||
|
in AxisStruct Axix,
|
||||||
|
in double AngleInRadians,
|
||||||
|
in long NbOfSteps,
|
||||||
|
in double Tolerance);
|
||||||
|
/*!
|
||||||
|
* \brief Same as previous but additionally create groups of elements
|
||||||
|
* generated from elements belonging to preexisting groups
|
||||||
|
*/
|
||||||
|
ListOfGroups RotationSweepObject2DMakeGroups(in SMESH_IDSource theObject,
|
||||||
|
in AxisStruct Axix,
|
||||||
|
in double AngleInRadians,
|
||||||
|
in long NbOfSteps,
|
||||||
|
in double Tolerance);
|
||||||
/*!
|
/*!
|
||||||
* \brief Genarate dim+1 elements by extrusion of elements along vector
|
* \brief Genarate dim+1 elements by extrusion of elements along vector
|
||||||
* \param IDsOfElements - elements to sweep
|
* \param IDsOfElements - elements to sweep
|
||||||
@ -386,6 +428,42 @@ module SMESH
|
|||||||
in PointStruct RefPoint,
|
in PointStruct RefPoint,
|
||||||
out Extrusion_Error Error);
|
out Extrusion_Error Error);
|
||||||
|
|
||||||
|
Extrusion_Error ExtrusionAlongPathObject1D(in SMESH_IDSource theObject,
|
||||||
|
in SMESH_Mesh PathMesh,
|
||||||
|
in GEOM::GEOM_Object PathShape,
|
||||||
|
in long NodeStart,
|
||||||
|
in boolean HasAngles,
|
||||||
|
in double_array Angles,
|
||||||
|
in boolean HasRefPoint,
|
||||||
|
in PointStruct RefPoint);
|
||||||
|
ListOfGroups ExtrusionAlongPathObject1DMakeGroups(in SMESH_IDSource theObject,
|
||||||
|
in SMESH_Mesh PathMesh,
|
||||||
|
in GEOM::GEOM_Object PathShape,
|
||||||
|
in long NodeStart,
|
||||||
|
in boolean HasAngles,
|
||||||
|
in double_array Angles,
|
||||||
|
in boolean HasRefPoint,
|
||||||
|
in PointStruct RefPoint,
|
||||||
|
out Extrusion_Error Error);
|
||||||
|
|
||||||
|
Extrusion_Error ExtrusionAlongPathObject2D(in SMESH_IDSource theObject,
|
||||||
|
in SMESH_Mesh PathMesh,
|
||||||
|
in GEOM::GEOM_Object PathShape,
|
||||||
|
in long NodeStart,
|
||||||
|
in boolean HasAngles,
|
||||||
|
in double_array Angles,
|
||||||
|
in boolean HasRefPoint,
|
||||||
|
in PointStruct RefPoint);
|
||||||
|
ListOfGroups ExtrusionAlongPathObject2DMakeGroups(in SMESH_IDSource theObject,
|
||||||
|
in SMESH_Mesh PathMesh,
|
||||||
|
in GEOM::GEOM_Object PathShape,
|
||||||
|
in long NodeStart,
|
||||||
|
in boolean HasAngles,
|
||||||
|
in double_array Angles,
|
||||||
|
in boolean HasRefPoint,
|
||||||
|
in PointStruct RefPoint,
|
||||||
|
out Extrusion_Error Error);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Compute rotation angles for ExtrusionAlongPath as linear variation
|
* Compute rotation angles for ExtrusionAlongPath as linear variation
|
||||||
* of given angles along path steps
|
* of given angles along path steps
|
||||||
|
@ -483,45 +483,7 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
|
|||||||
|
|
||||||
SMESH::long_array_var anElementsId = new SMESH::long_array;
|
SMESH::long_array_var anElementsId = new SMESH::long_array;
|
||||||
|
|
||||||
if (MeshCheck->isChecked()) {
|
if (!MeshCheck->isChecked()) {
|
||||||
// If "Select whole mesh, submesh or group" check box is on ->
|
|
||||||
// get all elements of the required type from the object selected
|
|
||||||
|
|
||||||
// if MESH object is selected
|
|
||||||
if (!CORBA::is_nil(SMESH::SMESH_Mesh::_narrow(myIDSource))) {
|
|
||||||
// get mesh
|
|
||||||
SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow(myIDSource);
|
|
||||||
// get IDs from mesh...
|
|
||||||
if (Elements1dRB->isChecked())
|
|
||||||
// 1d elements
|
|
||||||
anElementsId = aMesh->GetElementsByType(SMESH::EDGE);
|
|
||||||
else if (Elements2dRB->isChecked()) {
|
|
||||||
anElementsId = aMesh->GetElementsByType(SMESH::FACE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// SUBMESH is selected
|
|
||||||
if (!CORBA::is_nil(SMESH::SMESH_subMesh::_narrow(myIDSource))) {
|
|
||||||
// get submesh
|
|
||||||
SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow(myIDSource);
|
|
||||||
// get IDs from submesh
|
|
||||||
if (Elements1dRB->isChecked())
|
|
||||||
// 1d elements
|
|
||||||
anElementsId = aSubMesh->GetElementsByType(SMESH::EDGE);
|
|
||||||
else if (Elements2dRB->isChecked())
|
|
||||||
// 2d elements
|
|
||||||
anElementsId = aSubMesh->GetElementsByType(SMESH::FACE);
|
|
||||||
}
|
|
||||||
// GROUP is selected
|
|
||||||
if (!CORBA::is_nil(SMESH::SMESH_GroupBase::_narrow(myIDSource))) {
|
|
||||||
// get smesh group
|
|
||||||
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(myIDSource);
|
|
||||||
// get IDs from group
|
|
||||||
// 1d elements or 2d elements
|
|
||||||
if (Elements1dRB->isChecked() && aGroup->GetType() == SMESH::EDGE ||
|
|
||||||
Elements2dRB->isChecked() && aGroup->GetType() == SMESH::FACE)
|
|
||||||
anElementsId = aGroup->GetListOfID();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// If "Select whole mesh, submesh or group" check box is off ->
|
// If "Select whole mesh, submesh or group" check box is off ->
|
||||||
// use only elements of given type selected by user
|
// use only elements of given type selected by user
|
||||||
|
|
||||||
@ -546,11 +508,11 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
|
|||||||
}
|
}
|
||||||
anElementsId->length(j);
|
anElementsId->length(j);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (anElementsId->length() <= 0) {
|
if (anElementsId->length() <= 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (StartPointLineEdit->text().trimmed().isEmpty()) {
|
if (StartPointLineEdit->text().trimmed().isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
@ -596,17 +558,47 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
|
|||||||
anAngles = aMeshEditor->LinearAnglesVariation( myPathMesh, myPathShape, anAngles );
|
anAngles = aMeshEditor->LinearAnglesVariation( myPathMesh, myPathShape, anAngles );
|
||||||
|
|
||||||
SMESH::SMESH_MeshEditor::Extrusion_Error retVal;
|
SMESH::SMESH_MeshEditor::Extrusion_Error retVal;
|
||||||
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
|
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) {
|
||||||
|
if( MeshCheck->isChecked() ) {
|
||||||
|
if( GetConstructorId() == 0 )
|
||||||
|
SMESH::ListOfGroups_var groups =
|
||||||
|
aMeshEditor->ExtrusionAlongPathObject1DMakeGroups(myIDSource, myPathMesh,
|
||||||
|
myPathShape, aNodeStart,
|
||||||
|
AnglesGrp->isChecked(), anAngles,
|
||||||
|
BasePointGrp->isChecked(), aBasePoint, retVal);
|
||||||
|
else
|
||||||
|
SMESH::ListOfGroups_var groups =
|
||||||
|
aMeshEditor->ExtrusionAlongPathObject2DMakeGroups(myIDSource, myPathMesh,
|
||||||
|
myPathShape, aNodeStart,
|
||||||
|
AnglesGrp->isChecked(), anAngles,
|
||||||
|
BasePointGrp->isChecked(), aBasePoint, retVal);
|
||||||
|
}
|
||||||
|
else
|
||||||
SMESH::ListOfGroups_var groups =
|
SMESH::ListOfGroups_var groups =
|
||||||
aMeshEditor->ExtrusionAlongPathMakeGroups(anElementsId, myPathMesh,
|
aMeshEditor->ExtrusionAlongPathMakeGroups(anElementsId, myPathMesh,
|
||||||
myPathShape, aNodeStart,
|
myPathShape, aNodeStart,
|
||||||
AnglesGrp->isChecked(), anAngles,
|
AnglesGrp->isChecked(), anAngles,
|
||||||
BasePointGrp->isChecked(), aBasePoint, retVal);
|
BasePointGrp->isChecked(), aBasePoint, retVal);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if( MeshCheck->isChecked() ) {
|
||||||
|
if( GetConstructorId() == 0 )
|
||||||
|
retVal = aMeshEditor->ExtrusionAlongPathObject1D(myIDSource, myPathMesh,
|
||||||
|
myPathShape, aNodeStart,
|
||||||
|
AnglesGrp->isChecked(), anAngles,
|
||||||
|
BasePointGrp->isChecked(), aBasePoint);
|
||||||
|
else
|
||||||
|
retVal = aMeshEditor->ExtrusionAlongPathObject2D(myIDSource, myPathMesh,
|
||||||
|
myPathShape, aNodeStart,
|
||||||
|
AnglesGrp->isChecked(), anAngles,
|
||||||
|
BasePointGrp->isChecked(), aBasePoint);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
retVal = aMeshEditor->ExtrusionAlongPath(anElementsId, myPathMesh,
|
retVal = aMeshEditor->ExtrusionAlongPath(anElementsId, myPathMesh,
|
||||||
myPathShape, aNodeStart,
|
myPathShape, aNodeStart,
|
||||||
AnglesGrp->isChecked(), anAngles,
|
AnglesGrp->isChecked(), anAngles,
|
||||||
BasePointGrp->isChecked(), aBasePoint);
|
BasePointGrp->isChecked(), aBasePoint);
|
||||||
|
}
|
||||||
|
|
||||||
if( retVal == SMESH::SMESH_MeshEditor::EXTR_OK )
|
if( retVal == SMESH::SMESH_MeshEditor::EXTR_OK )
|
||||||
myMesh->SetParameters( SMESHGUI::JoinObjectParameters(aParameters) );
|
myMesh->SetParameters( SMESHGUI::JoinObjectParameters(aParameters) );
|
||||||
|
@ -87,7 +87,8 @@
|
|||||||
SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule)
|
SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule)
|
||||||
: QDialog( SMESH::GetDesktop( theModule ) ),
|
: QDialog( SMESH::GetDesktop( theModule ) ),
|
||||||
mySMESHGUI( theModule ),
|
mySMESHGUI( theModule ),
|
||||||
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
|
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
|
||||||
|
mySelectedObject(SMESH::SMESH_IDSource::_nil())
|
||||||
{
|
{
|
||||||
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")));
|
||||||
@ -382,11 +383,29 @@ bool SMESHGUI_ExtrusionDlg::ClickOnApply()
|
|||||||
SUIT_OverrideCursor aWaitCursor;
|
SUIT_OverrideCursor aWaitCursor;
|
||||||
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( GetConstructorId() == 0 )
|
||||||
|
SMESH::ListOfGroups_var groups =
|
||||||
|
aMeshEditor->ExtrusionSweepObject1DMakeGroups(mySelectedObject, aVector, aNbSteps);
|
||||||
|
else
|
||||||
|
SMESH::ListOfGroups_var groups =
|
||||||
|
aMeshEditor->ExtrusionSweepObject2DMakeGroups(mySelectedObject, aVector, aNbSteps);
|
||||||
|
}
|
||||||
|
else
|
||||||
SMESH::ListOfGroups_var groups =
|
SMESH::ListOfGroups_var groups =
|
||||||
aMeshEditor->ExtrusionSweepMakeGroups(myElementsId.inout(), aVector, aNbSteps);
|
aMeshEditor->ExtrusionSweepMakeGroups(myElementsId.inout(), aVector, aNbSteps);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if( CheckBoxMesh->isChecked() ) {
|
||||||
|
if( GetConstructorId() == 0 )
|
||||||
|
aMeshEditor->ExtrusionSweepObject1D(mySelectedObject, aVector, aNbSteps);
|
||||||
|
else
|
||||||
|
aMeshEditor->ExtrusionSweepObject2D(mySelectedObject, aVector, aNbSteps);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
aMeshEditor->ExtrusionSweep(myElementsId.inout(), aVector, aNbSteps);
|
aMeshEditor->ExtrusionSweep(myElementsId.inout(), aVector, aNbSteps);
|
||||||
|
}
|
||||||
|
|
||||||
myMesh->SetParameters( SMESHGUI::JoinObjectParameters(aParameters) );
|
myMesh->SetParameters( SMESHGUI::JoinObjectParameters(aParameters) );
|
||||||
|
|
||||||
@ -398,6 +417,7 @@ bool SMESHGUI_ExtrusionDlg::ClickOnApply()
|
|||||||
mySMESHGUI->updateObjBrowser(true); // new groups may appear
|
mySMESHGUI->updateObjBrowser(true); // new groups may appear
|
||||||
Init(false);
|
Init(false);
|
||||||
ConstructorsClicked(GetConstructorId());
|
ConstructorsClicked(GetConstructorId());
|
||||||
|
mySelectedObject = SMESH::SMESH_IDSource::_nil();
|
||||||
SelectionIntoArgument();
|
SelectionIntoArgument();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -561,41 +581,21 @@ void SMESHGUI_ExtrusionDlg::SelectionIntoArgument()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (CheckBoxMesh->isChecked()) {
|
if (CheckBoxMesh->isChecked()) {
|
||||||
SMESH::ElementType neededType = GetConstructorId() ? SMESH::FACE : SMESH::EDGE;
|
|
||||||
|
|
||||||
SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
|
SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
|
||||||
|
|
||||||
SMESH::SMESH_Mesh_var mesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO);
|
if (!SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO)->_is_nil())
|
||||||
|
mySelectedObject = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO);
|
||||||
if (!mesh->_is_nil()) { //MESH
|
else
|
||||||
// get elements from mesh
|
return;
|
||||||
myElementsId = mesh->GetElementsByType(neededType);
|
|
||||||
aNbElements = myElementsId->length();
|
|
||||||
} else {
|
|
||||||
SMESH::SMESH_subMesh_var aSubMesh =
|
|
||||||
SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO);
|
|
||||||
|
|
||||||
if (!aSubMesh->_is_nil()) { //SUBMESH
|
|
||||||
// get IDs from submesh
|
|
||||||
myElementsId = aSubMesh->GetElementsByType(neededType);
|
|
||||||
aNbElements = myElementsId->length();
|
|
||||||
} else {
|
|
||||||
SMESH::SMESH_GroupBase_var aGroup =
|
|
||||||
SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IO);
|
|
||||||
|
|
||||||
if (!aGroup->_is_nil() && aGroup->GetType() == neededType) { // GROUP
|
|
||||||
// get IDs from smesh group
|
|
||||||
myElementsId = aGroup->GetListOfID();
|
|
||||||
aNbElements = myElementsId->length();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
// get indices of selcted elements
|
// get indices of selcted elements
|
||||||
TColStd_IndexedMapOfInteger aMapIndex;
|
TColStd_IndexedMapOfInteger aMapIndex;
|
||||||
mySelector->GetIndex(IO,aMapIndex);
|
mySelector->GetIndex(IO,aMapIndex);
|
||||||
aNbElements = aMapIndex.Extent();
|
aNbElements = aMapIndex.Extent();
|
||||||
|
|
||||||
|
if (aNbElements < 1)
|
||||||
|
return;
|
||||||
|
|
||||||
myElementsId = new SMESH::long_array;
|
myElementsId = new SMESH::long_array;
|
||||||
myElementsId->length( aNbElements );
|
myElementsId->length( aNbElements );
|
||||||
aString = "";
|
aString = "";
|
||||||
@ -603,9 +603,6 @@ void SMESHGUI_ExtrusionDlg::SelectionIntoArgument()
|
|||||||
aString += QString(" %1").arg( myElementsId[ i ] = aMapIndex( i+1 ) );
|
aString += QString(" %1").arg( myElementsId[ i ] = aMapIndex( i+1 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aNbElements < 1)
|
|
||||||
return;
|
|
||||||
|
|
||||||
myNbOkElements = true;
|
myNbOkElements = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,6 +83,8 @@ private:
|
|||||||
int myNbOkElements; /* to check when elements are defined */
|
int myNbOkElements; /* to check when elements are defined */
|
||||||
SVTK_Selector* mySelector;
|
SVTK_Selector* mySelector;
|
||||||
|
|
||||||
|
SMESH::SMESH_IDSource_var mySelectedObject;
|
||||||
|
|
||||||
bool myBusy;
|
bool myBusy;
|
||||||
SMESH::SMESH_Mesh_var myMesh;
|
SMESH::SMESH_Mesh_var myMesh;
|
||||||
SMESH::long_array_var myElementsId;
|
SMESH::long_array_var myElementsId;
|
||||||
|
@ -88,7 +88,8 @@
|
|||||||
SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
|
SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
|
||||||
: QDialog( SMESH::GetDesktop( theModule ) ),
|
: QDialog( SMESH::GetDesktop( theModule ) ),
|
||||||
mySMESHGUI( theModule ),
|
mySMESHGUI( theModule ),
|
||||||
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
|
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
|
||||||
|
mySelectedObject(SMESH::SMESH_IDSource::_nil())
|
||||||
{
|
{
|
||||||
mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));
|
mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));
|
||||||
|
|
||||||
@ -494,12 +495,31 @@ bool SMESHGUI_RevolutionDlg::ClickOnApply()
|
|||||||
SUIT_OverrideCursor aWaitCursor;
|
SUIT_OverrideCursor aWaitCursor;
|
||||||
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( GetConstructorId() == 0 )
|
||||||
|
SMESH::ListOfGroups_var groups =
|
||||||
|
aMeshEditor->RotationSweepObject1DMakeGroups(mySelectedObject, anAxis,
|
||||||
|
anAngle, aNbSteps, aTolerance);
|
||||||
|
else
|
||||||
|
SMESH::ListOfGroups_var groups =
|
||||||
|
aMeshEditor->RotationSweepObject2DMakeGroups(mySelectedObject, anAxis,
|
||||||
|
anAngle, aNbSteps, aTolerance);
|
||||||
|
}
|
||||||
|
else
|
||||||
SMESH::ListOfGroups_var groups =
|
SMESH::ListOfGroups_var groups =
|
||||||
aMeshEditor->RotationSweepMakeGroups(anElementsId.inout(), anAxis,
|
aMeshEditor->RotationSweepMakeGroups(anElementsId.inout(), anAxis,
|
||||||
anAngle, aNbSteps, aTolerance);
|
anAngle, aNbSteps, aTolerance);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if( CheckBoxMesh->isChecked() ) {
|
||||||
|
if( GetConstructorId() == 0 )
|
||||||
|
aMeshEditor->RotationSweepObject1D(mySelectedObject, anAxis, anAngle, aNbSteps, aTolerance);
|
||||||
else
|
else
|
||||||
|
aMeshEditor->RotationSweepObject2D(mySelectedObject, anAxis, anAngle, aNbSteps, aTolerance);
|
||||||
|
}
|
||||||
aMeshEditor->RotationSweep(anElementsId.inout(), anAxis, anAngle, aNbSteps, aTolerance);
|
aMeshEditor->RotationSweep(anElementsId.inout(), anAxis, anAngle, aNbSteps, aTolerance);
|
||||||
|
}
|
||||||
|
|
||||||
myMesh->SetParameters( SMESHGUI::JoinObjectParameters(aParameters) );
|
myMesh->SetParameters( SMESHGUI::JoinObjectParameters(aParameters) );
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
@ -510,6 +530,7 @@ bool SMESHGUI_RevolutionDlg::ClickOnApply()
|
|||||||
mySMESHGUI->updateObjBrowser(true); // new groups may appear
|
mySMESHGUI->updateObjBrowser(true); // new groups may appear
|
||||||
Init(false);
|
Init(false);
|
||||||
ConstructorsClicked(GetConstructorId());
|
ConstructorsClicked(GetConstructorId());
|
||||||
|
mySelectedObject = SMESH::SMESH_IDSource::_nil();
|
||||||
SelectionIntoArgument();
|
SelectionIntoArgument();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -689,77 +710,18 @@ void SMESHGUI_RevolutionDlg::SelectionIntoArgument()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (CheckBoxMesh->isChecked()) {
|
if (CheckBoxMesh->isChecked()) {
|
||||||
int aConstructorId = GetConstructorId();
|
|
||||||
|
|
||||||
SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
|
SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
|
||||||
|
|
||||||
if (!SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO)->_is_nil()) { //MESH
|
if (!SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO)->_is_nil())
|
||||||
// get IDs from mesh
|
mySelectedObject = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO);
|
||||||
SMDS_Mesh* aSMDSMesh = myActor->GetObject()->GetMesh();
|
else
|
||||||
if (!aSMDSMesh)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (aConstructorId == 0) {
|
|
||||||
SMDS_EdgeIteratorPtr anIter = aSMDSMesh->edgesIterator();
|
|
||||||
|
|
||||||
while (anIter->more()) {
|
|
||||||
const SMDS_MeshEdge * edge = anIter->next();
|
|
||||||
if (edge) {
|
|
||||||
myElementsId += QString(" %1").arg(edge->GetID());
|
|
||||||
aNbUnits++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (aConstructorId == 1) {
|
|
||||||
SMDS_FaceIteratorPtr anIter = aSMDSMesh->facesIterator();
|
|
||||||
while (anIter->more()) {
|
|
||||||
const SMDS_MeshFace * face = anIter->next();
|
|
||||||
if (face) {
|
|
||||||
myElementsId += QString(" %1").arg(face->GetID());
|
|
||||||
aNbUnits++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (!SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO)->_is_nil()) { //SUBMESH
|
|
||||||
// get submesh
|
|
||||||
SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO);
|
|
||||||
|
|
||||||
// get IDs from submesh
|
|
||||||
SMESH::long_array_var anElementsIds = new SMESH::long_array;
|
|
||||||
if (aConstructorId == 0)
|
|
||||||
anElementsIds = aSubMesh->GetElementsByType(SMESH::EDGE);
|
|
||||||
else if (aConstructorId == 1)
|
|
||||||
anElementsIds = aSubMesh->GetElementsByType(SMESH::FACE);
|
|
||||||
|
|
||||||
for (int i = 0; i < anElementsIds->length(); i++)
|
|
||||||
myElementsId += QString(" %1").arg(anElementsIds[i]);
|
|
||||||
aNbUnits = anElementsIds->length();
|
|
||||||
} else { // GROUP
|
|
||||||
// get smesh group
|
|
||||||
SMESH::SMESH_GroupBase_var aGroup =
|
|
||||||
SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IO);
|
|
||||||
if (aGroup->_is_nil())
|
|
||||||
return;
|
|
||||||
|
|
||||||
if ((aConstructorId == 0 && aGroup->GetType()!= SMESH::EDGE) ||
|
|
||||||
(aConstructorId == 1 && aGroup->GetType()!= SMESH::FACE))
|
|
||||||
return;
|
|
||||||
|
|
||||||
// get IDs from smesh group
|
|
||||||
SMESH::long_array_var anElementsIds = new SMESH::long_array;
|
|
||||||
anElementsIds = aGroup->GetListOfID();
|
|
||||||
for (int i = 0; i < anElementsIds->length(); i++) {
|
|
||||||
myElementsId += QString(" %1").arg(anElementsIds[i]);
|
|
||||||
}
|
|
||||||
aNbUnits = anElementsIds->length();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, IO, aString);
|
aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, IO, aString);
|
||||||
myElementsId = aString;
|
myElementsId = aString;
|
||||||
}
|
|
||||||
|
|
||||||
if (aNbUnits < 1)
|
if (aNbUnits < 1)
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
myNbOkElements = true;
|
myNbOkElements = true;
|
||||||
} else {
|
} else {
|
||||||
aNbUnits = SMESH::GetNameOfSelectedNodes(mySelector, IO, aString);
|
aNbUnits = SMESH::GetNameOfSelectedNodes(mySelector, IO, aString);
|
||||||
@ -1064,6 +1026,15 @@ void SMESHGUI_RevolutionDlg::onDisplaySimulation(bool toDisplayPreview)
|
|||||||
try {
|
try {
|
||||||
SUIT_OverrideCursor aWaitCursor;
|
SUIT_OverrideCursor aWaitCursor;
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
|
||||||
|
if( CheckBoxMesh->isChecked() ) {
|
||||||
|
if( GetConstructorId() == 0 )
|
||||||
|
aMeshEditor->RotationSweepObject1D(mySelectedObject, anAxis,
|
||||||
|
anAngle, aNbSteps, aTolerance);
|
||||||
|
else
|
||||||
|
aMeshEditor->RotationSweepObject2D(mySelectedObject, anAxis,
|
||||||
|
anAngle, aNbSteps, aTolerance);
|
||||||
|
}
|
||||||
|
else
|
||||||
aMeshEditor->RotationSweep(anElementsId.inout(),
|
aMeshEditor->RotationSweep(anElementsId.inout(),
|
||||||
anAxis,
|
anAxis,
|
||||||
anAngle,
|
anAngle,
|
||||||
|
@ -85,6 +85,8 @@ private:
|
|||||||
QWidget* myEditCurrentArgument; /* Current argument */
|
QWidget* myEditCurrentArgument; /* Current argument */
|
||||||
SVTK_Selector* mySelector;
|
SVTK_Selector* mySelector;
|
||||||
|
|
||||||
|
SMESH::SMESH_IDSource_var mySelectedObject;
|
||||||
|
|
||||||
bool myBusy;
|
bool myBusy;
|
||||||
SMESH::SMESH_Mesh_var myMesh;
|
SMESH::SMESH_Mesh_var myMesh;
|
||||||
SMESH_Actor* myActor;
|
SMESH_Actor* myActor;
|
||||||
|
@ -90,7 +90,8 @@
|
|||||||
SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule )
|
SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule )
|
||||||
: QDialog( SMESH::GetDesktop( theModule ) ),
|
: QDialog( SMESH::GetDesktop( theModule ) ),
|
||||||
mySMESHGUI( theModule ),
|
mySMESHGUI( theModule ),
|
||||||
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
|
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
|
||||||
|
mySelectedObject(SMESH::SMESH_IDSource::_nil())
|
||||||
{
|
{
|
||||||
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_SMOOTHING")));
|
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_SMOOTHING")));
|
||||||
QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
|
QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
|
||||||
@ -350,12 +351,22 @@ bool SMESHGUI_SmoothingDlg::ClickOnApply()
|
|||||||
SUIT_OverrideCursor aWaitCursor;
|
SUIT_OverrideCursor aWaitCursor;
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
||||||
|
|
||||||
if ( CheckBoxParametric->isChecked() )
|
if ( CheckBoxParametric->isChecked() ) {
|
||||||
|
if(CheckBoxMesh->isChecked())
|
||||||
|
aResult = aMeshEditor->SmoothParametricObject(mySelectedObject, aNodesId.inout(),
|
||||||
|
anIterationLimit, aMaxAspectRatio, aMethod);
|
||||||
|
else
|
||||||
aResult = aMeshEditor->SmoothParametric(anElementsId.inout(), aNodesId.inout(),
|
aResult = aMeshEditor->SmoothParametric(anElementsId.inout(), aNodesId.inout(),
|
||||||
anIterationLimit, aMaxAspectRatio, aMethod);
|
anIterationLimit, aMaxAspectRatio, aMethod);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if(CheckBoxMesh->isChecked())
|
||||||
|
aResult = aMeshEditor->SmoothObject(mySelectedObject, aNodesId.inout(),
|
||||||
|
anIterationLimit, aMaxAspectRatio, aMethod);
|
||||||
else
|
else
|
||||||
aResult = aMeshEditor->Smooth(anElementsId.inout(), aNodesId.inout(),
|
aResult = aMeshEditor->Smooth(anElementsId.inout(), aNodesId.inout(),
|
||||||
anIterationLimit, aMaxAspectRatio, aMethod);
|
anIterationLimit, aMaxAspectRatio, aMethod);
|
||||||
|
}
|
||||||
|
|
||||||
myMesh->SetParameters( SMESHGUI::JoinObjectParameters(aParameters) );
|
myMesh->SetParameters( SMESHGUI::JoinObjectParameters(aParameters) );
|
||||||
|
|
||||||
@ -370,6 +381,8 @@ bool SMESHGUI_SmoothingDlg::ClickOnApply()
|
|||||||
mySelectionMgr->setSelectedObjects(aList, false);
|
mySelectionMgr->setSelectedObjects(aList, false);
|
||||||
SMESH::UpdateView();
|
SMESH::UpdateView();
|
||||||
Init();
|
Init();
|
||||||
|
|
||||||
|
mySelectedObject = SMESH::SMESH_IDSource::_nil();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -543,48 +556,15 @@ void SMESHGUI_SmoothingDlg::SelectionIntoArgument()
|
|||||||
if (CheckBoxMesh->isChecked()) {
|
if (CheckBoxMesh->isChecked()) {
|
||||||
SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
|
SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
|
||||||
|
|
||||||
if (!SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO)->_is_nil()) { //MESH
|
if (!SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO)->_is_nil())
|
||||||
// get IDs from mesh
|
mySelectedObject = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO);
|
||||||
SMDS_Mesh* aSMDSMesh = myActor->GetObject()->GetMesh();
|
else
|
||||||
if (!aSMDSMesh)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (int i = aSMDSMesh->MinElementID(); i <= aSMDSMesh->MaxElementID(); i++ ) {
|
|
||||||
const SMDS_MeshElement * e = aSMDSMesh->FindElement(i);
|
|
||||||
if (e) {
|
|
||||||
myElementsId += QString(" %1").arg(i);
|
|
||||||
aNbUnits++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (!SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO)->_is_nil()) { //SUBMESH
|
|
||||||
// get submesh
|
|
||||||
SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO);
|
|
||||||
|
|
||||||
// get IDs from submesh
|
|
||||||
SMESH::long_array_var anElementsIds = new SMESH::long_array;
|
|
||||||
anElementsIds = aSubMesh->GetElementsId();
|
|
||||||
for (int i = 0; i < anElementsIds->length(); i++) {
|
|
||||||
myElementsId += QString(" %1").arg(anElementsIds[i]);
|
|
||||||
}
|
|
||||||
aNbUnits = anElementsIds->length();
|
|
||||||
} else { // GROUP
|
|
||||||
// get smesh group
|
|
||||||
SMESH::SMESH_GroupBase_var aGroup =
|
|
||||||
SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IO);
|
|
||||||
if (aGroup->_is_nil())
|
|
||||||
return;
|
|
||||||
|
|
||||||
// get IDs from smesh group
|
|
||||||
SMESH::long_array_var anElementsIds = new SMESH::long_array;
|
|
||||||
anElementsIds = aGroup->GetListOfID();
|
|
||||||
for (int i = 0; i < anElementsIds->length(); i++) {
|
|
||||||
myElementsId += QString(" %1").arg(anElementsIds[i]);
|
|
||||||
}
|
|
||||||
aNbUnits = anElementsIds->length();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, IO, aString);
|
aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, IO, aString);
|
||||||
myElementsId = aString;
|
myElementsId = aString;
|
||||||
|
if (aNbUnits < 1)
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
} else if (myEditCurrentArgument == LineEditNodes && !myMesh->_is_nil() && myActor) {
|
} else if (myEditCurrentArgument == LineEditNodes && !myMesh->_is_nil() && myActor) {
|
||||||
myNbOkNodes = 0;
|
myNbOkNodes = 0;
|
||||||
@ -592,9 +572,6 @@ void SMESHGUI_SmoothingDlg::SelectionIntoArgument()
|
|||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aNbUnits < 1)
|
|
||||||
return;
|
|
||||||
|
|
||||||
myBusy = true;
|
myBusy = true;
|
||||||
myEditCurrentArgument->setText(aString);
|
myEditCurrentArgument->setText(aString);
|
||||||
myBusy = false;
|
myBusy = false;
|
||||||
|
@ -83,6 +83,8 @@ private:
|
|||||||
QLineEdit* myEditCurrentArgument; /* Current LineEdit */
|
QLineEdit* myEditCurrentArgument; /* Current LineEdit */
|
||||||
SVTK_Selector* mySelector;
|
SVTK_Selector* mySelector;
|
||||||
|
|
||||||
|
SMESH::SMESH_IDSource_var mySelectedObject;
|
||||||
|
|
||||||
bool myBusy;
|
bool myBusy;
|
||||||
SMESH::SMESH_Mesh_var myMesh;
|
SMESH::SMESH_Mesh_var myMesh;
|
||||||
SMESH_Actor* myActor;
|
SMESH_Actor* myActor;
|
||||||
|
@ -255,6 +255,13 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand
|
|||||||
map< _pyID, Handle(_pyMeshEditor) >::iterator id_editor = myMeshEditors.find( objID );
|
map< _pyID, Handle(_pyMeshEditor) >::iterator id_editor = myMeshEditors.find( objID );
|
||||||
if ( id_editor != myMeshEditors.end() ) {
|
if ( id_editor != myMeshEditors.end() ) {
|
||||||
id_editor->second->Process( aCommand );
|
id_editor->second->Process( aCommand );
|
||||||
|
TCollection_AsciiString processedCommand = aCommand->GetString();
|
||||||
|
// some commands of SMESH_MeshEditor create meshes
|
||||||
|
if ( aCommand->GetMethod().Search("MakeMesh") != -1 ) {
|
||||||
|
Handle(_pyMesh) mesh = new _pyMesh( aCommand, aCommand->GetResultValue() );
|
||||||
|
aCommand->GetString() = processedCommand; // discard changes made by _pyMesh
|
||||||
|
myMeshes.insert( make_pair( mesh->GetID(), mesh ));
|
||||||
|
}
|
||||||
return aCommand;
|
return aCommand;
|
||||||
}
|
}
|
||||||
// SMESH_Hypothesis method?
|
// SMESH_Hypothesis method?
|
||||||
@ -307,17 +314,20 @@ void _pyGen::Process( const Handle(_pyCommand)& theCommand )
|
|||||||
// CreateHypothesis( theHypType, theLibName )
|
// CreateHypothesis( theHypType, theLibName )
|
||||||
// Compute( mesh, geom )
|
// Compute( mesh, geom )
|
||||||
// mesh creation
|
// mesh creation
|
||||||
if ( theCommand->GetMethod() == "CreateMesh" ||
|
TCollection_AsciiString method = theCommand->GetMethod();
|
||||||
theCommand->GetMethod() == "CreateEmptyMesh" ||
|
if ( method == "CreateMesh" || method == "CreateEmptyMesh")
|
||||||
theCommand->GetMethod() == "CreateMeshesFromUNV" ||
|
|
||||||
theCommand->GetMethod() == "CreateMeshesFromSTL")
|
|
||||||
{
|
{
|
||||||
Handle(_pyMesh) mesh = new _pyMesh( theCommand );
|
Handle(_pyMesh) mesh = new _pyMesh( theCommand );
|
||||||
myMeshes.insert( make_pair( mesh->GetID(), mesh ));
|
myMeshes.insert( make_pair( mesh->GetID(), mesh ));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if ( method == "CreateMeshesFromUNV" || method == "CreateMeshesFromSTL")
|
||||||
if(theCommand->GetMethod() == "CreateMeshesFromMED")
|
{
|
||||||
|
Handle(_pyMesh) mesh = new _pyMesh( theCommand, theCommand->GetResultValue() );
|
||||||
|
myMeshes.insert( make_pair( mesh->GetID(), mesh ));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if( method == "CreateMeshesFromMED")
|
||||||
{
|
{
|
||||||
for(int ind = 0;ind<theCommand->GetNbResultValues();ind++)
|
for(int ind = 0;ind<theCommand->GetNbResultValues();ind++)
|
||||||
{
|
{
|
||||||
@ -327,14 +337,14 @@ void _pyGen::Process( const Handle(_pyCommand)& theCommand )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CreateHypothesis()
|
// CreateHypothesis()
|
||||||
if ( theCommand->GetMethod() == "CreateHypothesis" )
|
if ( method == "CreateHypothesis" )
|
||||||
{
|
{
|
||||||
myHypos.push_back( _pyHypothesis::NewHypothesis( theCommand ));
|
myHypos.push_back( _pyHypothesis::NewHypothesis( theCommand ));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// smeshgen.Compute( mesh, geom ) --> mesh.Compute()
|
// smeshgen.Compute( mesh, geom ) --> mesh.Compute()
|
||||||
if ( theCommand->GetMethod() == "Compute" )
|
if ( method == "Compute" )
|
||||||
{
|
{
|
||||||
const _pyID& meshID = theCommand->GetArg( 1 );
|
const _pyID& meshID = theCommand->GetArg( 1 );
|
||||||
map< _pyID, Handle(_pyMesh) >::iterator id_mesh = myMeshes.find( meshID );
|
map< _pyID, Handle(_pyMesh) >::iterator id_mesh = myMeshes.find( meshID );
|
||||||
@ -347,7 +357,7 @@ void _pyGen::Process( const Handle(_pyCommand)& theCommand )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// leave only one smeshgen.GetPattern() in the script
|
// leave only one smeshgen.GetPattern() in the script
|
||||||
if ( theCommand->GetMethod() == "GetPattern" ) {
|
if ( method == "GetPattern" ) {
|
||||||
if ( myHasPattern ) {
|
if ( myHasPattern ) {
|
||||||
theCommand->Clear();
|
theCommand->Clear();
|
||||||
return;
|
return;
|
||||||
@ -356,9 +366,14 @@ void _pyGen::Process( const Handle(_pyCommand)& theCommand )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Concatenate( [mesh1, ...], ... )
|
// Concatenate( [mesh1, ...], ... )
|
||||||
if ( theCommand->GetMethod() == "Concatenate" ||
|
if ( method == "Concatenate" || method == "ConcatenateWithGroups")
|
||||||
theCommand->GetMethod() == "ConcatenateWithGroups")
|
|
||||||
{
|
{
|
||||||
|
if ( method == "ConcatenateWithGroups" ) {
|
||||||
|
theCommand->SetMethod( "Concatenate" );
|
||||||
|
theCommand->SetArg( theCommand->GetNbArgs() + 1, "True" );
|
||||||
|
}
|
||||||
|
Handle(_pyMesh) mesh = new _pyMesh( theCommand, theCommand->GetResultValue() );
|
||||||
|
myMeshes.insert( make_pair( mesh->GetID(), mesh ));
|
||||||
AddMeshAccessorMethod( theCommand );
|
AddMeshAccessorMethod( theCommand );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -614,17 +629,16 @@ static bool sameGroupType( const _pyID& grpID,
|
|||||||
*/
|
*/
|
||||||
//================================================================================
|
//================================================================================
|
||||||
|
|
||||||
_pyMesh::_pyMesh(const Handle(_pyCommand) theCreationCmd):
|
_pyMesh::_pyMesh(const Handle(_pyCommand) theCreationCmd)
|
||||||
_pyObject(theCreationCmd), myHasEditor(false)
|
: _pyObject(theCreationCmd), myHasEditor(false)
|
||||||
{
|
{
|
||||||
// convert my creation command
|
// convert my creation command
|
||||||
Handle(_pyCommand) creationCmd = GetCreationCmd();
|
Handle(_pyCommand) creationCmd = GetCreationCmd();
|
||||||
TCollection_AsciiString str = creationCmd->GetMethod();
|
//TCollection_AsciiString str = creationCmd->GetMethod();
|
||||||
|
// if(str != "CreateMeshesFromUNV" &&
|
||||||
|
// str != "CreateMeshesFromMED" &&
|
||||||
|
// str != "CreateMeshesFromSTL")
|
||||||
creationCmd->SetObject( SMESH_2smeshpy::SmeshpyName() );
|
creationCmd->SetObject( SMESH_2smeshpy::SmeshpyName() );
|
||||||
if(str != "CreateMeshesFromUNV" &&
|
|
||||||
str != "CreateMeshesFromMED" &&
|
|
||||||
str != "CreateMeshesFromSTL")
|
|
||||||
creationCmd->SetMethod( "Mesh" );
|
creationCmd->SetMethod( "Mesh" );
|
||||||
|
|
||||||
theGen->SetAccessorMethod( GetID(), "GetMesh()" );
|
theGen->SetAccessorMethod( GetID(), "GetMesh()" );
|
||||||
@ -898,8 +912,9 @@ void _pyMeshEditor::Process( const Handle(_pyCommand)& theCommand)
|
|||||||
"InverseDiag","DeleteDiag","Reorient","ReorientObject","TriToQuad","SplitQuad","SplitQuadObject",
|
"InverseDiag","DeleteDiag","Reorient","ReorientObject","TriToQuad","SplitQuad","SplitQuadObject",
|
||||||
"BestSplit","Smooth","SmoothObject","SmoothParametric","SmoothParametricObject",
|
"BestSplit","Smooth","SmoothObject","SmoothParametric","SmoothParametricObject",
|
||||||
"ConvertToQuadratic","ConvertFromQuadratic","RenumberNodes","RenumberElements",
|
"ConvertToQuadratic","ConvertFromQuadratic","RenumberNodes","RenumberElements",
|
||||||
"RotationSweep","RotationSweepObject","ExtrusionSweep","AdvancedExtrusion",
|
"RotationSweep","RotationSweepObject","RotationSweepObject1D","RotationSweepObject2D",
|
||||||
"ExtrusionSweepObject","ExtrusionSweepObject1D","ExtrusionSweepObject2D","ExtrusionAlongPath",
|
"ExtrusionSweep","AdvancedExtrusion","ExtrusionSweepObject","ExtrusionSweepObject1D","ExtrusionSweepObject2D",
|
||||||
|
"ExtrusionAlongPath","ExtrusionAlongPathObject","ExtrusionAlongPathObject1D","ExtrusionAlongPathObject2D",
|
||||||
"Mirror","MirrorObject","Translate","TranslateObject","Rotate","RotateObject",
|
"Mirror","MirrorObject","Translate","TranslateObject","Rotate","RotateObject",
|
||||||
"FindCoincidentNodes","FindCoincidentNodesOnPart","MergeNodes","FindEqualElements",
|
"FindCoincidentNodes","FindCoincidentNodesOnPart","MergeNodes","FindEqualElements",
|
||||||
"MergeElements","MergeEqualElements","SewFreeBorders","SewConformFreeBorders",
|
"MergeElements","MergeEqualElements","SewFreeBorders","SewConformFreeBorders",
|
||||||
@ -928,8 +943,8 @@ void _pyMeshEditor::Process( const Handle(_pyCommand)& theCommand)
|
|||||||
|
|
||||||
// meshes made by *MakeMesh() methods are not wrapped by _pyMesh,
|
// meshes made by *MakeMesh() methods are not wrapped by _pyMesh,
|
||||||
// so let _pyMesh care of it (TMP?)
|
// so let _pyMesh care of it (TMP?)
|
||||||
if ( theCommand->GetMethod().Search("MakeMesh") != -1 )
|
// if ( theCommand->GetMethod().Search("MakeMesh") != -1 )
|
||||||
_pyMesh( new _pyCommand( theCommand->GetString(), 0 )); // for theGen->SetAccessorMethod()
|
// _pyMesh( new _pyCommand( theCommand->GetString(), 0 )); // for theGen->SetAccessorMethod()
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
@ -1718,8 +1733,22 @@ const TCollection_AsciiString & _pyCommand::GetObject()
|
|||||||
{
|
{
|
||||||
// beginning
|
// beginning
|
||||||
int begPos = GetBegPos( RESULT_IND ) + myRes.Length();
|
int begPos = GetBegPos( RESULT_IND ) + myRes.Length();
|
||||||
if ( begPos < 1 )
|
if ( begPos < 1 ) {
|
||||||
begPos = myString.Location( "=", 1, Length() ) + 1;
|
begPos = myString.Location( "=", 1, Length() ) + 1;
|
||||||
|
// is '=' in the string argument (for example, name) or not
|
||||||
|
int nb1 = 0; // number of ' character at the left of =
|
||||||
|
int nb2 = 0; // number of " character at the left of =
|
||||||
|
for ( int i = 1; i < begPos-1; i++ ) {
|
||||||
|
if ( IsEqual(myString.Value( i ), "'" ) )
|
||||||
|
nb1 += 1;
|
||||||
|
else if ( IsEqual( myString.Value( i ), '"' ) )
|
||||||
|
nb2 += 1;
|
||||||
|
}
|
||||||
|
// if number of ' or " is not divisible by 2,
|
||||||
|
// then get an object at the start of the command
|
||||||
|
if ( nb1 % 2 != 0 || nb2 % 2 != 0 )
|
||||||
|
begPos = 1;
|
||||||
|
}
|
||||||
// store
|
// store
|
||||||
myObj = GetWord( myString, begPos, true );
|
myObj = GetWord( myString, begPos, true );
|
||||||
SetBegPos( OBJECT_IND, begPos );
|
SetBegPos( OBJECT_IND, begPos );
|
||||||
|
@ -1353,12 +1353,13 @@ SMESH_MeshEditor_i::rotationSweep(const SMESH::long_array & theIDsOfElements,
|
|||||||
CORBA::Double theAngleInRadians,
|
CORBA::Double theAngleInRadians,
|
||||||
CORBA::Long theNbOfSteps,
|
CORBA::Long theNbOfSteps,
|
||||||
CORBA::Double theTolerance,
|
CORBA::Double theTolerance,
|
||||||
const bool theMakeGroups)
|
const bool theMakeGroups,
|
||||||
|
const SMDSAbs_ElementType theElementType)
|
||||||
{
|
{
|
||||||
initData();
|
initData();
|
||||||
|
|
||||||
TIDSortedElemSet inElements, copyElements;
|
TIDSortedElemSet inElements, copyElements;
|
||||||
arrayToSet(theIDsOfElements, GetMeshDS(), inElements);
|
arrayToSet(theIDsOfElements, GetMeshDS(), inElements, theElementType);
|
||||||
|
|
||||||
TIDSortedElemSet* workElements = & inElements;
|
TIDSortedElemSet* workElements = & inElements;
|
||||||
TPreviewMesh tmpMesh( SMDSAbs_Face );
|
TPreviewMesh tmpMesh( SMDSAbs_Face );
|
||||||
@ -1459,10 +1460,9 @@ void SMESH_MeshEditor_i::RotationSweepObject(SMESH::SMESH_IDSource_ptr theObject
|
|||||||
CORBA::Double theTolerance)
|
CORBA::Double theTolerance)
|
||||||
{
|
{
|
||||||
if ( !myPreviewMode ) {
|
if ( !myPreviewMode ) {
|
||||||
TPythonDump() << "axis = " << theAxis;
|
|
||||||
TPythonDump() << this << ".RotationSweepObject( "
|
TPythonDump() << this << ".RotationSweepObject( "
|
||||||
<< theObject
|
<< theObject << ", "
|
||||||
<< ", axis, "
|
<< theAxis << ", "
|
||||||
<< theAngleInRadians << ", "
|
<< theAngleInRadians << ", "
|
||||||
<< theNbOfSteps << ", "
|
<< theNbOfSteps << ", "
|
||||||
<< theTolerance << " )";
|
<< theTolerance << " )";
|
||||||
@ -1476,6 +1476,64 @@ void SMESH_MeshEditor_i::RotationSweepObject(SMESH::SMESH_IDSource_ptr theObject
|
|||||||
false);
|
false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : RotationSweepObject1D
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
|
void SMESH_MeshEditor_i::RotationSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
|
||||||
|
const SMESH::AxisStruct & theAxis,
|
||||||
|
CORBA::Double theAngleInRadians,
|
||||||
|
CORBA::Long theNbOfSteps,
|
||||||
|
CORBA::Double theTolerance)
|
||||||
|
{
|
||||||
|
if ( !myPreviewMode ) {
|
||||||
|
TPythonDump() << this << ".RotationSweepObject1D( "
|
||||||
|
<< theObject << ", "
|
||||||
|
<< theAxis << ", "
|
||||||
|
<< theAngleInRadians << ", "
|
||||||
|
<< theNbOfSteps << ", "
|
||||||
|
<< theTolerance << " )";
|
||||||
|
}
|
||||||
|
SMESH::long_array_var anElementsId = theObject->GetIDs();
|
||||||
|
rotationSweep(anElementsId,
|
||||||
|
theAxis,
|
||||||
|
theAngleInRadians,
|
||||||
|
theNbOfSteps,
|
||||||
|
theTolerance,
|
||||||
|
false,
|
||||||
|
SMDSAbs_Edge);
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : RotationSweepObject2D
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
|
void SMESH_MeshEditor_i::RotationSweepObject2D(SMESH::SMESH_IDSource_ptr theObject,
|
||||||
|
const SMESH::AxisStruct & theAxis,
|
||||||
|
CORBA::Double theAngleInRadians,
|
||||||
|
CORBA::Long theNbOfSteps,
|
||||||
|
CORBA::Double theTolerance)
|
||||||
|
{
|
||||||
|
if ( !myPreviewMode ) {
|
||||||
|
TPythonDump() << this << ".RotationSweepObject2D( "
|
||||||
|
<< theObject << ", "
|
||||||
|
<< theAxis << ", "
|
||||||
|
<< theAngleInRadians << ", "
|
||||||
|
<< theNbOfSteps << ", "
|
||||||
|
<< theTolerance << " )";
|
||||||
|
}
|
||||||
|
SMESH::long_array_var anElementsId = theObject->GetIDs();
|
||||||
|
rotationSweep(anElementsId,
|
||||||
|
theAxis,
|
||||||
|
theAngleInRadians,
|
||||||
|
theNbOfSteps,
|
||||||
|
theTolerance,
|
||||||
|
false,
|
||||||
|
SMDSAbs_Face);
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : RotationSweepObjectMakeGroups
|
//function : RotationSweepObjectMakeGroups
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -1496,12 +1554,77 @@ SMESH_MeshEditor_i::RotationSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr theO
|
|||||||
theTolerance,
|
theTolerance,
|
||||||
true);
|
true);
|
||||||
if ( !myPreviewMode ) {
|
if ( !myPreviewMode ) {
|
||||||
TPythonDump() << "axis = " << theAxis;
|
|
||||||
TPythonDump aPythonDump;
|
TPythonDump aPythonDump;
|
||||||
DumpGroupsList(aPythonDump,aGroups);
|
DumpGroupsList(aPythonDump,aGroups);
|
||||||
aPythonDump<< this << ".RotationSweepObjectMakeGroups( "
|
aPythonDump<< this << ".RotationSweepObjectMakeGroups( "
|
||||||
<< theObject
|
<< theObject << ", "
|
||||||
<< ", axis, "
|
<< theAxis << ", "
|
||||||
|
<< theAngleInRadians << ", "
|
||||||
|
<< theNbOfSteps << ", "
|
||||||
|
<< theTolerance << " )";
|
||||||
|
}
|
||||||
|
return aGroups;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : RotationSweepObject1DMakeGroups
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
|
SMESH::ListOfGroups*
|
||||||
|
SMESH_MeshEditor_i::RotationSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
|
||||||
|
const SMESH::AxisStruct& theAxis,
|
||||||
|
CORBA::Double theAngleInRadians,
|
||||||
|
CORBA::Long theNbOfSteps,
|
||||||
|
CORBA::Double theTolerance)
|
||||||
|
{
|
||||||
|
SMESH::long_array_var anElementsId = theObject->GetIDs();
|
||||||
|
SMESH::ListOfGroups *aGroups = rotationSweep(anElementsId,
|
||||||
|
theAxis,
|
||||||
|
theAngleInRadians,
|
||||||
|
theNbOfSteps,
|
||||||
|
theTolerance,
|
||||||
|
true,
|
||||||
|
SMDSAbs_Edge);
|
||||||
|
if ( !myPreviewMode ) {
|
||||||
|
TPythonDump aPythonDump;
|
||||||
|
DumpGroupsList(aPythonDump,aGroups);
|
||||||
|
aPythonDump<< this << ".RotationSweepObject1DMakeGroups( "
|
||||||
|
<< theObject << ", "
|
||||||
|
<< theAxis << ", "
|
||||||
|
<< theAngleInRadians << ", "
|
||||||
|
<< theNbOfSteps << ", "
|
||||||
|
<< theTolerance << " )";
|
||||||
|
}
|
||||||
|
return aGroups;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : RotationSweepObject2DMakeGroups
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
|
SMESH::ListOfGroups*
|
||||||
|
SMESH_MeshEditor_i::RotationSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
|
||||||
|
const SMESH::AxisStruct& theAxis,
|
||||||
|
CORBA::Double theAngleInRadians,
|
||||||
|
CORBA::Long theNbOfSteps,
|
||||||
|
CORBA::Double theTolerance)
|
||||||
|
{
|
||||||
|
SMESH::long_array_var anElementsId = theObject->GetIDs();
|
||||||
|
SMESH::ListOfGroups *aGroups = rotationSweep(anElementsId,
|
||||||
|
theAxis,
|
||||||
|
theAngleInRadians,
|
||||||
|
theNbOfSteps,
|
||||||
|
theTolerance,
|
||||||
|
true,
|
||||||
|
SMDSAbs_Face);
|
||||||
|
if ( !myPreviewMode ) {
|
||||||
|
TPythonDump aPythonDump;
|
||||||
|
DumpGroupsList(aPythonDump,aGroups);
|
||||||
|
aPythonDump<< this << ".RotationSweepObject2DMakeGroups( "
|
||||||
|
<< theObject << ", "
|
||||||
|
<< theAxis << ", "
|
||||||
<< theAngleInRadians << ", "
|
<< theAngleInRadians << ", "
|
||||||
<< theNbOfSteps << ", "
|
<< theNbOfSteps << ", "
|
||||||
<< theTolerance << " )";
|
<< theTolerance << " )";
|
||||||
@ -1579,9 +1702,8 @@ void SMESH_MeshEditor_i::ExtrusionSweepObject(SMESH::SMESH_IDSource_ptr theObjec
|
|||||||
SMESH::long_array_var anElementsId = theObject->GetIDs();
|
SMESH::long_array_var anElementsId = theObject->GetIDs();
|
||||||
extrusionSweep (anElementsId, theStepVector, theNbOfSteps, false );
|
extrusionSweep (anElementsId, theStepVector, theNbOfSteps, false );
|
||||||
if ( !myPreviewMode ) {
|
if ( !myPreviewMode ) {
|
||||||
TPythonDump() << "stepVector = " << theStepVector;
|
|
||||||
TPythonDump() << this << ".ExtrusionSweepObject( "
|
TPythonDump() << this << ".ExtrusionSweepObject( "
|
||||||
<< theObject << ", stepVector, " << theNbOfSteps << " )";
|
<< theObject << ", " << theStepVector << ", " << theNbOfSteps << " )";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1597,9 +1719,8 @@ void SMESH_MeshEditor_i::ExtrusionSweepObject1D(SMESH::SMESH_IDSource_ptr theObj
|
|||||||
SMESH::long_array_var anElementsId = theObject->GetIDs();
|
SMESH::long_array_var anElementsId = theObject->GetIDs();
|
||||||
extrusionSweep (anElementsId, theStepVector, theNbOfSteps, false, SMDSAbs_Edge );
|
extrusionSweep (anElementsId, theStepVector, theNbOfSteps, false, SMDSAbs_Edge );
|
||||||
if ( !myPreviewMode ) {
|
if ( !myPreviewMode ) {
|
||||||
TPythonDump() << "stepVector = " << theStepVector;
|
|
||||||
TPythonDump() << this << ".ExtrusionSweepObject1D( "
|
TPythonDump() << this << ".ExtrusionSweepObject1D( "
|
||||||
<< theObject << ", stepVector, " << theNbOfSteps << " )";
|
<< theObject << ", " << theStepVector << ", " << theNbOfSteps << " )";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1615,9 +1736,8 @@ void SMESH_MeshEditor_i::ExtrusionSweepObject2D(SMESH::SMESH_IDSource_ptr theObj
|
|||||||
SMESH::long_array_var anElementsId = theObject->GetIDs();
|
SMESH::long_array_var anElementsId = theObject->GetIDs();
|
||||||
extrusionSweep (anElementsId, theStepVector, theNbOfSteps, false, SMDSAbs_Face );
|
extrusionSweep (anElementsId, theStepVector, theNbOfSteps, false, SMDSAbs_Face );
|
||||||
if ( !myPreviewMode ) {
|
if ( !myPreviewMode ) {
|
||||||
TPythonDump() << "stepVector = " << theStepVector;
|
|
||||||
TPythonDump() << this << ".ExtrusionSweepObject2D( "
|
TPythonDump() << this << ".ExtrusionSweepObject2D( "
|
||||||
<< theObject << ", stepVector, " << theNbOfSteps << " )";
|
<< theObject << ", " << theStepVector << ", " << theNbOfSteps << " )";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1655,11 +1775,10 @@ SMESH_MeshEditor_i::ExtrusionSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr the
|
|||||||
SMESH::ListOfGroups * aGroups = extrusionSweep (anElementsId, theStepVector, theNbOfSteps, true );
|
SMESH::ListOfGroups * aGroups = extrusionSweep (anElementsId, theStepVector, theNbOfSteps, true );
|
||||||
|
|
||||||
if ( !myPreviewMode ) {
|
if ( !myPreviewMode ) {
|
||||||
TPythonDump() << "stepVector = " << theStepVector;
|
|
||||||
TPythonDump aPythonDump;
|
TPythonDump aPythonDump;
|
||||||
DumpGroupsList(aPythonDump,aGroups);
|
DumpGroupsList(aPythonDump,aGroups);
|
||||||
aPythonDump<< this << ".ExtrusionSweepObjectMakeGroups( "
|
aPythonDump<< this << ".ExtrusionSweepObjectMakeGroups( "
|
||||||
<< theObject << ", stepVector, " << theNbOfSteps << " )";
|
<< theObject << ", " << theStepVector << ", " << theNbOfSteps << " )";
|
||||||
}
|
}
|
||||||
return aGroups;
|
return aGroups;
|
||||||
}
|
}
|
||||||
@ -1677,11 +1796,10 @@ SMESH_MeshEditor_i::ExtrusionSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr t
|
|||||||
SMESH::long_array_var anElementsId = theObject->GetIDs();
|
SMESH::long_array_var anElementsId = theObject->GetIDs();
|
||||||
SMESH::ListOfGroups * aGroups = extrusionSweep (anElementsId, theStepVector, theNbOfSteps, true, SMDSAbs_Edge );
|
SMESH::ListOfGroups * aGroups = extrusionSweep (anElementsId, theStepVector, theNbOfSteps, true, SMDSAbs_Edge );
|
||||||
if ( !myPreviewMode ) {
|
if ( !myPreviewMode ) {
|
||||||
TPythonDump() << "stepVector = " << theStepVector;
|
|
||||||
TPythonDump aPythonDump;
|
TPythonDump aPythonDump;
|
||||||
DumpGroupsList(aPythonDump,aGroups);
|
DumpGroupsList(aPythonDump,aGroups);
|
||||||
aPythonDump << this << ".ExtrusionSweepObject1DMakeGroups( "
|
aPythonDump << this << ".ExtrusionSweepObject1DMakeGroups( "
|
||||||
<< theObject << ", stepVector, " << theNbOfSteps << " )";
|
<< theObject << ", " << theStepVector << ", " << theNbOfSteps << " )";
|
||||||
}
|
}
|
||||||
return aGroups;
|
return aGroups;
|
||||||
}
|
}
|
||||||
@ -1699,11 +1817,10 @@ SMESH_MeshEditor_i::ExtrusionSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr t
|
|||||||
SMESH::long_array_var anElementsId = theObject->GetIDs();
|
SMESH::long_array_var anElementsId = theObject->GetIDs();
|
||||||
SMESH::ListOfGroups * aGroups = extrusionSweep (anElementsId, theStepVector, theNbOfSteps, true, SMDSAbs_Face );
|
SMESH::ListOfGroups * aGroups = extrusionSweep (anElementsId, theStepVector, theNbOfSteps, true, SMDSAbs_Face );
|
||||||
if ( !myPreviewMode ) {
|
if ( !myPreviewMode ) {
|
||||||
TPythonDump() << "stepVector = " << theStepVector;
|
|
||||||
TPythonDump aPythonDump;
|
TPythonDump aPythonDump;
|
||||||
DumpGroupsList(aPythonDump,aGroups);
|
DumpGroupsList(aPythonDump,aGroups);
|
||||||
aPythonDump << this << ".ExtrusionSweepObject2DMakeGroups( "
|
aPythonDump << this << ".ExtrusionSweepObject2DMakeGroups( "
|
||||||
<< theObject << ", stepVector, " << theNbOfSteps << " )";
|
<< theObject << ", " << theStepVector << ", " << theNbOfSteps << " )";
|
||||||
}
|
}
|
||||||
return aGroups;
|
return aGroups;
|
||||||
}
|
}
|
||||||
@ -1840,7 +1957,8 @@ SMESH_MeshEditor_i::extrusionAlongPath(const SMESH::long_array & theIDsOfEleme
|
|||||||
CORBA::Boolean theHasRefPoint,
|
CORBA::Boolean theHasRefPoint,
|
||||||
const SMESH::PointStruct & theRefPoint,
|
const SMESH::PointStruct & theRefPoint,
|
||||||
const bool theMakeGroups,
|
const bool theMakeGroups,
|
||||||
SMESH::SMESH_MeshEditor::Extrusion_Error & theError)
|
SMESH::SMESH_MeshEditor::Extrusion_Error & theError,
|
||||||
|
const SMDSAbs_ElementType theElementType)
|
||||||
{
|
{
|
||||||
initData();
|
initData();
|
||||||
|
|
||||||
@ -1865,7 +1983,7 @@ SMESH_MeshEditor_i::extrusionAlongPath(const SMESH::long_array & theIDsOfEleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
TIDSortedElemSet elements;
|
TIDSortedElemSet elements;
|
||||||
arrayToSet(theIDsOfElements, GetMeshDS(), elements);
|
arrayToSet(theIDsOfElements, GetMeshDS(), elements, theElementType);
|
||||||
|
|
||||||
list<double> angles;
|
list<double> angles;
|
||||||
for (int i = 0; i < theAngles.length(); i++) {
|
for (int i = 0; i < theAngles.length(); i++) {
|
||||||
@ -1953,24 +2071,18 @@ SMESH_MeshEditor_i::ExtrusionAlongPathObject(SMESH::SMESH_IDSource_ptr theObje
|
|||||||
const SMESH::PointStruct & theRefPoint)
|
const SMESH::PointStruct & theRefPoint)
|
||||||
{
|
{
|
||||||
if ( !myPreviewMode ) {
|
if ( !myPreviewMode ) {
|
||||||
TPythonDump() << "rotAngles = " << theAngles;
|
|
||||||
|
|
||||||
if ( theHasRefPoint )
|
|
||||||
TPythonDump() << "refPoint = SMESH.PointStruct( "
|
|
||||||
<< theRefPoint.x << ", "
|
|
||||||
<< theRefPoint.y << ", "
|
|
||||||
<< theRefPoint.z << " )";
|
|
||||||
else
|
|
||||||
TPythonDump() << "refPoint = SMESH.PointStruct( 0,0,0 )";
|
|
||||||
|
|
||||||
TPythonDump() << "error = " << this << ".ExtrusionAlongPathObject( "
|
TPythonDump() << "error = " << this << ".ExtrusionAlongPathObject( "
|
||||||
<< theObject << ", "
|
<< theObject << ", "
|
||||||
<< thePathMesh << ", "
|
<< thePathMesh << ", "
|
||||||
<< thePathShape << ", "
|
<< thePathShape << ", "
|
||||||
<< theNodeStart << ", "
|
<< theNodeStart << ", "
|
||||||
<< theHasAngles << ", "
|
<< theHasAngles << ", "
|
||||||
<< "rotAngles" << ", "
|
<< theAngles << ", "
|
||||||
<< theHasRefPoint << ", refPoint )";
|
<< theHasRefPoint << ", "
|
||||||
|
<< "SMESH.PointStruct( "
|
||||||
|
<< ( theHasRefPoint ? theRefPoint.x : 0 ) << ", "
|
||||||
|
<< ( theHasRefPoint ? theRefPoint.y : 0 ) << ", "
|
||||||
|
<< ( theHasRefPoint ? theRefPoint.z : 0 ) << " ) )";
|
||||||
}
|
}
|
||||||
SMESH::SMESH_MeshEditor::Extrusion_Error anError;
|
SMESH::SMESH_MeshEditor::Extrusion_Error anError;
|
||||||
SMESH::long_array_var anElementsId = theObject->GetIDs();
|
SMESH::long_array_var anElementsId = theObject->GetIDs();
|
||||||
@ -1987,6 +2099,96 @@ SMESH_MeshEditor_i::ExtrusionAlongPathObject(SMESH::SMESH_IDSource_ptr theObje
|
|||||||
return 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)
|
||||||
|
{
|
||||||
|
if ( !myPreviewMode ) {
|
||||||
|
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;
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
if ( !myPreviewMode ) {
|
||||||
|
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;
|
||||||
|
SMESH::long_array_var anElementsId = theObject->GetIDs();
|
||||||
|
extrusionAlongPath( anElementsId,
|
||||||
|
thePathMesh,
|
||||||
|
thePathShape,
|
||||||
|
theNodeStart,
|
||||||
|
theHasAngles,
|
||||||
|
theAngles,
|
||||||
|
theHasRefPoint,
|
||||||
|
theRefPoint,
|
||||||
|
false,
|
||||||
|
anError,
|
||||||
|
SMDSAbs_Face);
|
||||||
|
return anError;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : ExtrusionAlongPathMakeGroups
|
//function : ExtrusionAlongPathMakeGroups
|
||||||
@ -2070,16 +2272,6 @@ ExtrusionAlongPathObjectMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
|
|||||||
Error);
|
Error);
|
||||||
|
|
||||||
if ( !myPreviewMode ) {
|
if ( !myPreviewMode ) {
|
||||||
TPythonDump() << "rotAngles = " << theAngles;
|
|
||||||
|
|
||||||
if ( theHasRefPoint )
|
|
||||||
TPythonDump() << "refPoint = SMESH.PointStruct( "
|
|
||||||
<< theRefPoint.x << ", "
|
|
||||||
<< theRefPoint.y << ", "
|
|
||||||
<< theRefPoint.z << " )";
|
|
||||||
else
|
|
||||||
TPythonDump() << "refPoint = SMESH.PointStruct( 0,0,0 )";
|
|
||||||
|
|
||||||
bool isDumpGroups = aGroups && aGroups->length() > 0;
|
bool isDumpGroups = aGroups && aGroups->length() > 0;
|
||||||
TPythonDump aPythonDump;
|
TPythonDump aPythonDump;
|
||||||
if(isDumpGroups) {
|
if(isDumpGroups) {
|
||||||
@ -2096,8 +2288,124 @@ ExtrusionAlongPathObjectMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
|
|||||||
<< thePathShape << ", "
|
<< thePathShape << ", "
|
||||||
<< theNodeStart << ", "
|
<< theNodeStart << ", "
|
||||||
<< theHasAngles << ", "
|
<< theHasAngles << ", "
|
||||||
<< "rotAngles" << ", "
|
<< theAngles << ", "
|
||||||
<< theHasRefPoint << ", refPoint )";
|
<< theHasRefPoint << ", "
|
||||||
|
<< "SMESH.PointStruct( "
|
||||||
|
<< ( theHasRefPoint ? theRefPoint.x : 0 ) << ", "
|
||||||
|
<< ( theHasRefPoint ? theRefPoint.y : 0 ) << ", "
|
||||||
|
<< ( theHasRefPoint ? theRefPoint.z : 0 ) << " ) )";
|
||||||
|
}
|
||||||
|
return aGroups;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : ExtrusionAlongPathObject1DMakeGroups
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
|
SMESH::ListOfGroups* SMESH_MeshEditor_i::
|
||||||
|
ExtrusionAlongPathObject1DMakeGroups(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)
|
||||||
|
{
|
||||||
|
SMESH::long_array_var anElementsId = theObject->GetIDs();
|
||||||
|
SMESH::ListOfGroups * aGroups = extrusionAlongPath( anElementsId,
|
||||||
|
thePathMesh,
|
||||||
|
thePathShape,
|
||||||
|
theNodeStart,
|
||||||
|
theHasAngles,
|
||||||
|
theAngles,
|
||||||
|
theHasRefPoint,
|
||||||
|
theRefPoint,
|
||||||
|
true,
|
||||||
|
Error,
|
||||||
|
SMDSAbs_Edge);
|
||||||
|
|
||||||
|
if ( !myPreviewMode ) {
|
||||||
|
bool isDumpGroups = aGroups && aGroups->length() > 0;
|
||||||
|
TPythonDump aPythonDump;
|
||||||
|
if(isDumpGroups) {
|
||||||
|
aPythonDump << "("<<aGroups;
|
||||||
|
}
|
||||||
|
if(isDumpGroups)
|
||||||
|
aPythonDump << ", error)";
|
||||||
|
else
|
||||||
|
aPythonDump <<"error";
|
||||||
|
|
||||||
|
aPythonDump << " = " << this << ".ExtrusionAlongPathObject1DMakeGroups( "
|
||||||
|
<< theObject << ", "
|
||||||
|
<< thePathMesh << ", "
|
||||||
|
<< thePathShape << ", "
|
||||||
|
<< theNodeStart << ", "
|
||||||
|
<< theHasAngles << ", "
|
||||||
|
<< theAngles << ", "
|
||||||
|
<< theHasRefPoint << ", "
|
||||||
|
<< "SMESH.PointStruct( "
|
||||||
|
<< ( theHasRefPoint ? theRefPoint.x : 0 ) << ", "
|
||||||
|
<< ( theHasRefPoint ? theRefPoint.y : 0 ) << ", "
|
||||||
|
<< ( theHasRefPoint ? theRefPoint.z : 0 ) << " ) )";
|
||||||
|
}
|
||||||
|
return aGroups;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : ExtrusionAlongPathObject2DMakeGroups
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
|
SMESH::ListOfGroups* SMESH_MeshEditor_i::
|
||||||
|
ExtrusionAlongPathObject2DMakeGroups(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)
|
||||||
|
{
|
||||||
|
SMESH::long_array_var anElementsId = theObject->GetIDs();
|
||||||
|
SMESH::ListOfGroups * aGroups = extrusionAlongPath( anElementsId,
|
||||||
|
thePathMesh,
|
||||||
|
thePathShape,
|
||||||
|
theNodeStart,
|
||||||
|
theHasAngles,
|
||||||
|
theAngles,
|
||||||
|
theHasRefPoint,
|
||||||
|
theRefPoint,
|
||||||
|
true,
|
||||||
|
Error,
|
||||||
|
SMDSAbs_Face);
|
||||||
|
|
||||||
|
if ( !myPreviewMode ) {
|
||||||
|
bool isDumpGroups = aGroups && aGroups->length() > 0;
|
||||||
|
TPythonDump aPythonDump;
|
||||||
|
if(isDumpGroups) {
|
||||||
|
aPythonDump << "("<<aGroups;
|
||||||
|
}
|
||||||
|
if(isDumpGroups)
|
||||||
|
aPythonDump << ", error)";
|
||||||
|
else
|
||||||
|
aPythonDump <<"error";
|
||||||
|
|
||||||
|
aPythonDump << " = " << this << ".ExtrusionAlongPathObject2DMakeGroups( "
|
||||||
|
<< theObject << ", "
|
||||||
|
<< thePathMesh << ", "
|
||||||
|
<< thePathShape << ", "
|
||||||
|
<< theNodeStart << ", "
|
||||||
|
<< theHasAngles << ", "
|
||||||
|
<< theAngles << ", "
|
||||||
|
<< theHasRefPoint << ", "
|
||||||
|
<< "SMESH.PointStruct( "
|
||||||
|
<< ( theHasRefPoint ? theRefPoint.x : 0 ) << ", "
|
||||||
|
<< ( theHasRefPoint ? theRefPoint.y : 0 ) << ", "
|
||||||
|
<< ( theHasRefPoint ? theRefPoint.z : 0 ) << " ) )";
|
||||||
}
|
}
|
||||||
return aGroups;
|
return aGroups;
|
||||||
}
|
}
|
||||||
|
@ -183,6 +183,16 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
|
|||||||
CORBA::Double AngleInRadians,
|
CORBA::Double AngleInRadians,
|
||||||
CORBA::Long NbOfSteps,
|
CORBA::Long NbOfSteps,
|
||||||
CORBA::Double Tolerance);
|
CORBA::Double Tolerance);
|
||||||
|
void RotationSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
|
||||||
|
const SMESH::AxisStruct & Axis,
|
||||||
|
CORBA::Double AngleInRadians,
|
||||||
|
CORBA::Long NbOfSteps,
|
||||||
|
CORBA::Double Tolerance);
|
||||||
|
void RotationSweepObject2D(SMESH::SMESH_IDSource_ptr theObject,
|
||||||
|
const SMESH::AxisStruct & Axis,
|
||||||
|
CORBA::Double AngleInRadians,
|
||||||
|
CORBA::Long NbOfSteps,
|
||||||
|
CORBA::Double Tolerance);
|
||||||
|
|
||||||
void ExtrusionSweep(const SMESH::long_array & IDsOfElements,
|
void ExtrusionSweep(const SMESH::long_array & IDsOfElements,
|
||||||
const SMESH::DirStruct & StepVector,
|
const SMESH::DirStruct & StepVector,
|
||||||
@ -221,6 +231,24 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
|
|||||||
const SMESH::double_array & Angles,
|
const SMESH::double_array & Angles,
|
||||||
CORBA::Boolean HasRefPoint,
|
CORBA::Boolean HasRefPoint,
|
||||||
const SMESH::PointStruct & RefPoint);
|
const SMESH::PointStruct & RefPoint);
|
||||||
|
SMESH::SMESH_MeshEditor::Extrusion_Error
|
||||||
|
ExtrusionAlongPathObject1D(SMESH::SMESH_IDSource_ptr theObject,
|
||||||
|
SMESH::SMESH_Mesh_ptr PathMesh,
|
||||||
|
GEOM::GEOM_Object_ptr PathShape,
|
||||||
|
CORBA::Long NodeStart,
|
||||||
|
CORBA::Boolean HasAngles,
|
||||||
|
const SMESH::double_array & Angles,
|
||||||
|
CORBA::Boolean HasRefPoint,
|
||||||
|
const SMESH::PointStruct & RefPoint);
|
||||||
|
SMESH::SMESH_MeshEditor::Extrusion_Error
|
||||||
|
ExtrusionAlongPathObject2D(SMESH::SMESH_IDSource_ptr theObject,
|
||||||
|
SMESH::SMESH_Mesh_ptr PathMesh,
|
||||||
|
GEOM::GEOM_Object_ptr PathShape,
|
||||||
|
CORBA::Long NodeStart,
|
||||||
|
CORBA::Boolean HasAngles,
|
||||||
|
const SMESH::double_array & Angles,
|
||||||
|
CORBA::Boolean HasRefPoint,
|
||||||
|
const SMESH::PointStruct & RefPoint);
|
||||||
|
|
||||||
SMESH::double_array* LinearAnglesVariation(SMESH::SMESH_Mesh_ptr PathMesh,
|
SMESH::double_array* LinearAnglesVariation(SMESH::SMESH_Mesh_ptr PathMesh,
|
||||||
GEOM::GEOM_Object_ptr PathShape,
|
GEOM::GEOM_Object_ptr PathShape,
|
||||||
@ -259,6 +287,16 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
|
|||||||
CORBA::Double AngleInRadians,
|
CORBA::Double AngleInRadians,
|
||||||
CORBA::Long NbOfSteps,
|
CORBA::Long NbOfSteps,
|
||||||
CORBA::Double Tolerance);
|
CORBA::Double Tolerance);
|
||||||
|
SMESH::ListOfGroups* RotationSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
|
||||||
|
const SMESH::AxisStruct& Axix,
|
||||||
|
CORBA::Double AngleInRadians,
|
||||||
|
CORBA::Long NbOfSteps,
|
||||||
|
CORBA::Double Tolerance);
|
||||||
|
SMESH::ListOfGroups* RotationSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
|
||||||
|
const SMESH::AxisStruct& Axix,
|
||||||
|
CORBA::Double AngleInRadians,
|
||||||
|
CORBA::Long NbOfSteps,
|
||||||
|
CORBA::Double Tolerance);
|
||||||
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);
|
||||||
@ -294,6 +332,24 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
|
|||||||
CORBA::Boolean HasRefPoint,
|
CORBA::Boolean HasRefPoint,
|
||||||
const SMESH::PointStruct& RefPoint,
|
const SMESH::PointStruct& RefPoint,
|
||||||
SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
|
SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
|
||||||
|
SMESH::ListOfGroups* ExtrusionAlongPathObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
|
||||||
|
SMESH::SMESH_Mesh_ptr PathMesh,
|
||||||
|
GEOM::GEOM_Object_ptr PathShape,
|
||||||
|
CORBA::Long NodeStart,
|
||||||
|
CORBA::Boolean HasAngles,
|
||||||
|
const SMESH::double_array& Angles,
|
||||||
|
CORBA::Boolean HasRefPoint,
|
||||||
|
const SMESH::PointStruct& RefPoint,
|
||||||
|
SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
|
||||||
|
SMESH::ListOfGroups* ExtrusionAlongPathObject2DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
|
||||||
|
SMESH::SMESH_Mesh_ptr PathMesh,
|
||||||
|
GEOM::GEOM_Object_ptr PathShape,
|
||||||
|
CORBA::Long NodeStart,
|
||||||
|
CORBA::Boolean HasAngles,
|
||||||
|
const SMESH::double_array& Angles,
|
||||||
|
CORBA::Boolean HasRefPoint,
|
||||||
|
const SMESH::PointStruct& RefPoint,
|
||||||
|
SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
|
||||||
SMESH::ListOfGroups* MirrorMakeGroups(const SMESH::long_array& IDsOfElements,
|
SMESH::ListOfGroups* MirrorMakeGroups(const SMESH::long_array& IDsOfElements,
|
||||||
const SMESH::AxisStruct& Mirror,
|
const SMESH::AxisStruct& Mirror,
|
||||||
SMESH::SMESH_MeshEditor::MirrorType MirrorType);
|
SMESH::SMESH_MeshEditor::MirrorType MirrorType);
|
||||||
@ -445,7 +501,8 @@ private: //!< private methods
|
|||||||
CORBA::Double AngleInRadians,
|
CORBA::Double AngleInRadians,
|
||||||
CORBA::Long NbOfSteps,
|
CORBA::Long NbOfSteps,
|
||||||
CORBA::Double Tolerance,
|
CORBA::Double Tolerance,
|
||||||
const bool MakeGroups);
|
const bool MakeGroups,
|
||||||
|
const SMDSAbs_ElementType ElementType=SMDSAbs_All);
|
||||||
SMESH::ListOfGroups* extrusionSweep(const SMESH::long_array & IDsOfElements,
|
SMESH::ListOfGroups* extrusionSweep(const SMESH::long_array & IDsOfElements,
|
||||||
const SMESH::DirStruct & StepVector,
|
const SMESH::DirStruct & StepVector,
|
||||||
CORBA::Long NbOfSteps,
|
CORBA::Long NbOfSteps,
|
||||||
@ -466,7 +523,8 @@ private: //!< private methods
|
|||||||
CORBA::Boolean HasRefPoint,
|
CORBA::Boolean HasRefPoint,
|
||||||
const SMESH::PointStruct & RefPoint,
|
const SMESH::PointStruct & RefPoint,
|
||||||
const bool MakeGroups,
|
const bool MakeGroups,
|
||||||
SMESH::SMESH_MeshEditor::Extrusion_Error & Error);
|
SMESH::SMESH_MeshEditor::Extrusion_Error & Error,
|
||||||
|
const SMDSAbs_ElementType ElementType=SMDSAbs_All);
|
||||||
SMESH::ListOfGroups* mirror(const SMESH::long_array & IDsOfElements,
|
SMESH::ListOfGroups* mirror(const SMESH::long_array & IDsOfElements,
|
||||||
const SMESH::AxisStruct & Axis,
|
const SMESH::AxisStruct & Axis,
|
||||||
SMESH::SMESH_MeshEditor::MirrorType MirrorType,
|
SMESH::SMESH_MeshEditor::MirrorType MirrorType,
|
||||||
|
@ -516,7 +516,13 @@ void SMESH_NoteBook::ReplaceVariables()
|
|||||||
aStates->IncrementState();
|
aStates->IncrementState();
|
||||||
}
|
}
|
||||||
else if(aMethod.IsEqual("ExtrusionSweep") ||
|
else if(aMethod.IsEqual("ExtrusionSweep") ||
|
||||||
aMethod.IsEqual("ExtrusionSweepMakeGroups")) {
|
aMethod.IsEqual("ExtrusionSweepObject") ||
|
||||||
|
aMethod.IsEqual("ExtrusionSweepObject1D") ||
|
||||||
|
aMethod.IsEqual("ExtrusionSweepObject2D") ||
|
||||||
|
aMethod.IsEqual("ExtrusionSweepMakeGroups") ||
|
||||||
|
aMethod.IsEqual("ExtrusionSweepObjectMakeGroups") ||
|
||||||
|
aMethod.IsEqual("ExtrusionSweepObject1DMakeGroups") ||
|
||||||
|
aMethod.IsEqual("ExtrusionSweepObject2DMakeGroups")) {
|
||||||
bool isSubstitute = false;
|
bool isSubstitute = false;
|
||||||
int anArgIndex = 0;
|
int anArgIndex = 0;
|
||||||
for(int i = 1, n = aCmd->GetNbArgs(); i <= n; i++) {
|
for(int i = 1, n = aCmd->GetNbArgs(); i <= n; i++) {
|
||||||
@ -541,9 +547,12 @@ void SMESH_NoteBook::ReplaceVariables()
|
|||||||
aStates->IncrementState();
|
aStates->IncrementState();
|
||||||
}
|
}
|
||||||
else if(aMethod.IsEqual("ExtrusionAlongPath") ||
|
else if(aMethod.IsEqual("ExtrusionAlongPath") ||
|
||||||
|
aMethod.IsEqual("ExtrusionAlongPathObject") ||
|
||||||
aMethod.IsEqual("ExtrusionAlongPathMakeGroups") ||
|
aMethod.IsEqual("ExtrusionAlongPathMakeGroups") ||
|
||||||
|
aMethod.IsEqual("ExtrusionAlongPathObjectMakeGroups") ||
|
||||||
/* workaround for a bug in the command parsing algorithm */
|
/* workaround for a bug in the command parsing algorithm */
|
||||||
aCmd->GetString().Search("ExtrusionAlongPathMakeGroups") != -1) {
|
aCmd->GetString().Search("ExtrusionAlongPathMakeGroups") != -1 ||
|
||||||
|
aCmd->GetString().Search("ExtrusionAlongPathObjectMakeGroups") != -1 ) {
|
||||||
int aNbAngles = aCurrentStateSize-3; // State looks like "Angle1:...:AngleN:X:Y:Z"
|
int aNbAngles = aCurrentStateSize-3; // State looks like "Angle1:...:AngleN:X:Y:Z"
|
||||||
bool isSubstitute = false;
|
bool isSubstitute = false;
|
||||||
int anArgIndex = 0;
|
int anArgIndex = 0;
|
||||||
@ -580,7 +589,9 @@ void SMESH_NoteBook::ReplaceVariables()
|
|||||||
aStates->IncrementState();
|
aStates->IncrementState();
|
||||||
}
|
}
|
||||||
else if(aMethod.IsEqual("Smooth") ||
|
else if(aMethod.IsEqual("Smooth") ||
|
||||||
aMethod.IsEqual("SmoothParametric")) {
|
aMethod.IsEqual("SmoothObject") ||
|
||||||
|
aMethod.IsEqual("SmoothParametric") ||
|
||||||
|
aMethod.IsEqual("SmoothParametricObject")) {
|
||||||
int anArgIndex = aCmd->GetNbArgs() - 2;
|
int anArgIndex = aCmd->GetNbArgs() - 2;
|
||||||
for(int j = 0; j < aCurrentStateSize; j++) {
|
for(int j = 0; j < aCurrentStateSize; j++) {
|
||||||
if(!aCurrentState.at(j).IsEmpty())
|
if(!aCurrentState.at(j).IsEmpty())
|
||||||
|
@ -161,7 +161,7 @@ def DegreesToRadians(AngleInDegrees):
|
|||||||
return AngleInDegrees * pi / 180.0
|
return AngleInDegrees * pi / 180.0
|
||||||
|
|
||||||
# Salome notebook variable separator
|
# Salome notebook variable separator
|
||||||
variable_separator = ":"
|
var_separator = ":"
|
||||||
|
|
||||||
# Parametrized substitute for PointStruct
|
# Parametrized substitute for PointStruct
|
||||||
class PointStructStr:
|
class PointStructStr:
|
||||||
@ -294,34 +294,34 @@ class DirStructStr:
|
|||||||
|
|
||||||
# Returns list of variable values from salome notebook
|
# Returns list of variable values from salome notebook
|
||||||
def ParsePointStruct(Point):
|
def ParsePointStruct(Point):
|
||||||
Parameters = "::"
|
Parameters = 2*var_separator
|
||||||
if isinstance(Point, PointStructStr):
|
if isinstance(Point, PointStructStr):
|
||||||
Parameters = str(Point.xStr) + ":" + str(Point.yStr) + ":" + str(Point.zStr)
|
Parameters = str(Point.xStr) + var_separator + str(Point.yStr) + var_separator + str(Point.zStr)
|
||||||
Point = PointStruct(Point.x, Point.y, Point.z)
|
Point = PointStruct(Point.x, Point.y, Point.z)
|
||||||
return Point, Parameters
|
return Point, Parameters
|
||||||
|
|
||||||
# Returns list of variable values from salome notebook
|
# Returns list of variable values from salome notebook
|
||||||
def ParseDirStruct(Dir):
|
def ParseDirStruct(Dir):
|
||||||
Parameters = "::"
|
Parameters = 2*var_separator
|
||||||
if isinstance(Dir, DirStructStr):
|
if isinstance(Dir, DirStructStr):
|
||||||
pntStr = Dir.pointStruct
|
pntStr = Dir.pointStruct
|
||||||
if isinstance(pntStr, PointStructStr6):
|
if isinstance(pntStr, PointStructStr6):
|
||||||
Parameters = str(pntStr.x1Str) + ":" + str(pntStr.x2Str) + ":"
|
Parameters = str(pntStr.x1Str) + var_separator + str(pntStr.x2Str) + var_separator
|
||||||
Parameters += str(pntStr.y1Str) + ":" + str(pntStr.y2Str) + ":"
|
Parameters += str(pntStr.y1Str) + var_separator + str(pntStr.y2Str) + var_separator
|
||||||
Parameters += str(pntStr.z1Str) + ":" + str(pntStr.z2Str)
|
Parameters += str(pntStr.z1Str) + var_separator + str(pntStr.z2Str)
|
||||||
Point = PointStruct(pntStr.x2 - pntStr.x1, pntStr.y2 - pntStr.y1, pntStr.z2 - pntStr.z1)
|
Point = PointStruct(pntStr.x2 - pntStr.x1, pntStr.y2 - pntStr.y1, pntStr.z2 - pntStr.z1)
|
||||||
else:
|
else:
|
||||||
Parameters = str(pntStr.xStr) + ":" + str(pntStr.yStr) + ":" + str(pntStr.zStr)
|
Parameters = str(pntStr.xStr) + var_separator + str(pntStr.yStr) + var_separator + str(pntStr.zStr)
|
||||||
Point = PointStruct(pntStr.x, pntStr.y, pntStr.z)
|
Point = PointStruct(pntStr.x, pntStr.y, pntStr.z)
|
||||||
Dir = DirStruct(Point)
|
Dir = DirStruct(Point)
|
||||||
return Dir, Parameters
|
return Dir, Parameters
|
||||||
|
|
||||||
# Returns list of variable values from salome notebook
|
# Returns list of variable values from salome notebook
|
||||||
def ParseAxisStruct(Axis):
|
def ParseAxisStruct(Axis):
|
||||||
Parameters = 5*variable_separator
|
Parameters = 5*var_separator
|
||||||
if isinstance(Axis, AxisStructStr):
|
if isinstance(Axis, AxisStructStr):
|
||||||
Parameters = str(Axis.xStr) + variable_separator + str(Axis.yStr) + variable_separator + str(Axis.zStr) + variable_separator
|
Parameters = str(Axis.xStr) + var_separator + str(Axis.yStr) + var_separator + str(Axis.zStr) + var_separator
|
||||||
Parameters += str(Axis.dxStr) + variable_separator + str(Axis.dyStr) + variable_separator + str(Axis.dzStr)
|
Parameters += str(Axis.dxStr) + var_separator + str(Axis.dyStr) + var_separator + str(Axis.dzStr)
|
||||||
Axis = AxisStruct(Axis.x, Axis.y, Axis.z, Axis.dx, Axis.dy, Axis.dz)
|
Axis = AxisStruct(Axis.x, Axis.y, Axis.z, Axis.dx, Axis.dy, Axis.dz)
|
||||||
return Axis, Parameters
|
return Axis, Parameters
|
||||||
|
|
||||||
@ -338,7 +338,7 @@ def ParseAngles(list):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
Parameters = Parameters + str(parameter)
|
Parameters = Parameters + str(parameter)
|
||||||
Parameters = Parameters + ":"
|
Parameters = Parameters + var_separator
|
||||||
pass
|
pass
|
||||||
Parameters = Parameters[:len(Parameters)-1]
|
Parameters = Parameters[:len(Parameters)-1]
|
||||||
return Result, Parameters
|
return Result, Parameters
|
||||||
@ -2431,7 +2431,7 @@ class Mesh:
|
|||||||
if TotalAngle and NbOfSteps:
|
if TotalAngle and NbOfSteps:
|
||||||
AngleInRadians /= NbOfSteps
|
AngleInRadians /= NbOfSteps
|
||||||
NbOfSteps,Tolerance,Parameters = geompyDC.ParseParameters(NbOfSteps,Tolerance)
|
NbOfSteps,Tolerance,Parameters = geompyDC.ParseParameters(NbOfSteps,Tolerance)
|
||||||
Parameters = AxisParameters + ":" + AngleParameters + ":" + Parameters
|
Parameters = AxisParameters + var_separator + AngleParameters + var_separator + Parameters
|
||||||
self.mesh.SetParameters(Parameters)
|
self.mesh.SetParameters(Parameters)
|
||||||
if MakeGroups:
|
if MakeGroups:
|
||||||
return self.editor.RotationSweepMakeGroups(IDsOfElements, Axis,
|
return self.editor.RotationSweepMakeGroups(IDsOfElements, Axis,
|
||||||
@ -2452,18 +2452,98 @@ class Mesh:
|
|||||||
# @ingroup l2_modif_extrurev
|
# @ingroup l2_modif_extrurev
|
||||||
def RotationSweepObject(self, theObject, Axis, AngleInRadians, NbOfSteps, Tolerance,
|
def RotationSweepObject(self, theObject, Axis, AngleInRadians, NbOfSteps, Tolerance,
|
||||||
MakeGroups=False, TotalAngle=False):
|
MakeGroups=False, TotalAngle=False):
|
||||||
|
flag = False
|
||||||
|
if isinstance(AngleInRadians,str):
|
||||||
|
flag = True
|
||||||
|
AngleInRadians,AngleParameters = geompyDC.ParseParameters(AngleInRadians)
|
||||||
|
if flag:
|
||||||
|
AngleInRadians = DegreesToRadians(AngleInRadians)
|
||||||
if ( isinstance( theObject, Mesh )):
|
if ( isinstance( theObject, Mesh )):
|
||||||
theObject = theObject.GetMesh()
|
theObject = theObject.GetMesh()
|
||||||
if ( isinstance( Axis, geompyDC.GEOM._objref_GEOM_Object)):
|
if ( isinstance( Axis, geompyDC.GEOM._objref_GEOM_Object)):
|
||||||
Axis = self.smeshpyD.GetAxisStruct(Axis)
|
Axis = self.smeshpyD.GetAxisStruct(Axis)
|
||||||
|
Axis,AxisParameters = ParseAxisStruct(Axis)
|
||||||
if TotalAngle and NbOfSteps:
|
if TotalAngle and NbOfSteps:
|
||||||
AngleInRadians /= NbOfSteps
|
AngleInRadians /= NbOfSteps
|
||||||
|
NbOfSteps,Tolerance,Parameters = geompyDC.ParseParameters(NbOfSteps,Tolerance)
|
||||||
|
Parameters = AxisParameters + var_separator + AngleParameters + var_separator + Parameters
|
||||||
|
self.mesh.SetParameters(Parameters)
|
||||||
if MakeGroups:
|
if MakeGroups:
|
||||||
return self.editor.RotationSweepObjectMakeGroups(theObject, Axis, AngleInRadians,
|
return self.editor.RotationSweepObjectMakeGroups(theObject, Axis, AngleInRadians,
|
||||||
NbOfSteps, Tolerance)
|
NbOfSteps, Tolerance)
|
||||||
self.editor.RotationSweepObject(theObject, Axis, AngleInRadians, NbOfSteps, Tolerance)
|
self.editor.RotationSweepObject(theObject, Axis, AngleInRadians, NbOfSteps, Tolerance)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
## Generates new elements by rotation of the elements of object around the axis
|
||||||
|
# @param theObject object which elements should be sweeped
|
||||||
|
# @param Axis the axis of rotation, AxisStruct or line(geom object)
|
||||||
|
# @param AngleInRadians the angle of Rotation
|
||||||
|
# @param NbOfSteps number of steps
|
||||||
|
# @param Tolerance tolerance
|
||||||
|
# @param MakeGroups forces the generation of new groups from existing ones
|
||||||
|
# @param TotalAngle gives meaning of AngleInRadians: if True then it is an angular size
|
||||||
|
# of all steps, else - size of each step
|
||||||
|
# @return the list of created groups (SMESH_GroupBase) if MakeGroups=True, empty list otherwise
|
||||||
|
# @ingroup l2_modif_extrurev
|
||||||
|
def RotationSweepObject1D(self, theObject, Axis, AngleInRadians, NbOfSteps, Tolerance,
|
||||||
|
MakeGroups=False, TotalAngle=False):
|
||||||
|
flag = False
|
||||||
|
if isinstance(AngleInRadians,str):
|
||||||
|
flag = True
|
||||||
|
AngleInRadians,AngleParameters = geompyDC.ParseParameters(AngleInRadians)
|
||||||
|
if flag:
|
||||||
|
AngleInRadians = DegreesToRadians(AngleInRadians)
|
||||||
|
if ( isinstance( theObject, Mesh )):
|
||||||
|
theObject = theObject.GetMesh()
|
||||||
|
if ( isinstance( Axis, geompyDC.GEOM._objref_GEOM_Object)):
|
||||||
|
Axis = self.smeshpyD.GetAxisStruct(Axis)
|
||||||
|
Axis,AxisParameters = ParseAxisStruct(Axis)
|
||||||
|
if TotalAngle and NbOfSteps:
|
||||||
|
AngleInRadians /= NbOfSteps
|
||||||
|
NbOfSteps,Tolerance,Parameters = geompyDC.ParseParameters(NbOfSteps,Tolerance)
|
||||||
|
Parameters = AxisParameters + var_separator + AngleParameters + var_separator + Parameters
|
||||||
|
self.mesh.SetParameters(Parameters)
|
||||||
|
if MakeGroups:
|
||||||
|
return self.editor.RotationSweepObject1DMakeGroups(theObject, Axis, AngleInRadians,
|
||||||
|
NbOfSteps, Tolerance)
|
||||||
|
self.editor.RotationSweepObject1D(theObject, Axis, AngleInRadians, NbOfSteps, Tolerance)
|
||||||
|
return []
|
||||||
|
|
||||||
|
## Generates new elements by rotation of the elements of object around the axis
|
||||||
|
# @param theObject object which elements should be sweeped
|
||||||
|
# @param Axis the axis of rotation, AxisStruct or line(geom object)
|
||||||
|
# @param AngleInRadians the angle of Rotation
|
||||||
|
# @param NbOfSteps number of steps
|
||||||
|
# @param Tolerance tolerance
|
||||||
|
# @param MakeGroups forces the generation of new groups from existing ones
|
||||||
|
# @param TotalAngle gives meaning of AngleInRadians: if True then it is an angular size
|
||||||
|
# of all steps, else - size of each step
|
||||||
|
# @return the list of created groups (SMESH_GroupBase) if MakeGroups=True, empty list otherwise
|
||||||
|
# @ingroup l2_modif_extrurev
|
||||||
|
def RotationSweepObject2D(self, theObject, Axis, AngleInRadians, NbOfSteps, Tolerance,
|
||||||
|
MakeGroups=False, TotalAngle=False):
|
||||||
|
flag = False
|
||||||
|
if isinstance(AngleInRadians,str):
|
||||||
|
flag = True
|
||||||
|
AngleInRadians,AngleParameters = geompyDC.ParseParameters(AngleInRadians)
|
||||||
|
if flag:
|
||||||
|
AngleInRadians = DegreesToRadians(AngleInRadians)
|
||||||
|
if ( isinstance( theObject, Mesh )):
|
||||||
|
theObject = theObject.GetMesh()
|
||||||
|
if ( isinstance( Axis, geompyDC.GEOM._objref_GEOM_Object)):
|
||||||
|
Axis = self.smeshpyD.GetAxisStruct(Axis)
|
||||||
|
Axis,AxisParameters = ParseAxisStruct(Axis)
|
||||||
|
if TotalAngle and NbOfSteps:
|
||||||
|
AngleInRadians /= NbOfSteps
|
||||||
|
NbOfSteps,Tolerance,Parameters = geompyDC.ParseParameters(NbOfSteps,Tolerance)
|
||||||
|
Parameters = AxisParameters + var_separator + AngleParameters + var_separator + Parameters
|
||||||
|
self.mesh.SetParameters(Parameters)
|
||||||
|
if MakeGroups:
|
||||||
|
return self.editor.RotationSweepObject2DMakeGroups(theObject, Axis, AngleInRadians,
|
||||||
|
NbOfSteps, Tolerance)
|
||||||
|
self.editor.RotationSweepObject2D(theObject, Axis, AngleInRadians, NbOfSteps, Tolerance)
|
||||||
|
return []
|
||||||
|
|
||||||
## Generates new elements by extrusion of the elements with given ids
|
## Generates new elements by extrusion of the elements with given ids
|
||||||
# @param IDsOfElements the list of elements ids for extrusion
|
# @param IDsOfElements the list of elements ids for extrusion
|
||||||
# @param StepVector vector, defining the direction and value of extrusion
|
# @param StepVector vector, defining the direction and value of extrusion
|
||||||
@ -2478,7 +2558,7 @@ class Mesh:
|
|||||||
StepVector = self.smeshpyD.GetDirStruct(StepVector)
|
StepVector = self.smeshpyD.GetDirStruct(StepVector)
|
||||||
StepVector,StepVectorParameters = ParseDirStruct(StepVector)
|
StepVector,StepVectorParameters = ParseDirStruct(StepVector)
|
||||||
NbOfSteps,Parameters = geompyDC.ParseParameters(NbOfSteps)
|
NbOfSteps,Parameters = geompyDC.ParseParameters(NbOfSteps)
|
||||||
Parameters = StepVectorParameters + ":" + 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)
|
return self.editor.ExtrusionSweepMakeGroups(IDsOfElements, StepVector, NbOfSteps)
|
||||||
@ -2518,6 +2598,10 @@ class Mesh:
|
|||||||
theObject = theObject.GetMesh()
|
theObject = theObject.GetMesh()
|
||||||
if ( isinstance( StepVector, geompyDC.GEOM._objref_GEOM_Object)):
|
if ( isinstance( StepVector, geompyDC.GEOM._objref_GEOM_Object)):
|
||||||
StepVector = self.smeshpyD.GetDirStruct(StepVector)
|
StepVector = self.smeshpyD.GetDirStruct(StepVector)
|
||||||
|
StepVector,StepVectorParameters = ParseDirStruct(StepVector)
|
||||||
|
NbOfSteps,Parameters = geompyDC.ParseParameters(NbOfSteps)
|
||||||
|
Parameters = StepVectorParameters + var_separator + Parameters
|
||||||
|
self.mesh.SetParameters(Parameters)
|
||||||
if MakeGroups:
|
if MakeGroups:
|
||||||
return self.editor.ExtrusionSweepObjectMakeGroups(theObject, StepVector, NbOfSteps)
|
return self.editor.ExtrusionSweepObjectMakeGroups(theObject, StepVector, NbOfSteps)
|
||||||
self.editor.ExtrusionSweepObject(theObject, StepVector, NbOfSteps)
|
self.editor.ExtrusionSweepObject(theObject, StepVector, NbOfSteps)
|
||||||
@ -2535,6 +2619,10 @@ class Mesh:
|
|||||||
theObject = theObject.GetMesh()
|
theObject = theObject.GetMesh()
|
||||||
if ( isinstance( StepVector, geompyDC.GEOM._objref_GEOM_Object)):
|
if ( isinstance( StepVector, geompyDC.GEOM._objref_GEOM_Object)):
|
||||||
StepVector = self.smeshpyD.GetDirStruct(StepVector)
|
StepVector = self.smeshpyD.GetDirStruct(StepVector)
|
||||||
|
StepVector,StepVectorParameters = ParseDirStruct(StepVector)
|
||||||
|
NbOfSteps,Parameters = geompyDC.ParseParameters(NbOfSteps)
|
||||||
|
Parameters = StepVectorParameters + var_separator + Parameters
|
||||||
|
self.mesh.SetParameters(Parameters)
|
||||||
if MakeGroups:
|
if MakeGroups:
|
||||||
return self.editor.ExtrusionSweepObject1DMakeGroups(theObject, StepVector, NbOfSteps)
|
return self.editor.ExtrusionSweepObject1DMakeGroups(theObject, StepVector, NbOfSteps)
|
||||||
self.editor.ExtrusionSweepObject1D(theObject, StepVector, NbOfSteps)
|
self.editor.ExtrusionSweepObject1D(theObject, StepVector, NbOfSteps)
|
||||||
@ -2552,6 +2640,10 @@ class Mesh:
|
|||||||
theObject = theObject.GetMesh()
|
theObject = theObject.GetMesh()
|
||||||
if ( isinstance( StepVector, geompyDC.GEOM._objref_GEOM_Object)):
|
if ( isinstance( StepVector, geompyDC.GEOM._objref_GEOM_Object)):
|
||||||
StepVector = self.smeshpyD.GetDirStruct(StepVector)
|
StepVector = self.smeshpyD.GetDirStruct(StepVector)
|
||||||
|
StepVector,StepVectorParameters = ParseDirStruct(StepVector)
|
||||||
|
NbOfSteps,Parameters = geompyDC.ParseParameters(NbOfSteps)
|
||||||
|
Parameters = StepVectorParameters + var_separator + Parameters
|
||||||
|
self.mesh.SetParameters(Parameters)
|
||||||
if MakeGroups:
|
if MakeGroups:
|
||||||
return self.editor.ExtrusionSweepObject2DMakeGroups(theObject, StepVector, NbOfSteps)
|
return self.editor.ExtrusionSweepObject2DMakeGroups(theObject, StepVector, NbOfSteps)
|
||||||
self.editor.ExtrusionSweepObject2D(theObject, StepVector, NbOfSteps)
|
self.editor.ExtrusionSweepObject2D(theObject, StepVector, NbOfSteps)
|
||||||
@ -2590,7 +2682,7 @@ class Mesh:
|
|||||||
if HasAngles and Angles and LinearVariation:
|
if HasAngles and Angles and LinearVariation:
|
||||||
Angles = self.editor.LinearAnglesVariation( PathMesh, PathShape, Angles )
|
Angles = self.editor.LinearAnglesVariation( PathMesh, PathShape, Angles )
|
||||||
pass
|
pass
|
||||||
Parameters = AnglesParameters + ":" + RefPointParameters
|
Parameters = AnglesParameters + var_separator + RefPointParameters
|
||||||
self.mesh.SetParameters(Parameters)
|
self.mesh.SetParameters(Parameters)
|
||||||
if MakeGroups:
|
if MakeGroups:
|
||||||
return self.editor.ExtrusionAlongPathMakeGroups(IDsOfElements, PathMesh,
|
return self.editor.ExtrusionAlongPathMakeGroups(IDsOfElements, PathMesh,
|
||||||
@ -2620,6 +2712,8 @@ class Mesh:
|
|||||||
def ExtrusionAlongPathObject(self, theObject, PathMesh, PathShape, NodeStart,
|
def ExtrusionAlongPathObject(self, theObject, PathMesh, PathShape, NodeStart,
|
||||||
HasAngles, Angles, HasRefPoint, RefPoint,
|
HasAngles, Angles, HasRefPoint, RefPoint,
|
||||||
MakeGroups=False, LinearVariation=False):
|
MakeGroups=False, LinearVariation=False):
|
||||||
|
Angles,AnglesParameters = ParseAngles(Angles)
|
||||||
|
RefPoint,RefPointParameters = ParsePointStruct(RefPoint)
|
||||||
if ( isinstance( theObject, Mesh )):
|
if ( isinstance( theObject, Mesh )):
|
||||||
theObject = theObject.GetMesh()
|
theObject = theObject.GetMesh()
|
||||||
if ( isinstance( RefPoint, geompyDC.GEOM._objref_GEOM_Object)):
|
if ( isinstance( RefPoint, geompyDC.GEOM._objref_GEOM_Object)):
|
||||||
@ -2629,6 +2723,8 @@ class Mesh:
|
|||||||
if HasAngles and Angles and LinearVariation:
|
if HasAngles and Angles and LinearVariation:
|
||||||
Angles = self.editor.LinearAnglesVariation( PathMesh, PathShape, Angles )
|
Angles = self.editor.LinearAnglesVariation( PathMesh, PathShape, Angles )
|
||||||
pass
|
pass
|
||||||
|
Parameters = AnglesParameters + var_separator + RefPointParameters
|
||||||
|
self.mesh.SetParameters(Parameters)
|
||||||
if MakeGroups:
|
if MakeGroups:
|
||||||
return self.editor.ExtrusionAlongPathObjectMakeGroups(theObject, PathMesh,
|
return self.editor.ExtrusionAlongPathObjectMakeGroups(theObject, PathMesh,
|
||||||
PathShape, NodeStart, HasAngles,
|
PathShape, NodeStart, HasAngles,
|
||||||
@ -2637,6 +2733,90 @@ class Mesh:
|
|||||||
NodeStart, HasAngles, Angles, HasRefPoint,
|
NodeStart, HasAngles, Angles, HasRefPoint,
|
||||||
RefPoint)
|
RefPoint)
|
||||||
|
|
||||||
|
## Generates new elements by extrusion of the elements which belong to the object
|
||||||
|
# The path of extrusion must be a meshed edge.
|
||||||
|
# @param theObject the object which elements should be processed
|
||||||
|
# @param PathMesh mesh containing a 1D sub-mesh on the edge, along which the extrusion proceeds
|
||||||
|
# @param PathShape shape(edge) defines the sub-mesh for the path
|
||||||
|
# @param NodeStart the first or the last node on the edge. Defines the direction of extrusion
|
||||||
|
# @param HasAngles allows the shape to be rotated around the path
|
||||||
|
# to get the resulting mesh in a helical fashion
|
||||||
|
# @param Angles list of angles
|
||||||
|
# @param HasRefPoint allows using the reference point
|
||||||
|
# @param RefPoint the point around which the shape is rotated (the mass center of the shape by default).
|
||||||
|
# The User can specify any point as the Reference Point.
|
||||||
|
# @param MakeGroups forces the generation of new groups from existing ones
|
||||||
|
# @param LinearVariation forces the computation of rotation angles as linear
|
||||||
|
# variation of the given Angles along path steps
|
||||||
|
# @return list of created groups (SMESH_GroupBase) and SMESH::Extrusion_Error if MakeGroups=True,
|
||||||
|
# only SMESH::Extrusion_Error otherwise
|
||||||
|
# @ingroup l2_modif_extrurev
|
||||||
|
def ExtrusionAlongPathObject1D(self, theObject, PathMesh, PathShape, NodeStart,
|
||||||
|
HasAngles, Angles, HasRefPoint, RefPoint,
|
||||||
|
MakeGroups=False, LinearVariation=False):
|
||||||
|
Angles,AnglesParameters = ParseAngles(Angles)
|
||||||
|
RefPoint,RefPointParameters = ParsePointStruct(RefPoint)
|
||||||
|
if ( isinstance( theObject, Mesh )):
|
||||||
|
theObject = theObject.GetMesh()
|
||||||
|
if ( isinstance( RefPoint, geompyDC.GEOM._objref_GEOM_Object)):
|
||||||
|
RefPoint = self.smeshpyD.GetPointStruct(RefPoint)
|
||||||
|
if ( isinstance( PathMesh, Mesh )):
|
||||||
|
PathMesh = PathMesh.GetMesh()
|
||||||
|
if HasAngles and Angles and LinearVariation:
|
||||||
|
Angles = self.editor.LinearAnglesVariation( PathMesh, PathShape, Angles )
|
||||||
|
pass
|
||||||
|
Parameters = AnglesParameters + var_separator + RefPointParameters
|
||||||
|
self.mesh.SetParameters(Parameters)
|
||||||
|
if MakeGroups:
|
||||||
|
return self.editor.ExtrusionAlongPathObject1DMakeGroups(theObject, PathMesh,
|
||||||
|
PathShape, NodeStart, HasAngles,
|
||||||
|
Angles, HasRefPoint, RefPoint)
|
||||||
|
return self.editor.ExtrusionAlongPathObject1D(theObject, PathMesh, PathShape,
|
||||||
|
NodeStart, HasAngles, Angles, HasRefPoint,
|
||||||
|
RefPoint)
|
||||||
|
|
||||||
|
## Generates new elements by extrusion of the elements which belong to the object
|
||||||
|
# The path of extrusion must be a meshed edge.
|
||||||
|
# @param theObject the object which elements should be processed
|
||||||
|
# @param PathMesh mesh containing a 1D sub-mesh on the edge, along which the extrusion proceeds
|
||||||
|
# @param PathShape shape(edge) defines the sub-mesh for the path
|
||||||
|
# @param NodeStart the first or the last node on the edge. Defines the direction of extrusion
|
||||||
|
# @param HasAngles allows the shape to be rotated around the path
|
||||||
|
# to get the resulting mesh in a helical fashion
|
||||||
|
# @param Angles list of angles
|
||||||
|
# @param HasRefPoint allows using the reference point
|
||||||
|
# @param RefPoint the point around which the shape is rotated (the mass center of the shape by default).
|
||||||
|
# The User can specify any point as the Reference Point.
|
||||||
|
# @param MakeGroups forces the generation of new groups from existing ones
|
||||||
|
# @param LinearVariation forces the computation of rotation angles as linear
|
||||||
|
# variation of the given Angles along path steps
|
||||||
|
# @return list of created groups (SMESH_GroupBase) and SMESH::Extrusion_Error if MakeGroups=True,
|
||||||
|
# only SMESH::Extrusion_Error otherwise
|
||||||
|
# @ingroup l2_modif_extrurev
|
||||||
|
def ExtrusionAlongPathObject2D(self, theObject, PathMesh, PathShape, NodeStart,
|
||||||
|
HasAngles, Angles, HasRefPoint, RefPoint,
|
||||||
|
MakeGroups=False, LinearVariation=False):
|
||||||
|
Angles,AnglesParameters = ParseAngles(Angles)
|
||||||
|
RefPoint,RefPointParameters = ParsePointStruct(RefPoint)
|
||||||
|
if ( isinstance( theObject, Mesh )):
|
||||||
|
theObject = theObject.GetMesh()
|
||||||
|
if ( isinstance( RefPoint, geompyDC.GEOM._objref_GEOM_Object)):
|
||||||
|
RefPoint = self.smeshpyD.GetPointStruct(RefPoint)
|
||||||
|
if ( isinstance( PathMesh, Mesh )):
|
||||||
|
PathMesh = PathMesh.GetMesh()
|
||||||
|
if HasAngles and Angles and LinearVariation:
|
||||||
|
Angles = self.editor.LinearAnglesVariation( PathMesh, PathShape, Angles )
|
||||||
|
pass
|
||||||
|
Parameters = AnglesParameters + var_separator + RefPointParameters
|
||||||
|
self.mesh.SetParameters(Parameters)
|
||||||
|
if MakeGroups:
|
||||||
|
return self.editor.ExtrusionAlongPathObject2DMakeGroups(theObject, PathMesh,
|
||||||
|
PathShape, NodeStart, HasAngles,
|
||||||
|
Angles, HasRefPoint, RefPoint)
|
||||||
|
return self.editor.ExtrusionAlongPathObject2D(theObject, PathMesh, PathShape,
|
||||||
|
NodeStart, HasAngles, Angles, HasRefPoint,
|
||||||
|
RefPoint)
|
||||||
|
|
||||||
## Creates a symmetrical copy of mesh elements
|
## Creates a symmetrical copy of mesh elements
|
||||||
# @param IDsOfElements list of elements ids
|
# @param IDsOfElements list of elements ids
|
||||||
# @param Mirror is AxisStruct or geom object(point, line, plane)
|
# @param Mirror is AxisStruct or geom object(point, line, plane)
|
||||||
@ -2811,7 +2991,7 @@ class Mesh:
|
|||||||
if ( isinstance( Axis, geompyDC.GEOM._objref_GEOM_Object)):
|
if ( isinstance( Axis, geompyDC.GEOM._objref_GEOM_Object)):
|
||||||
Axis = self.smeshpyD.GetAxisStruct(Axis)
|
Axis = self.smeshpyD.GetAxisStruct(Axis)
|
||||||
Axis,AxisParameters = ParseAxisStruct(Axis)
|
Axis,AxisParameters = ParseAxisStruct(Axis)
|
||||||
Parameters = AxisParameters + ":" + Parameters
|
Parameters = AxisParameters + var_separator + Parameters
|
||||||
self.mesh.SetParameters(Parameters)
|
self.mesh.SetParameters(Parameters)
|
||||||
if Copy and MakeGroups:
|
if Copy and MakeGroups:
|
||||||
return self.editor.RotateMakeGroups(IDsOfElements, Axis, AngleInRadians)
|
return self.editor.RotateMakeGroups(IDsOfElements, Axis, AngleInRadians)
|
||||||
@ -2838,7 +3018,7 @@ class Mesh:
|
|||||||
if ( isinstance( Axis, geompyDC.GEOM._objref_GEOM_Object)):
|
if ( isinstance( Axis, geompyDC.GEOM._objref_GEOM_Object)):
|
||||||
Axis = self.smeshpyD.GetAxisStruct(Axis)
|
Axis = self.smeshpyD.GetAxisStruct(Axis)
|
||||||
Axis,AxisParameters = ParseAxisStruct(Axis)
|
Axis,AxisParameters = ParseAxisStruct(Axis)
|
||||||
Parameters = AxisParameters + ":" + Parameters
|
Parameters = AxisParameters + var_separator + Parameters
|
||||||
mesh = self.editor.RotateMakeMesh(IDsOfElements, Axis, AngleInRadians,
|
mesh = self.editor.RotateMakeMesh(IDsOfElements, Axis, AngleInRadians,
|
||||||
MakeGroups, NewMeshName)
|
MakeGroups, NewMeshName)
|
||||||
mesh.SetParameters(Parameters)
|
mesh.SetParameters(Parameters)
|
||||||
@ -4351,7 +4531,7 @@ def ParseParameters(last, nbParams,nbParam, value):
|
|||||||
strResult=strResult+str(value)
|
strResult=strResult+str(value)
|
||||||
result = value
|
result = value
|
||||||
if nbParams - 1 != counter:
|
if nbParams - 1 != counter:
|
||||||
strResult=strResult+variable_separator #":"
|
strResult=strResult+var_separator #":"
|
||||||
counter = counter+1
|
counter = counter+1
|
||||||
return result, strResult
|
return result, strResult
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user