SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( SMESHGUI* theModule )
: QDialog( SMESH::GetDesktop( 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_SYMMETRY_POINT")));
QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_SYMMETRY_AXIS")));
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
switch ( actionButton ) {
- case MOVE_ELEMS_BUTTON:
- aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, false );
+ case MOVE_ELEMS_BUTTON: {
+ if(CheckBoxMesh->isChecked())
+ aMeshEditor->MirrorObject(mySelectedObject, aMirror, aMirrorType, false );
+ else
+ aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, false );
+
if( !myMesh->_is_nil())
myMesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
break;
- case COPY_ELEMS_BUTTON:
+ }
+ case COPY_ELEMS_BUTTON: {
+ SMESH::ListOfGroups_var groups;
if ( makeGroups )
- SMESH::ListOfGroups_var groups =
- aMeshEditor->MirrorMakeGroups(anElementsId, aMirror, aMirrorType);
+ if(CheckBoxMesh->isChecked())
+ groups = aMeshEditor->MirrorObjectMakeGroups(mySelectedObject, aMirror, aMirrorType);
+ else
+ groups = aMeshEditor->MirrorMakeGroups(anElementsId, aMirror, aMirrorType);
else
- aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, true);
+ if(CheckBoxMesh->isChecked())
+ aMeshEditor->MirrorObject(mySelectedObject, aMirror, aMirrorType, true);
+ else
+ aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, true);
if( !myMesh->_is_nil())
myMesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
break;
- case MAKE_MESH_BUTTON:
- SMESH::SMESH_Mesh_var mesh =
- aMeshEditor->MirrorMakeMesh(anElementsId, aMirror, aMirrorType, makeGroups,
- LineEditNewMesh->text().toLatin1().data());
+ }
+ case MAKE_MESH_BUTTON: {
+ SMESH::SMESH_Mesh_var mesh;
+ if(CheckBoxMesh->isChecked())
+ mesh = aMeshEditor->MirrorObjectMakeMesh(mySelectedObject, aMirror, aMirrorType, makeGroups,
+ LineEditNewMesh->text().toLatin1().data());
+ else
+ mesh = aMeshEditor->MirrorMakeMesh(anElementsId, aMirror, aMirrorType, makeGroups,
+ LineEditNewMesh->text().toLatin1().data());
if( !mesh->_is_nil())
mesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
+ break;
+ }
}
} catch (...) {
}
-
+
SMESH::UpdateView();
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ||
actionButton == MAKE_MESH_BUTTON )
mySMESHGUI->updateObjBrowser(true); // new groups may appear
Init(false);
ConstructorsClicked(GetConstructorId());
+ mySelectedObject = SMESH::SMESH_IDSource::_nil();
SelectionIntoArgument();
}
-
return true;
}
if (CheckBoxMesh->isChecked()) {
SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
- if (!SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO)->_is_nil()) { //MESH
- // get IDs from mesh
+ if (!SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO)->_is_nil()) { //MESH
+ mySelectedObject = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO);
+ }
+ else
+ return;
+ // get IDs from mesh
+ /*
SMDS_Mesh* aSMDSMesh = myActor->GetObject()->GetMesh();
if (!aSMDSMesh)
return;
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 =
}
aNbUnits = anElementsIds->length();
}
+ */
} else {
aNbUnits = SMESH::GetNameOfSelectedElements( mySelector, IO, aString);
myElementsId = aString;
+ if (aNbUnits < 1)
+ return;
}
-
- if (aNbUnits < 1)
- return;
-
+
myNbOkElements = true;
} else {
aNbUnits = SMESH::GetNameOfSelectedNodes(mySelector, IO, aString);
}
aStates->IncrementState();
}
- else if(aMethod.IsEqual("Rotate") ||
- aMethod.IsEqual("RotateMakeGroups") ||
- aMethod.IsEqual("RotateMakeMesh") ||
- aMethod.IsEqual("RotationSweep") ||
+ else if(aMethod.IsEqual("Rotate") ||
+ aMethod.IsEqual("RotateMakeGroups") ||
+ aMethod.IsEqual("RotateMakeMesh") ||
+ aMethod.IsEqual("RotationSweep") ||
aMethod.IsEqual("RotationSweepMakeGroups") ||
- aMethod.IsEqual("Mirror") ||
- aMethod.IsEqual("MirrorMakeGroups")) {
+ aMethod.IsEqual("Mirror") ||
+ aMethod.IsEqual("MirrorMakeMesh") ||
+ aMethod.IsEqual("MirrorMakeGroups") ||
+ aMethod.IsEqual("MirrorObject") ||
+ aMethod.IsEqual("MirrorObjectMakeMesh") ||
+ aMethod.IsEqual("MirrorObjectMakeGroups")) {
bool isSubstitute = false;
int anArgIndex = 0;
for(int i = 1, n = aCmd->GetNbArgs(); i <= n; i++) {
# Returns list of variable values from salome notebook
def ParseAxisStruct(Axis):
- Parameters = ":::::"
+ Parameters = 5*variable_separator
if isinstance(Axis, AxisStructStr):
- Parameters = str(Axis.xStr) + ":" + str(Axis.yStr) + ":" + str(Axis.zStr) + ":"
- Parameters += str(Axis.dxStr) + ":" + str(Axis.dyStr) + ":" + str(Axis.dzStr)
+ Parameters = str(Axis.xStr) + variable_separator + str(Axis.yStr) + variable_separator + str(Axis.zStr) + variable_separator
+ Parameters += str(Axis.dxStr) + variable_separator + str(Axis.dyStr) + variable_separator + str(Axis.dzStr)
Axis = AxisStruct(Axis.x, Axis.y, Axis.z, Axis.dx, Axis.dy, Axis.dz)
return Axis, Parameters
theObject = theObject.GetMesh()
if ( isinstance( Mirror, geompyDC.GEOM._objref_GEOM_Object)):
Mirror = self.smeshpyD.GetAxisStruct(Mirror)
+ Mirror,Parameters = ParseAxisStruct(Mirror)
+ self.mesh.SetParameters(Parameters)
if Copy and MakeGroups:
return self.editor.MirrorObjectMakeGroups(theObject, Mirror, theMirrorType)
self.editor.MirrorObject(theObject, Mirror, theMirrorType, Copy)
theObject = theObject.GetMesh()
if (isinstance(Mirror, geompyDC.GEOM._objref_GEOM_Object)):
Mirror = self.smeshpyD.GetAxisStruct(Mirror)
+ Mirror,Parameters = ParseAxisStruct(Mirror)
mesh = self.editor.MirrorObjectMakeMesh(theObject, Mirror, theMirrorType,
MakeGroups, NewMeshName)
+ mesh.SetParameters(Parameters)
return Mesh( self.smeshpyD,self.geompyD,mesh )
## Translates the elements