mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-15 06:50:32 +05:00
Improve dump python.
This commit is contained in:
parent
50ec5b5cbf
commit
eb02acbf12
@ -89,7 +89,8 @@ enum { MOVE_ELEMS_BUTTON = 0, COPY_ELEMS_BUTTON, MAKE_MESH_BUTTON }; //!< action
|
|||||||
SMESHGUI_RotationDlg::SMESHGUI_RotationDlg( SMESHGUI* theModule )
|
SMESHGUI_RotationDlg::SMESHGUI_RotationDlg( 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_MESH_ROTATION")));
|
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_MESH_ROTATION")));
|
||||||
QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
|
QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
|
||||||
@ -399,23 +400,38 @@ bool SMESHGUI_RotationDlg::ClickOnApply()
|
|||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
||||||
switch ( actionButton ) {
|
switch ( actionButton ) {
|
||||||
case MOVE_ELEMS_BUTTON:
|
case MOVE_ELEMS_BUTTON:
|
||||||
aMeshEditor->Rotate(anElementsId, anAxis, anAngle, false);
|
if(CheckBoxMesh->isChecked())
|
||||||
|
aMeshEditor->RotateObject(mySelectedObject, anAxis, anAngle, false);
|
||||||
|
else
|
||||||
|
aMeshEditor->Rotate(anElementsId, anAxis, anAngle, false);
|
||||||
if( !myMesh->_is_nil())
|
if( !myMesh->_is_nil())
|
||||||
myMesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
|
myMesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
|
||||||
break;
|
break;
|
||||||
case COPY_ELEMS_BUTTON:
|
case COPY_ELEMS_BUTTON:
|
||||||
if ( makeGroups )
|
if ( makeGroups ) {
|
||||||
SMESH::ListOfGroups_var groups =
|
SMESH::ListOfGroups_var groups;
|
||||||
aMeshEditor->RotateMakeGroups(anElementsId, anAxis, anAngle);
|
if(CheckBoxMesh->isChecked())
|
||||||
else
|
groups = aMeshEditor->RotateObjectMakeGroups(mySelectedObject, anAxis, anAngle);
|
||||||
aMeshEditor->Rotate(anElementsId, anAxis, anAngle, true);
|
else
|
||||||
|
groups = aMeshEditor->RotateMakeGroups(anElementsId, anAxis, anAngle);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if(CheckBoxMesh->isChecked())
|
||||||
|
aMeshEditor->RotateObject(mySelectedObject, anAxis, anAngle, true);
|
||||||
|
else
|
||||||
|
aMeshEditor->Rotate(anElementsId, anAxis, anAngle, true);
|
||||||
|
}
|
||||||
if( !myMesh->_is_nil())
|
if( !myMesh->_is_nil())
|
||||||
myMesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
|
myMesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
|
||||||
break;
|
break;
|
||||||
case MAKE_MESH_BUTTON:
|
case MAKE_MESH_BUTTON:
|
||||||
SMESH::SMESH_Mesh_var mesh =
|
SMESH::SMESH_Mesh_var mesh;
|
||||||
aMeshEditor->RotateMakeMesh(anElementsId, anAxis, anAngle, makeGroups,
|
if(CheckBoxMesh->isChecked())
|
||||||
LineEditNewMesh->text().toLatin1().data());
|
mesh = aMeshEditor->RotateObjectMakeMesh(mySelectedObject, anAxis, anAngle, makeGroups,
|
||||||
|
LineEditNewMesh->text().toLatin1().data());
|
||||||
|
else
|
||||||
|
mesh = aMeshEditor->RotateMakeMesh(anElementsId, anAxis, anAngle, makeGroups,
|
||||||
|
LineEditNewMesh->text().toLatin1().data());
|
||||||
if( !mesh->_is_nil())
|
if( !mesh->_is_nil())
|
||||||
mesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
|
mesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
|
||||||
}
|
}
|
||||||
@ -427,6 +443,7 @@ bool SMESHGUI_RotationDlg::ClickOnApply()
|
|||||||
actionButton == MAKE_MESH_BUTTON )
|
actionButton == MAKE_MESH_BUTTON )
|
||||||
mySMESHGUI->updateObjBrowser(true); // new groups may appear
|
mySMESHGUI->updateObjBrowser(true); // new groups may appear
|
||||||
Init(false);
|
Init(false);
|
||||||
|
mySelectedObject = SMESH::SMESH_IDSource::_nil();
|
||||||
SelectionIntoArgument();
|
SelectionIntoArgument();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -594,13 +611,18 @@ void SMESHGUI_RotationDlg::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()) { //MESH
|
||||||
|
mySelectedObject = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return;
|
||||||
// get IDs from mesh
|
// get IDs from mesh
|
||||||
SMDS_Mesh* aSMDSMesh = myActor->GetObject()->GetMesh();
|
/*
|
||||||
if (!aSMDSMesh)
|
SMDS_Mesh* aSMDSMesh = myActor->GetObject()->GetMesh();
|
||||||
|
if (!aSMDSMesh)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (int i = aSMDSMesh->MinElementID(); i <= aSMDSMesh->MaxElementID(); i++) {
|
for (int i = aSMDSMesh->MinElementID(); i <= aSMDSMesh->MaxElementID(); i++) {
|
||||||
const SMDS_MeshElement * e = aSMDSMesh->FindElement(i);
|
const SMDS_MeshElement * e = aSMDSMesh->FindElement(i);
|
||||||
if (e) {
|
if (e) {
|
||||||
myElementsId += QString(" %1").arg(i);
|
myElementsId += QString(" %1").arg(i);
|
||||||
@ -608,40 +630,41 @@ void SMESHGUI_RotationDlg::SelectionIntoArgument()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (!SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO)->_is_nil()) { //SUBMESH
|
} else if (!SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO)->_is_nil()) { //SUBMESH
|
||||||
// get submesh
|
// get submesh
|
||||||
SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO);
|
SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO);
|
||||||
|
|
||||||
// get IDs from submesh
|
// get IDs from submesh
|
||||||
SMESH::long_array_var anElementsIds = new SMESH::long_array;
|
SMESH::long_array_var anElementsIds = new SMESH::long_array;
|
||||||
anElementsIds = aSubMesh->GetElementsId();
|
anElementsIds = aSubMesh->GetElementsId();
|
||||||
for (int i = 0; i < anElementsIds->length(); i++) {
|
for (int i = 0; i < anElementsIds->length(); i++) {
|
||||||
myElementsId += QString(" %1").arg(anElementsIds[i]);
|
myElementsId += QString(" %1").arg(anElementsIds[i]);
|
||||||
}
|
}
|
||||||
aNbUnits = anElementsIds->length();
|
aNbUnits = anElementsIds->length();
|
||||||
} else { // GROUP
|
} else { // GROUP
|
||||||
// get smesh group
|
// get smesh group
|
||||||
SMESH::SMESH_GroupBase_var aGroup =
|
SMESH::SMESH_GroupBase_var aGroup =
|
||||||
SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IO);
|
SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IO);
|
||||||
if (aGroup->_is_nil())
|
if (aGroup->_is_nil())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// get IDs from smesh group
|
// get IDs from smesh group
|
||||||
SMESH::long_array_var anElementsIds = new SMESH::long_array;
|
SMESH::long_array_var anElementsIds = new SMESH::long_array;
|
||||||
anElementsIds = aGroup->GetListOfID();
|
anElementsIds = aGroup->GetListOfID();
|
||||||
for (int i = 0; i < anElementsIds->length(); i++) {
|
for (int i = 0; i < anElementsIds->length(); i++) {
|
||||||
myElementsId += QString(" %1").arg(anElementsIds[i]);
|
myElementsId += QString(" %1").arg(anElementsIds[i]);
|
||||||
}
|
}
|
||||||
aNbUnits = anElementsIds->length();
|
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;
|
||||||
if (aNbUnits < 1)
|
}
|
||||||
return;
|
|
||||||
|
|
||||||
myNbOkElements = true;
|
myNbOkElements = true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
aNbUnits = SMESH::GetNameOfSelectedNodes(mySelector, IO, aString);
|
aNbUnits = SMESH::GetNameOfSelectedNodes(mySelector, IO, aString);
|
||||||
if (aNbUnits != 1)
|
if (aNbUnits != 1)
|
||||||
@ -724,6 +747,7 @@ void SMESHGUI_RotationDlg::SetEditCurrentArgument()
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
myEditCurrentArgument->setFocus();
|
myEditCurrentArgument->setFocus();
|
||||||
|
@ -87,6 +87,7 @@ private:
|
|||||||
SMESH::SMESH_Mesh_var myMesh;
|
SMESH::SMESH_Mesh_var myMesh;
|
||||||
SMESH_Actor* myActor;
|
SMESH_Actor* myActor;
|
||||||
SMESH_LogicalFilter* myMeshOrSubMeshOrGroupFilter;
|
SMESH_LogicalFilter* myMeshOrSubMeshOrGroupFilter;
|
||||||
|
SMESH::SMESH_IDSource_var mySelectedObject;
|
||||||
|
|
||||||
QGroupBox* GroupConstructors;
|
QGroupBox* GroupConstructors;
|
||||||
QRadioButton* RadioButton1;
|
QRadioButton* RadioButton1;
|
||||||
|
@ -496,16 +496,18 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply()
|
|||||||
}
|
}
|
||||||
case COPY_ELEMS_BUTTON: {
|
case COPY_ELEMS_BUTTON: {
|
||||||
SMESH::ListOfGroups_var groups;
|
SMESH::ListOfGroups_var groups;
|
||||||
if ( makeGroups )
|
if ( makeGroups ) {
|
||||||
if(CheckBoxMesh->isChecked())
|
if(CheckBoxMesh->isChecked())
|
||||||
groups = aMeshEditor->MirrorObjectMakeGroups(mySelectedObject, aMirror, aMirrorType);
|
groups = aMeshEditor->MirrorObjectMakeGroups(mySelectedObject, aMirror, aMirrorType);
|
||||||
else
|
else
|
||||||
groups = aMeshEditor->MirrorMakeGroups(anElementsId, aMirror, aMirrorType);
|
groups = aMeshEditor->MirrorMakeGroups(anElementsId, aMirror, aMirrorType);
|
||||||
else
|
}
|
||||||
|
else {
|
||||||
if(CheckBoxMesh->isChecked())
|
if(CheckBoxMesh->isChecked())
|
||||||
aMeshEditor->MirrorObject(mySelectedObject, aMirror, aMirrorType, true);
|
aMeshEditor->MirrorObject(mySelectedObject, aMirror, aMirrorType, true);
|
||||||
else
|
else
|
||||||
aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, true);
|
aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, true);
|
||||||
|
}
|
||||||
if( !myMesh->_is_nil())
|
if( !myMesh->_is_nil())
|
||||||
myMesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
|
myMesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
|
||||||
break;
|
break;
|
||||||
|
@ -90,7 +90,8 @@ enum { MOVE_ELEMS_BUTTON = 0, COPY_ELEMS_BUTTON, MAKE_MESH_BUTTON }; //!< action
|
|||||||
SMESHGUI_TranslationDlg::SMESHGUI_TranslationDlg( SMESHGUI* theModule )
|
SMESHGUI_TranslationDlg::SMESHGUI_TranslationDlg( 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_SMESH_TRANSLATION_POINTS")));
|
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_TRANSLATION_POINTS")));
|
||||||
QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_TRANSLATION_VECTOR")));
|
QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_TRANSLATION_VECTOR")));
|
||||||
@ -455,23 +456,38 @@ bool SMESHGUI_TranslationDlg::ClickOnApply()
|
|||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
||||||
switch ( actionButton ) {
|
switch ( actionButton ) {
|
||||||
case MOVE_ELEMS_BUTTON:
|
case MOVE_ELEMS_BUTTON:
|
||||||
aMeshEditor->Translate(anElementsId, aVector, false);
|
if(CheckBoxMesh->isChecked())
|
||||||
|
aMeshEditor->TranslateObject(mySelectedObject, aVector, false);
|
||||||
|
else
|
||||||
|
aMeshEditor->Translate(anElementsId, aVector, false);
|
||||||
if( !myMesh->_is_nil())
|
if( !myMesh->_is_nil())
|
||||||
myMesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
|
myMesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
|
||||||
break;
|
break;
|
||||||
case COPY_ELEMS_BUTTON:
|
case COPY_ELEMS_BUTTON:
|
||||||
if ( makeGroups )
|
if ( makeGroups ) {
|
||||||
SMESH::ListOfGroups_var groups =
|
SMESH::ListOfGroups_var groups;
|
||||||
aMeshEditor->TranslateMakeGroups(anElementsId, aVector);
|
if(CheckBoxMesh->isChecked())
|
||||||
else
|
groups = aMeshEditor->TranslateObjectMakeGroups(mySelectedObject,aVector);
|
||||||
aMeshEditor->Translate(anElementsId, aVector, true);
|
else
|
||||||
|
groups = aMeshEditor->TranslateMakeGroups(anElementsId, aVector);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if(CheckBoxMesh->isChecked())
|
||||||
|
aMeshEditor->TranslateObject(mySelectedObject, aVector, true);
|
||||||
|
else
|
||||||
|
aMeshEditor->Translate(anElementsId, aVector, true);
|
||||||
|
}
|
||||||
if( !myMesh->_is_nil())
|
if( !myMesh->_is_nil())
|
||||||
myMesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
|
myMesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
|
||||||
break;
|
break;
|
||||||
case MAKE_MESH_BUTTON:
|
case MAKE_MESH_BUTTON:
|
||||||
SMESH::SMESH_Mesh_var mesh =
|
SMESH::SMESH_Mesh_var mesh;
|
||||||
aMeshEditor->TranslateMakeMesh(anElementsId, aVector, makeGroups,
|
if(CheckBoxMesh->isChecked())
|
||||||
LineEditNewMesh->text().toLatin1().data());
|
mesh = aMeshEditor->TranslateObjectMakeMesh(mySelectedObject, aVector, makeGroups,
|
||||||
|
LineEditNewMesh->text().toLatin1().data());
|
||||||
|
else
|
||||||
|
mesh = aMeshEditor->TranslateMakeMesh(anElementsId, aVector, makeGroups,
|
||||||
|
LineEditNewMesh->text().toLatin1().data());
|
||||||
if( !mesh->_is_nil())
|
if( !mesh->_is_nil())
|
||||||
mesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
|
mesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
|
||||||
}
|
}
|
||||||
@ -484,6 +500,7 @@ bool SMESHGUI_TranslationDlg::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();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -653,8 +670,13 @@ void SMESHGUI_TranslationDlg::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()) { //MESH, SUBMESH, OR GROUP
|
||||||
|
mySelectedObject = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return;
|
||||||
// get IDs from mesh
|
// get IDs from mesh
|
||||||
|
/*
|
||||||
SMDS_Mesh* aSMDSMesh = myActor->GetObject()->GetMesh();
|
SMDS_Mesh* aSMDSMesh = myActor->GetObject()->GetMesh();
|
||||||
if (!aSMDSMesh)
|
if (!aSMDSMesh)
|
||||||
return;
|
return;
|
||||||
@ -692,14 +714,14 @@ void SMESHGUI_TranslationDlg::SelectionIntoArgument()
|
|||||||
}
|
}
|
||||||
aNbUnits = anElementsIds->length();
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aNbUnits < 1)
|
|
||||||
return;
|
|
||||||
|
|
||||||
myNbOkElements = true;
|
myNbOkElements = true;
|
||||||
} else {
|
} else {
|
||||||
aNbUnits = SMESH::GetNameOfSelectedNodes(mySelector, IO, aString);
|
aNbUnits = SMESH::GetNameOfSelectedNodes(mySelector, IO, aString);
|
||||||
|
@ -89,6 +89,8 @@ private:
|
|||||||
SMESH_Actor* myActor;
|
SMESH_Actor* myActor;
|
||||||
SMESH_LogicalFilter* myMeshOrSubMeshOrGroupFilter;
|
SMESH_LogicalFilter* myMeshOrSubMeshOrGroupFilter;
|
||||||
|
|
||||||
|
SMESH::SMESH_IDSource_var mySelectedObject;
|
||||||
|
|
||||||
QGroupBox* ConstructorsBox;
|
QGroupBox* ConstructorsBox;
|
||||||
QButtonGroup* GroupConstructors;
|
QButtonGroup* GroupConstructors;
|
||||||
QRadioButton* RadioButton1;
|
QRadioButton* RadioButton1;
|
||||||
|
@ -2767,6 +2767,8 @@ class Mesh:
|
|||||||
theObject = theObject.GetMesh()
|
theObject = theObject.GetMesh()
|
||||||
if ( isinstance( Vector, geompyDC.GEOM._objref_GEOM_Object)):
|
if ( isinstance( Vector, geompyDC.GEOM._objref_GEOM_Object)):
|
||||||
Vector = self.smeshpyD.GetDirStruct(Vector)
|
Vector = self.smeshpyD.GetDirStruct(Vector)
|
||||||
|
Vector,Parameters = ParseDirStruct(Vector)
|
||||||
|
self.mesh.SetParameters(Parameters)
|
||||||
if Copy and MakeGroups:
|
if Copy and MakeGroups:
|
||||||
return self.editor.TranslateObjectMakeGroups(theObject, Vector)
|
return self.editor.TranslateObjectMakeGroups(theObject, Vector)
|
||||||
self.editor.TranslateObject(theObject, Vector, Copy)
|
self.editor.TranslateObject(theObject, Vector, Copy)
|
||||||
@ -2784,7 +2786,9 @@ class Mesh:
|
|||||||
theObject = theObject.GetMesh()
|
theObject = theObject.GetMesh()
|
||||||
if (isinstance(Vector, geompyDC.GEOM._objref_GEOM_Object)):
|
if (isinstance(Vector, geompyDC.GEOM._objref_GEOM_Object)):
|
||||||
Vector = self.smeshpyD.GetDirStruct(Vector)
|
Vector = self.smeshpyD.GetDirStruct(Vector)
|
||||||
|
Vector,Parameters = ParseDirStruct(Vector)
|
||||||
mesh = self.editor.TranslateObjectMakeMesh(theObject, Vector, MakeGroups, NewMeshName)
|
mesh = self.editor.TranslateObjectMakeMesh(theObject, Vector, MakeGroups, NewMeshName)
|
||||||
|
mesh.SetParameters(Parameters)
|
||||||
return Mesh( self.smeshpyD, self.geompyD, mesh )
|
return Mesh( self.smeshpyD, self.geompyD, mesh )
|
||||||
|
|
||||||
## Rotates the elements
|
## Rotates the elements
|
||||||
@ -2843,16 +2847,25 @@ class Mesh:
|
|||||||
## Rotates the object
|
## Rotates the object
|
||||||
# @param theObject the object to rotate( mesh, submesh, or group)
|
# @param theObject the object to rotate( mesh, submesh, or group)
|
||||||
# @param Axis the axis of rotation (AxisStruct or geom line)
|
# @param Axis the axis of rotation (AxisStruct or geom line)
|
||||||
# @param AngleInRadians the angle of rotation (in radians)
|
# @param AngleInRadians the angle of rotation (in radians) or a name of variable which defines angle in degrees
|
||||||
# @param Copy allows copying the rotated elements
|
# @param Copy allows copying the rotated elements
|
||||||
# @param MakeGroups forces the generation of new groups from existing ones (if Copy)
|
# @param MakeGroups forces the generation of new groups from existing ones (if Copy)
|
||||||
# @return list of created groups (SMESH_GroupBase) if MakeGroups=True, empty list otherwise
|
# @return list of created groups (SMESH_GroupBase) if MakeGroups=True, empty list otherwise
|
||||||
# @ingroup l2_modif_trsf
|
# @ingroup l2_modif_trsf
|
||||||
def RotateObject (self, theObject, Axis, AngleInRadians, Copy, MakeGroups=False):
|
def RotateObject (self, theObject, Axis, AngleInRadians, Copy, MakeGroups=False):
|
||||||
|
flag = False
|
||||||
|
if isinstance(AngleInRadians,str):
|
||||||
|
flag = True
|
||||||
|
AngleInRadians,Parameters = 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)
|
||||||
|
Parameters = AxisParameters + ":" + Parameters
|
||||||
|
self.mesh.SetParameters(Parameters)
|
||||||
if Copy and MakeGroups:
|
if Copy and MakeGroups:
|
||||||
return self.editor.RotateObjectMakeGroups(theObject, Axis, AngleInRadians)
|
return self.editor.RotateObjectMakeGroups(theObject, Axis, AngleInRadians)
|
||||||
self.editor.RotateObject(theObject, Axis, AngleInRadians, Copy)
|
self.editor.RotateObject(theObject, Axis, AngleInRadians, Copy)
|
||||||
@ -2861,18 +2874,27 @@ class Mesh:
|
|||||||
## Creates a new mesh from the rotated object
|
## Creates a new mesh from the rotated object
|
||||||
# @param theObject the object to rotate (mesh, submesh, or group)
|
# @param theObject the object to rotate (mesh, submesh, or group)
|
||||||
# @param Axis the axis of rotation (AxisStruct or geom line)
|
# @param Axis the axis of rotation (AxisStruct or geom line)
|
||||||
# @param AngleInRadians the angle of rotation (in radians)
|
# @param AngleInRadians the angle of rotation (in radians) or a name of variable which defines angle in degrees
|
||||||
# @param MakeGroups forces the generation of new groups from existing ones
|
# @param MakeGroups forces the generation of new groups from existing ones
|
||||||
# @param NewMeshName the name of the newly created mesh
|
# @param NewMeshName the name of the newly created mesh
|
||||||
# @return instance of Mesh class
|
# @return instance of Mesh class
|
||||||
# @ingroup l2_modif_trsf
|
# @ingroup l2_modif_trsf
|
||||||
def RotateObjectMakeMesh(self, theObject, Axis, AngleInRadians, MakeGroups=0,NewMeshName=""):
|
def RotateObjectMakeMesh(self, theObject, Axis, AngleInRadians, MakeGroups=0,NewMeshName=""):
|
||||||
|
flag = False
|
||||||
|
if isinstance(AngleInRadians,str):
|
||||||
|
flag = True
|
||||||
|
AngleInRadians,Parameters = 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)
|
||||||
|
Parameters = AxisParameters + ":" + Parameters
|
||||||
mesh = self.editor.RotateObjectMakeMesh(theObject, Axis, AngleInRadians,
|
mesh = self.editor.RotateObjectMakeMesh(theObject, Axis, AngleInRadians,
|
||||||
MakeGroups, NewMeshName)
|
MakeGroups, NewMeshName)
|
||||||
|
mesh.SetParameters(Parameters)
|
||||||
return Mesh( self.smeshpyD, self.geompyD, mesh )
|
return Mesh( self.smeshpyD, self.geompyD, mesh )
|
||||||
|
|
||||||
## Finds groups of ajacent nodes within Tolerance.
|
## Finds groups of ajacent nodes within Tolerance.
|
||||||
|
Loading…
Reference in New Issue
Block a user