mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-02-05 12:54:17 +05:00
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:
parent
bdfc51bda9
commit
a2db5e7c30
@ -1084,7 +1084,8 @@ void SMESHGUI_RotationDlg::onDisplaySimulation( bool toDisplayPreview ) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
SUIT_OverrideCursor aWaitCursor;
|
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();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
|
||||||
if(CheckBoxMesh->isChecked())
|
if(CheckBoxMesh->isChecked())
|
||||||
aMeshEditor->RotateObject(mySelectedObject, anAxis, anAngle, copy);
|
aMeshEditor->RotateObject(mySelectedObject, anAxis, anAngle, copy);
|
||||||
|
@ -1084,7 +1084,8 @@ void SMESHGUI_ScaleDlg::onDisplaySimulation( bool toDisplayPreview ) {
|
|||||||
getScale(aPoint, aScaleFact);
|
getScale(aPoint, aScaleFact);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
bool copy = ActionGroup->checkedId() == COPY_ELEMS_BUTTON;
|
bool copy = ( ActionGroup->checkedId() == COPY_ELEMS_BUTTON ||
|
||||||
|
ActionGroup->checkedId() == MAKE_MESH_BUTTON );
|
||||||
SUIT_OverrideCursor aWaitCursor;
|
SUIT_OverrideCursor aWaitCursor;
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
|
||||||
SMESH::SMESH_IDSource_var obj;
|
SMESH::SMESH_IDSource_var obj;
|
||||||
|
@ -1155,7 +1155,8 @@ void SMESHGUI_SymmetryDlg::onDisplaySimulation( bool toDisplayPreview ) {
|
|||||||
getMirror(aMirror,aMirrorType);
|
getMirror(aMirror,aMirrorType);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
bool copy = ActionGroup->checkedId() == COPY_ELEMS_BUTTON;
|
bool copy = ( ActionGroup->checkedId() == COPY_ELEMS_BUTTON ||
|
||||||
|
ActionGroup->checkedId() == MAKE_MESH_BUTTON );
|
||||||
SUIT_OverrideCursor aWaitCursor;
|
SUIT_OverrideCursor aWaitCursor;
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
|
||||||
if(CheckBoxMesh->isChecked())
|
if(CheckBoxMesh->isChecked())
|
||||||
|
@ -1133,7 +1133,8 @@ void SMESHGUI_TranslationDlg::onDisplaySimulation( bool toDisplayPreview ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
bool copy = ActionGroup->checkedId() == COPY_ELEMS_BUTTON;
|
bool copy = ( ActionGroup->checkedId() == COPY_ELEMS_BUTTON ||
|
||||||
|
ActionGroup->checkedId() == MAKE_MESH_BUTTON );
|
||||||
SUIT_OverrideCursor aWaitCursor;
|
SUIT_OverrideCursor aWaitCursor;
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
|
||||||
if(CheckBoxMesh->isChecked())
|
if(CheckBoxMesh->isChecked())
|
||||||
|
@ -2936,6 +2936,9 @@ SMESH_MeshEditor_i::mirror(TIDSortedElemSet & theElements,
|
|||||||
gp_Pnt P ( theAxis.x, theAxis.y, theAxis.z );
|
gp_Pnt P ( theAxis.x, theAxis.y, theAxis.z );
|
||||||
gp_Vec V ( theAxis.vx, theAxis.vy, theAxis.vz );
|
gp_Vec V ( theAxis.vx, theAxis.vy, theAxis.vz );
|
||||||
|
|
||||||
|
if ( theTargetMesh )
|
||||||
|
theCopy = false;
|
||||||
|
|
||||||
gp_Trsf aTrsf;
|
gp_Trsf aTrsf;
|
||||||
switch ( theMirrorType ) {
|
switch ( theMirrorType ) {
|
||||||
case SMESH::SMESH_MeshEditor::POINT:
|
case SMESH::SMESH_MeshEditor::POINT:
|
||||||
@ -2956,7 +2959,7 @@ SMESH_MeshEditor_i::mirror(TIDSortedElemSet & theElements,
|
|||||||
if ( myPreviewMode )
|
if ( myPreviewMode )
|
||||||
{
|
{
|
||||||
tmpMesh.Copy( theElements, copyElements);
|
tmpMesh.Copy( theElements, copyElements);
|
||||||
if ( !theCopy )
|
if ( !theCopy && !theTargetMesh )
|
||||||
{
|
{
|
||||||
TIDSortedElemSet elemsAround, elemsAroundCopy;
|
TIDSortedElemSet elemsAround, elemsAroundCopy;
|
||||||
getElementsAround( theElements, GetMeshDS(), elemsAround );
|
getElementsAround( theElements, GetMeshDS(), elemsAround );
|
||||||
@ -3196,6 +3199,9 @@ SMESH_MeshEditor_i::translate(TIDSortedElemSet & theElements,
|
|||||||
{
|
{
|
||||||
initData();
|
initData();
|
||||||
|
|
||||||
|
if ( theTargetMesh )
|
||||||
|
theCopy = false;
|
||||||
|
|
||||||
gp_Trsf aTrsf;
|
gp_Trsf aTrsf;
|
||||||
const SMESH::PointStruct * P = &theVector.PS;
|
const SMESH::PointStruct * P = &theVector.PS;
|
||||||
aTrsf.SetTranslation( gp_Vec( P->x, P->y, P->z ));
|
aTrsf.SetTranslation( gp_Vec( P->x, P->y, P->z ));
|
||||||
@ -3208,7 +3214,7 @@ SMESH_MeshEditor_i::translate(TIDSortedElemSet & theElements,
|
|||||||
if ( myPreviewMode )
|
if ( myPreviewMode )
|
||||||
{
|
{
|
||||||
tmpMesh.Copy( theElements, copyElements);
|
tmpMesh.Copy( theElements, copyElements);
|
||||||
if ( !theCopy )
|
if ( !theCopy && !theTargetMesh )
|
||||||
{
|
{
|
||||||
TIDSortedElemSet elemsAround, elemsAroundCopy;
|
TIDSortedElemSet elemsAround, elemsAroundCopy;
|
||||||
getElementsAround( theElements, GetMeshDS(), elemsAround );
|
getElementsAround( theElements, GetMeshDS(), elemsAround );
|
||||||
@ -3434,6 +3440,9 @@ SMESH_MeshEditor_i::rotate(TIDSortedElemSet & theElements,
|
|||||||
{
|
{
|
||||||
initData();
|
initData();
|
||||||
|
|
||||||
|
if ( theTargetMesh )
|
||||||
|
theCopy = false;
|
||||||
|
|
||||||
gp_Pnt P ( theAxis.x, theAxis.y, theAxis.z );
|
gp_Pnt P ( theAxis.x, theAxis.y, theAxis.z );
|
||||||
gp_Vec V ( theAxis.vx, theAxis.vy, theAxis.vz );
|
gp_Vec V ( theAxis.vx, theAxis.vy, theAxis.vz );
|
||||||
|
|
||||||
@ -3447,7 +3456,7 @@ SMESH_MeshEditor_i::rotate(TIDSortedElemSet & theElements,
|
|||||||
|
|
||||||
if ( myPreviewMode ) {
|
if ( myPreviewMode ) {
|
||||||
tmpMesh.Copy( theElements, copyElements );
|
tmpMesh.Copy( theElements, copyElements );
|
||||||
if ( !theCopy )
|
if ( !theCopy && !theTargetMesh )
|
||||||
{
|
{
|
||||||
TIDSortedElemSet elemsAround, elemsAroundCopy;
|
TIDSortedElemSet elemsAround, elemsAroundCopy;
|
||||||
getElementsAround( theElements, GetMeshDS(), elemsAround );
|
getElementsAround( theElements, GetMeshDS(), elemsAround );
|
||||||
@ -3691,6 +3700,9 @@ SMESH_MeshEditor_i::scale(SMESH::SMESH_IDSource_ptr theObject,
|
|||||||
if ( theScaleFact.length() == 2 )
|
if ( theScaleFact.length() == 2 )
|
||||||
THROW_SALOME_CORBA_EXCEPTION("Invalid nb of scale factors : 2", SALOME::BAD_PARAM);
|
THROW_SALOME_CORBA_EXCEPTION("Invalid nb of scale factors : 2", SALOME::BAD_PARAM);
|
||||||
|
|
||||||
|
if ( theTargetMesh )
|
||||||
|
theCopy = false;
|
||||||
|
|
||||||
TIDSortedElemSet elements;
|
TIDSortedElemSet elements;
|
||||||
bool emptyIfIsMesh = myPreviewMode ? false : true;
|
bool emptyIfIsMesh = myPreviewMode ? false : true;
|
||||||
if ( !idSourceToSet(theObject, GetMeshDS(), elements, SMDSAbs_All, emptyIfIsMesh))
|
if ( !idSourceToSet(theObject, GetMeshDS(), elements, SMDSAbs_All, emptyIfIsMesh))
|
||||||
@ -3715,7 +3727,7 @@ SMESH_MeshEditor_i::scale(SMESH::SMESH_IDSource_ptr theObject,
|
|||||||
if ( myPreviewMode )
|
if ( myPreviewMode )
|
||||||
{
|
{
|
||||||
tmpMesh.Copy( elements, copyElements);
|
tmpMesh.Copy( elements, copyElements);
|
||||||
if ( !theCopy )
|
if ( !theCopy && !theTargetMesh )
|
||||||
{
|
{
|
||||||
TIDSortedElemSet elemsAround, elemsAroundCopy;
|
TIDSortedElemSet elemsAround, elemsAroundCopy;
|
||||||
getElementsAround( elements, GetMeshDS(), elemsAround );
|
getElementsAround( elements, GetMeshDS(), elemsAround );
|
||||||
|
Loading…
Reference in New Issue
Block a user