PAL13571: 'Create Mesh' dialog: selected geometry is changed after hypothesis creation.

This commit is contained in:
jfa 2006-10-05 11:17:52 +00:00
parent 95814cfa9f
commit 4c42415f0f

View File

@ -1,18 +1,18 @@
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either // License as published by the Free Software Foundation; either
// version 2.1 of the License. // version 2.1 of the License.
// //
// This library is distributed in the hope that it will be useful // This library is distributed in the hope that it will be useful
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details. // Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public // You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software // License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
@ -81,7 +81,7 @@ enum { GLOBAL_ALGO_TAG =3,
SUBMESH_ON_SHELL_TAG =8, SUBMESH_ON_SHELL_TAG =8,
SUBMESH_ON_SOLID_TAG =9, SUBMESH_ON_SOLID_TAG =9,
SUBMESH_ON_COMPOUND_TAG=10 }; SUBMESH_ON_COMPOUND_TAG=10 };
//================================================================================ //================================================================================
/*! /*!
* \brief Constructor * \brief Constructor
@ -212,7 +212,7 @@ void SMESHGUI_MeshOp::startOperation()
connect( myDlg, SIGNAL( hypoSet( const QString& )), SLOT( onHypoSet( const QString& ))); connect( myDlg, SIGNAL( hypoSet( const QString& )), SLOT( onHypoSet( const QString& )));
connect( myDlg, SIGNAL( geomSelectionByMesh( bool )), SLOT( onGeomSelectionByMesh( bool ))); connect( myDlg, SIGNAL( geomSelectionByMesh( bool )), SLOT( onGeomSelectionByMesh( bool )));
if ( myToCreate ) if ( myToCreate )
if ( myIsMesh ) myHelpFileName = "/files/constructing_meshes.htm"; if ( myIsMesh ) myHelpFileName = "/files/constructing_meshes.htm";
else myHelpFileName = "/files/constructing_submeshes.htm"; else myHelpFileName = "/files/constructing_submeshes.htm";
else myHelpFileName = "files/reassigning_hypotheses_and_algorithms.htm"; else myHelpFileName = "files/reassigning_hypotheses_and_algorithms.htm";
@ -379,7 +379,7 @@ _PTR(SObject) SMESHGUI_MeshOp::getSubmeshByGeom() const
} }
} }
} }
} }
} }
return _PTR(SObject)(); return _PTR(SObject)();
} }
@ -421,7 +421,7 @@ void SMESHGUI_MeshOp::selectionDone()
case GEOM::SOLID: case GEOM::SOLID:
case GEOM::SHELL: shapeDim = 3; break; case GEOM::SHELL: shapeDim = 3; break;
case GEOM::FACE: shapeDim = 2; break; case GEOM::FACE: shapeDim = 2; break;
case GEOM::WIRE: case GEOM::WIRE:
case GEOM::EDGE: shapeDim = 1; break; case GEOM::EDGE: shapeDim = 1; break;
case GEOM::VERTEX: shapeDim = 0; break; case GEOM::VERTEX: shapeDim = 0; break;
default: default:
@ -464,7 +464,7 @@ void SMESHGUI_MeshOp::selectionDone()
{ {
// if a submesh on the selected shape already exist, pass to submesh edition mode // if a submesh on the selected shape already exist, pass to submesh edition mode
if ( _PTR(SObject) pSubmesh = getSubmeshByGeom() ) { if ( _PTR(SObject) pSubmesh = getSubmeshByGeom() ) {
SMESH::SMESH_subMesh_var sm = SMESH::SMESH_subMesh_var sm =
SMESH::SObjectToInterface<SMESH::SMESH_subMesh>( pSubmesh ); SMESH::SObjectToInterface<SMESH::SMESH_subMesh>( pSubmesh );
bool editSubmesh = ( !sm->_is_nil() && bool editSubmesh = ( !sm->_is_nil() &&
SUIT_MessageBox::question2( myDlg, tr( "SMESH_WARNING" ), SUIT_MessageBox::question2( myDlg, tr( "SMESH_WARNING" ),
@ -586,7 +586,7 @@ bool SMESHGUI_MeshOp::isValid( QString& theMess ) const
} }
} }
} }
return true; return true;
} }
@ -756,7 +756,7 @@ SMESHGUI_MeshOp::getInitParamsHypothesis( const QString& aHypType,
const int nbColonsInMeshEntry = 3; const int nbColonsInMeshEntry = 3;
bool isSubMesh = myToCreate ? bool isSubMesh = myToCreate ?
!myIsMesh : !myIsMesh :
myDlg->selectedObject( SMESHGUI_MeshDlg::Obj ).contains(':') > nbColonsInMeshEntry; myDlg->selectedObject( SMESHGUI_MeshDlg::Obj ).contains(':') > nbColonsInMeshEntry;
if ( isSubMesh ) if ( isSubMesh )
{ {
@ -797,7 +797,7 @@ SMESHGUI_MeshOp::getInitParamsHypothesis( const QString& aHypType,
//================================================================================ //================================================================================
/*! /*!
* \Brief Returns tab dimention * \Brief Returns tab dimention
* \param tab - the tab in the dlg * \param tab - the tab in the dlg
* \param dlg - my dialogue * \param dlg - my dialogue
* \retval int - dimention * \retval int - dimention
@ -852,6 +852,10 @@ void SMESHGUI_MeshOp::createHypothesis (const int theDim,
const int theType, const int theType,
const QString& theTypeName) const QString& theTypeName)
{ {
// During a hypothesis creation we might need to select some objects.
// Main dialog must not update it's own selected objects in this case.
dlg()->deactivateAll();
HypothesisData* aData = SMESH::GetHypothesisData(theTypeName.latin1()); HypothesisData* aData = SMESH::GetHypothesisData(theTypeName.latin1());
if (!aData) if (!aData)
return; return;
@ -922,7 +926,7 @@ void SMESHGUI_MeshOp::onEditHyp( const int theHypType, const int theIndex )
//================================================================================ //================================================================================
/*! /*!
* \brief access to hypothesis data * \brief access to hypothesis data
* \param theDim - hyp dimension * \param theDim - hyp dimension
* \param theHypType - hyp type (Algo,MainHyp or AddHyp) * \param theHypType - hyp type (Algo,MainHyp or AddHyp)
* \param theIndex - index in the list * \param theIndex - index in the list
@ -1105,7 +1109,7 @@ void SMESHGUI_MeshOp::onAlgoSelected( const int theIndex,
//================================================================================ //================================================================================
/*! /*!
* \brief Creates and selects hypothesis of hypotheses set * \brief Creates and selects hypothesis of hypotheses set
* \param theSetName - The name of hypotheses set * \param theSetName - The name of hypotheses set
*/ */
//================================================================================ //================================================================================
@ -1201,7 +1205,7 @@ bool SMESHGUI_MeshOp::createMesh( QString& theMess )
for ( int aDim = SMESH::DIM_1D; aDim <= SMESH::DIM_3D; aDim++ ) { for ( int aDim = SMESH::DIM_1D; aDim <= SMESH::DIM_3D; aDim++ ) {
if ( !isAccessibleDim( aDim )) continue; if ( !isAccessibleDim( aDim )) continue;
// assign hypotheses // assign hypotheses
for ( int aHypType = MainHyp; aHypType <= AddHyp; aHypType++ ) { for ( int aHypType = MainHyp; aHypType <= AddHyp; aHypType++ ) {
int aHypIndex = currentHyp( aDim, aHypType ); int aHypIndex = currentHyp( aDim, aHypType );