mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-26 09:20:34 +05:00
53416: SALOME crashes when selecting a sub-menu of Control menu item
This commit is contained in:
parent
287b2ac10e
commit
c18fd9d00c
@ -35,7 +35,7 @@ Mesh module provides several ways to create the mesh:
|
||||
</li>
|
||||
<li>Bottom-up way, using \ref modifying_meshes_page "mesh modification"
|
||||
operations, especially \ref extrusion_page "extrusion" and \ref
|
||||
revolution_page "revolution". To create an empty mesh not based on a
|
||||
revolution_page "revolution". To create an empty mesh not based on
|
||||
geometry, use the same dialog as to \ref constructing_meshes_page
|
||||
"construct the mesh on geometry" but specify neither the geometry
|
||||
nor meshing algorithms.
|
||||
@ -44,9 +44,9 @@ Mesh module provides several ways to create the mesh:
|
||||
(and exported to) the file in MED, UNV, STL, CGNS, DAT, GMF and
|
||||
SAUVE formats.
|
||||
</li>
|
||||
<li>The 3D mesh can be generated from the 2D mesh not based on the geometry,
|
||||
<li>The 3D mesh can be generated from the 2D mesh not based on geometry,
|
||||
which was either \ref importing_exporting_meshes_page "imported" or created in
|
||||
other way. To setup the meshing parameters of a mesh not based on a geometry,
|
||||
other way. To setup the meshing parameters of a mesh not based on geometry,
|
||||
just invoke \ref editing_meshes_page "Edit mesh / sub-mesh" command on
|
||||
your 2D mesh.
|
||||
</li>
|
||||
|
@ -10,6 +10,9 @@ To create a mesh on geometry, it is necessary to create a mesh object by choosin
|
||||
taken into account by the chosen meshing algorithms.
|
||||
|
||||
Then you can launch mesh generation by invoking \ref compute_anchor "Compute" command.
|
||||
The generated mesh will be automatically shown in the Viewer. You can
|
||||
switch off automatic visualization or limit mesh size until which it is
|
||||
automatically shown in \ref mesh_preferences_page (<em>Automatic update</em> entry).
|
||||
|
||||
\note Sometimes \a hypotheses term is used to refer to both algorithms
|
||||
and hypotheses.
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*!
|
||||
|
||||
\mainpage Introduction to MESH
|
||||
\mainpage Introduction to Mesh module
|
||||
|
||||
\image html a-viewgeneral.png
|
||||
|
||||
|
@ -2,8 +2,9 @@
|
||||
|
||||
\page max_element_length_2d_page Element Diameter 2D
|
||||
|
||||
\n This quality control criterion consists in calculation of the length of
|
||||
edges and diagonals combining 2D mesh elements (triangles and quadrangles).
|
||||
\n This quality control criterion consists in calculation of the maximal length of
|
||||
edges and diagonals of 2D mesh elements (triangles and quadrangles). For polygons
|
||||
the value is always zero.
|
||||
|
||||
<em>To apply the Element Diameter 2D quality criterion to your mesh:</em>
|
||||
<ol>
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
\page max_element_length_3d_page Element Diameter 3D
|
||||
|
||||
\n This quality control criterion consists in calculation of the length of
|
||||
edges and diagonals combining 3D mesh elements
|
||||
(tetrahedrons, pyramids, pentahendrons, hexahedrons and polyhedrons).
|
||||
\n This quality control criterion consists in calculation of the maximal length of
|
||||
edges and diagonals of 3D mesh elements (tetrahedrons, pyramids, etc). For polyhedra
|
||||
the value is always zero.
|
||||
|
||||
<em>To apply the Element Diameter 3D quality criterion to your mesh:</em>
|
||||
<ol>
|
||||
|
@ -195,7 +195,7 @@ namespace
|
||||
|
||||
void SetDisplayEntity(int theCommandID);
|
||||
|
||||
int ActionToControl( int theID, bool theReversed = false );
|
||||
int ActionToControl( int theID, bool theReversed = false );
|
||||
|
||||
void Control( int theCommandID );
|
||||
|
||||
@ -265,14 +265,16 @@ namespace
|
||||
filter,
|
||||
QObject::tr( "SMESH_IMPORT_MESH" ) );
|
||||
}
|
||||
if ( filenames.count() > 0 ) {
|
||||
if ( filenames.count() > 0 )
|
||||
{
|
||||
SUIT_OverrideCursor wc;
|
||||
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
|
||||
|
||||
QStringList errors;
|
||||
QStringList anEntryList;
|
||||
bool isEmpty = false;
|
||||
for ( QStringList::ConstIterator it = filenames.begin(); it != filenames.end(); ++it ) {
|
||||
for ( QStringList::ConstIterator it = filenames.begin(); it != filenames.end(); ++it )
|
||||
{
|
||||
QString filename = *it;
|
||||
SMESH::mesh_array_var aMeshes = new SMESH::mesh_array;
|
||||
try {
|
||||
@ -365,7 +367,8 @@ namespace
|
||||
arg( QObject::tr( "SMESH_ERR_UNKNOWN_IMPORT_ERROR" ) ) );
|
||||
}
|
||||
|
||||
for ( int i = 0, iEnd = aMeshes->length(); i < iEnd; i++ ) {
|
||||
for ( int i = 0, iEnd = aMeshes->length(); i < iEnd; i++ )
|
||||
{
|
||||
_PTR(SObject) aMeshSO = SMESH::FindSObject( aMeshes[i] );
|
||||
if ( aMeshSO ) {
|
||||
_PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
|
||||
@ -1634,11 +1637,11 @@ namespace
|
||||
|
||||
void Control( int theCommandID )
|
||||
{
|
||||
SMESH_Actor::eControl aControl = SMESH_Actor::eControl( ActionToControl( theCommandID ) );
|
||||
SMESH_Actor::eControl aControl = SMESH_Actor::eControl( ActionToControl( theCommandID ));
|
||||
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
|
||||
LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
|
||||
|
||||
SALOME_ListIO selected;
|
||||
if ( aSel )
|
||||
if ( LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr() )
|
||||
aSel->selectedObjects( selected );
|
||||
|
||||
if ( !selected.IsEmpty() ) {
|
||||
@ -1646,14 +1649,24 @@ namespace
|
||||
for ( ; It.More(); It.Next())
|
||||
{
|
||||
Handle(SALOME_InteractiveObject) anIO = It.Value();
|
||||
if(!anIO.IsNull()){
|
||||
if ( !anIO.IsNull() ) {
|
||||
_PTR(SObject) SO = aStudy->FindObjectID( It.Value()->getEntry() );
|
||||
if ( SO ) {
|
||||
CORBA::Object_var aObject = SMESH::SObjectToObject( SO );
|
||||
SMESH::SMESH_IDSource_var anIDSrc = SMESH::SMESH_IDSource::_narrow( aObject );
|
||||
if ( !anIDSrc->_is_nil() ) {
|
||||
if ( SMESH_Actor *anActor = SMESH::FindActorByEntry( anIO->getEntry()) ) {
|
||||
SMESH_Actor *anActor = SMESH::FindActorByEntry( anIO->getEntry());
|
||||
if (( !anActor && selected.Extent() == 1 ) &&
|
||||
( anActor = SMESH::CreateActor( aStudy, anIO->getEntry() )))
|
||||
{
|
||||
anActor->SetControlMode( aControl );
|
||||
SMESH::DisplayActor( SMESH::GetCurrentVtkView(), anActor );
|
||||
SMESH::UpdateView ( SMESH::eDisplay, anIO->getEntry() );
|
||||
}
|
||||
if ( anActor )
|
||||
{
|
||||
if ( anActor->GetControlMode() != aControl )
|
||||
anActor->SetControlMode( aControl );
|
||||
QString functorName = functorToString( anActor->GetFunctor() );
|
||||
anActor->GetScalarBarActor()->SetTitle( functorName.toLatin1().constData() );
|
||||
SMESH::RepaintCurrentView();
|
||||
@ -4148,9 +4161,9 @@ void SMESHGUI::initialize( CAM_Application* app )
|
||||
createMenu( SMESHOp::OpPropertiesVolume, basicPropId, -1 );
|
||||
createMenu( SMESHOp::OpUpdate, viewId, -1 );
|
||||
|
||||
connect( nodeMenu, SIGNAL( aboutToShow() ), this, SLOT( onUpdateControlActions() ) );
|
||||
connect( edgeMenu, SIGNAL( aboutToShow() ), this, SLOT( onUpdateControlActions() ) );
|
||||
connect( faceMenu, SIGNAL( aboutToShow() ), this, SLOT( onUpdateControlActions() ) );
|
||||
connect( nodeMenu, SIGNAL( aboutToShow() ), this, SLOT( onUpdateControlActions() ) );
|
||||
connect( edgeMenu, SIGNAL( aboutToShow() ), this, SLOT( onUpdateControlActions() ) );
|
||||
connect( faceMenu, SIGNAL( aboutToShow() ), this, SLOT( onUpdateControlActions() ) );
|
||||
connect( volumeMenu, SIGNAL( aboutToShow() ), this, SLOT( onUpdateControlActions() ) );
|
||||
|
||||
// ----- create toolbars --------------
|
||||
@ -6832,23 +6845,24 @@ void SMESHGUI::onHypothesisEdit( int result )
|
||||
*/
|
||||
void SMESHGUI::onUpdateControlActions()
|
||||
{
|
||||
LightApp_SelectionMgr* aSel = SMESHGUI::selectionMgr();
|
||||
SALOME_ListIO selected;
|
||||
if ( aSel )
|
||||
if ( LightApp_SelectionMgr* aSel = SMESHGUI::selectionMgr() )
|
||||
aSel->selectedObjects( selected );
|
||||
|
||||
SMESH_Actor::eControl aControl = SMESH_Actor::eNone;
|
||||
if ( selected.Extent() ) {
|
||||
if ( selected.First()->hasEntry() ) {
|
||||
aControl = SMESH::FindActorByEntry( selected.First()->getEntry() )->GetControlMode();
|
||||
SALOME_ListIteratorOfListIO it(selected);
|
||||
for ( ; it.More(); it.Next() ) {
|
||||
Handle(SALOME_InteractiveObject) anIO = it.Value();
|
||||
if ( anIO->hasEntry() ) {
|
||||
if ( SMESH_Actor* anActor = SMESH::FindActorByEntry( anIO->getEntry() ) ) {
|
||||
if ( aControl != anActor->GetControlMode() ) {
|
||||
aControl = SMESH_Actor::eNone;
|
||||
break;
|
||||
if ( SMESH_Actor* anActor = SMESH::FindActorByEntry( selected.First()->getEntry() )) {
|
||||
aControl = anActor->GetControlMode();
|
||||
SALOME_ListIteratorOfListIO it(selected);
|
||||
for ( it.Next(); it.More(); it.Next() ) {
|
||||
Handle(SALOME_InteractiveObject) anIO = it.Value();
|
||||
if ( anIO->hasEntry() ) {
|
||||
if ( SMESH_Actor* anActor = SMESH::FindActorByEntry( anIO->getEntry() ) ) {
|
||||
if ( aControl != anActor->GetControlMode() ) {
|
||||
aControl = SMESH_Actor::eNone;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -953,10 +953,8 @@ void SMESHGUI_BaseComputeOp::computeMesh()
|
||||
{
|
||||
SMESH::SMESH_GroupBase_var aGrp = aGroups[i];
|
||||
if ( CORBA::is_nil( aGrp ) ) continue;
|
||||
SMESH::SMESH_Group_var aStdGroup = SMESH::SMESH_Group::_narrow( aGrp );
|
||||
SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( aGrp );
|
||||
SMESH::SMESH_GroupOnFilter_var aFltGroup = SMESH::SMESH_GroupOnFilter::_narrow( aGrp );
|
||||
if ( !aStdGroup->_is_nil() ) continue; // don't update the standalone groups
|
||||
SMESH::SMESH_Group_var aStdGroup = SMESH::SMESH_Group::_narrow( aGrp );
|
||||
if ( !aStdGroup->_is_nil() ) continue; // don't update standalone groups
|
||||
_PTR(SObject) aGroupSO = SMESH::FindSObject( aGrp );
|
||||
if ( !aGroupSO ) continue;
|
||||
SMESH::SMESH_IDSource_var aGroupObj =
|
||||
|
Loading…
Reference in New Issue
Block a user