0021177: EDF 1563 SMESH: Preview of mesh during a modification

to add adjacent elements to preview only when move nodes in this mesh
This commit is contained in:
eap 2011-03-14 08:33:11 +00:00
parent bdfc51bda9
commit a2db5e7c30
5 changed files with 24 additions and 8 deletions

View File

@ -1084,7 +1084,8 @@ void SMESHGUI_RotationDlg::onDisplaySimulation( bool toDisplayPreview ) {
try {
SUIT_OverrideCursor aWaitCursor;
bool copy = ActionGroup->checkedId() == COPY_ELEMS_BUTTON;
bool copy = ( ActionGroup->checkedId() == COPY_ELEMS_BUTTON ||
ActionGroup->checkedId() == MAKE_MESH_BUTTON );
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
if(CheckBoxMesh->isChecked())
aMeshEditor->RotateObject(mySelectedObject, anAxis, anAngle, copy);

View File

@ -1084,7 +1084,8 @@ void SMESHGUI_ScaleDlg::onDisplaySimulation( bool toDisplayPreview ) {
getScale(aPoint, aScaleFact);
try {
bool copy = ActionGroup->checkedId() == COPY_ELEMS_BUTTON;
bool copy = ( ActionGroup->checkedId() == COPY_ELEMS_BUTTON ||
ActionGroup->checkedId() == MAKE_MESH_BUTTON );
SUIT_OverrideCursor aWaitCursor;
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
SMESH::SMESH_IDSource_var obj;

View File

@ -1155,7 +1155,8 @@ void SMESHGUI_SymmetryDlg::onDisplaySimulation( bool toDisplayPreview ) {
getMirror(aMirror,aMirrorType);
try {
bool copy = ActionGroup->checkedId() == COPY_ELEMS_BUTTON;
bool copy = ( ActionGroup->checkedId() == COPY_ELEMS_BUTTON ||
ActionGroup->checkedId() == MAKE_MESH_BUTTON );
SUIT_OverrideCursor aWaitCursor;
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
if(CheckBoxMesh->isChecked())

View File

@ -1133,7 +1133,8 @@ void SMESHGUI_TranslationDlg::onDisplaySimulation( bool toDisplayPreview ) {
}
try {
bool copy = ActionGroup->checkedId() == COPY_ELEMS_BUTTON;
bool copy = ( ActionGroup->checkedId() == COPY_ELEMS_BUTTON ||
ActionGroup->checkedId() == MAKE_MESH_BUTTON );
SUIT_OverrideCursor aWaitCursor;
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
if(CheckBoxMesh->isChecked())

View File

@ -2936,6 +2936,9 @@ SMESH_MeshEditor_i::mirror(TIDSortedElemSet & theElements,
gp_Pnt P ( theAxis.x, theAxis.y, theAxis.z );
gp_Vec V ( theAxis.vx, theAxis.vy, theAxis.vz );
if ( theTargetMesh )
theCopy = false;
gp_Trsf aTrsf;
switch ( theMirrorType ) {
case SMESH::SMESH_MeshEditor::POINT:
@ -2956,7 +2959,7 @@ SMESH_MeshEditor_i::mirror(TIDSortedElemSet & theElements,
if ( myPreviewMode )
{
tmpMesh.Copy( theElements, copyElements);
if ( !theCopy )
if ( !theCopy && !theTargetMesh )
{
TIDSortedElemSet elemsAround, elemsAroundCopy;
getElementsAround( theElements, GetMeshDS(), elemsAround );
@ -3196,6 +3199,9 @@ SMESH_MeshEditor_i::translate(TIDSortedElemSet & theElements,
{
initData();
if ( theTargetMesh )
theCopy = false;
gp_Trsf aTrsf;
const SMESH::PointStruct * P = &theVector.PS;
aTrsf.SetTranslation( gp_Vec( P->x, P->y, P->z ));
@ -3208,7 +3214,7 @@ SMESH_MeshEditor_i::translate(TIDSortedElemSet & theElements,
if ( myPreviewMode )
{
tmpMesh.Copy( theElements, copyElements);
if ( !theCopy )
if ( !theCopy && !theTargetMesh )
{
TIDSortedElemSet elemsAround, elemsAroundCopy;
getElementsAround( theElements, GetMeshDS(), elemsAround );
@ -3434,6 +3440,9 @@ SMESH_MeshEditor_i::rotate(TIDSortedElemSet & theElements,
{
initData();
if ( theTargetMesh )
theCopy = false;
gp_Pnt P ( theAxis.x, theAxis.y, theAxis.z );
gp_Vec V ( theAxis.vx, theAxis.vy, theAxis.vz );
@ -3447,7 +3456,7 @@ SMESH_MeshEditor_i::rotate(TIDSortedElemSet & theElements,
if ( myPreviewMode ) {
tmpMesh.Copy( theElements, copyElements );
if ( !theCopy )
if ( !theCopy && !theTargetMesh )
{
TIDSortedElemSet elemsAround, elemsAroundCopy;
getElementsAround( theElements, GetMeshDS(), elemsAround );
@ -3691,6 +3700,9 @@ SMESH_MeshEditor_i::scale(SMESH::SMESH_IDSource_ptr theObject,
if ( theScaleFact.length() == 2 )
THROW_SALOME_CORBA_EXCEPTION("Invalid nb of scale factors : 2", SALOME::BAD_PARAM);
if ( theTargetMesh )
theCopy = false;
TIDSortedElemSet elements;
bool emptyIfIsMesh = myPreviewMode ? false : true;
if ( !idSourceToSet(theObject, GetMeshDS(), elements, SMDSAbs_All, emptyIfIsMesh))
@ -3715,7 +3727,7 @@ SMESH_MeshEditor_i::scale(SMESH::SMESH_IDSource_ptr theObject,
if ( myPreviewMode )
{
tmpMesh.Copy( elements, copyElements);
if ( !theCopy )
if ( !theCopy && !theTargetMesh )
{
TIDSortedElemSet elemsAround, elemsAroundCopy;
getElementsAround( elements, GetMeshDS(), elemsAround );