From: eap Date: Wed, 11 Feb 2015 13:52:57 +0000 (+0300) Subject: 22860: EDF 9944 SMESH: Regression when scaling a mesh X-Git-Tag: V7_6_0a1~26 X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=commitdiff_plain;h=38136d541c504d7e558c2a2f954911aaf95446ee 22860: EDF 9944 SMESH: Regression when scaling a mesh --- diff --git a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx index 669d024a1..0a3338947 100644 --- a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx @@ -47,15 +47,16 @@ // SALOME GUI includes #include #include +#include #include -#include +#include +#include +#include +#include +#include #include +#include #include -#include -#include -#include -#include -#include // SALOME KERNEL includes #include @@ -1223,6 +1224,7 @@ void SMESHGUI_BaseComputeOp::onPublishShape() GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen(); SALOMEDS::Study_var study = SMESHGUI::GetSMESHGen()->GetCurrentStudy(); + QStringList entryList; QList rows; SMESH::getSelectedRows( table(), rows ); int row; @@ -1260,10 +1262,13 @@ void SMESHGUI_BaseComputeOp::onPublishShape() QString shapeText = QString("%1 (%2)").arg( name.in() ).arg( entry.in() ); table()->item( row, COL_SHAPE )->setText( shapeText ); table()->item( row, COL_PUBLISHED )->setText( entry.in() ); + entryList.push_back( entry.in() ); } } } getSMESHGUI()->getApp()->updateObjectBrowser(); + getSMESHGUI()->getApp()->browseObjects( entryList, /*isApplyAndClose=*/true ); + currentCellChanged(); // to update buttons } diff --git a/src/SMESH_I/SMESH_MeshEditor_i.cxx b/src/SMESH_I/SMESH_MeshEditor_i.cxx index a753f0b59..73b1c7d56 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.cxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.cxx @@ -4842,9 +4842,16 @@ SMESH_MeshEditor_i::scale(SMESH::SMESH_IDSource_ptr theObject, gp_Trsf aTrsf; #if OCC_VERSION_LARGE > 0x06070100 - aTrsf.SetValues( S[0], 0, 0, thePoint.x * (1-S[0]), - 0, S[1], 0, thePoint.y * (1-S[1]), - 0, 0, S[2], thePoint.z * (1-S[2]) ); + // fight against ortagonalization + // aTrsf.SetValues( S[0], 0, 0, thePoint.x * (1-S[0]), + // 0, S[1], 0, thePoint.y * (1-S[1]), + // 0, 0, S[2], thePoint.z * (1-S[2]) ); + aTrsf.SetTranslation( gp_Vec( thePoint.x * (1-S[0]), + thePoint.y * (1-S[1]), + thePoint.z * (1-S[2]))); + gp_Mat & M = ( gp_Mat& ) aTrsf.HVectorialPart(); + M.SetDiagonal( S[0], S[1], S[2] ); + #else aTrsf.SetValues( S[0], 0, 0, thePoint.x * (1-S[0]), 0, S[1], 0, thePoint.y * (1-S[1]), diff --git a/src/SMESH_SWIG/smeshBuilder.py b/src/SMESH_SWIG/smeshBuilder.py index a1cad6a92..1445061eb 100644 --- a/src/SMESH_SWIG/smeshBuilder.py +++ b/src/SMESH_SWIG/smeshBuilder.py @@ -4175,7 +4175,7 @@ class Mesh: ## Scales the object # @param theObject - the object to translate (mesh, submesh, or group) - # @param thePoint - base point for scale + # @param thePoint - base point for scale (SMESH.PointStruct or list of 3 coordinates) # @param theScaleFact - list of 1-3 scale factors for axises # @param Copy - allows copying the translated elements # @param MakeGroups - forces the generation of new groups from existing @@ -4189,6 +4189,8 @@ class Mesh: if ( isinstance( theObject, list )): theObject = self.GetIDSource(theObject, SMESH.ALL) unRegister.set( theObject ) + if ( isinstance( thePoint, list )): + thePoint = PointStruct( thePoint[0], thePoint[1], thePoint[2] ) if ( isinstance( theScaleFact, float )): theScaleFact = [theScaleFact] if ( isinstance( theScaleFact, int )): @@ -4203,7 +4205,7 @@ class Mesh: ## Creates a new mesh from the translated object # @param theObject - the object to translate (mesh, submesh, or group) - # @param thePoint - base point for scale + # @param thePoint - base point for scale (SMESH.PointStruct or list of 3 coordinates) # @param theScaleFact - list of 1-3 scale factors for axises # @param MakeGroups - forces the generation of new groups from existing ones # @param NewMeshName - the name of the newly created mesh @@ -4215,6 +4217,8 @@ class Mesh: if ( isinstance( theObject, list )): theObject = self.GetIDSource(theObject,SMESH.ALL) unRegister.set( theObject ) + if ( isinstance( thePoint, list )): + thePoint = PointStruct( thePoint[0], thePoint[1], thePoint[2] ) if ( isinstance( theScaleFact, float )): theScaleFact = [theScaleFact] if ( isinstance( theScaleFact, int )): diff --git a/src/SMESH_SWIG/smesh_algorithm.py b/src/SMESH_SWIG/smesh_algorithm.py index 5a33f7475..54d1e3e31 100644 --- a/src/SMESH_SWIG/smesh_algorithm.py +++ b/src/SMESH_SWIG/smesh_algorithm.py @@ -266,7 +266,7 @@ class Mesh_Algorithm: # the value of \a isFacesToIgnore parameter. # @param isFacesToIgnore if \c True, the Viscous layers are not generated on the # faces specified by the previous parameter (\a faces). - # @param extrMethod extrusion method defines how position of nodes are found during + # @param extrMethod extrusion method defines how position of new nodes are found during # prism construction and how creation of distorted and intersecting prisms is # prevented. Possible values are: # - StdMeshers.SURF_OFFSET_SMOOTH (default) method extrudes nodes along normal