X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI.cxx;h=b2944e5bc699351ab92426218a5970e7fdfce3fd;hb=f89c0586c1d18c14cf772fa64a7fe6cc680376d1;hp=32521fcd5145100c64a036c5322e9f2040a9f109;hpb=2cb5a0ee33bb12b136ccd93634b1ee5b35f94727;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 32521fcd5..b2944e5bc 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -543,11 +543,9 @@ { format = "GMF"; notSupportedElemTypes.push_back( SMESH::Entity_0D ); - notSupportedElemTypes.push_back( SMESH::Entity_Quad_Quadrangle ); notSupportedElemTypes.push_back( SMESH::Entity_Polygon ); notSupportedElemTypes.push_back( SMESH::Entity_Quad_Polygon ); notSupportedElemTypes.push_back( SMESH::Entity_Quad_Pyramid ); - notSupportedElemTypes.push_back( SMESH::Entity_Quad_Hexa ); notSupportedElemTypes.push_back( SMESH::Entity_Quad_Penta ); notSupportedElemTypes.push_back( SMESH::Entity_Hexagonal_Prism ); notSupportedElemTypes.push_back( SMESH::Entity_Polyhedra ); @@ -1108,9 +1106,10 @@ vtkLookupTable* lookupTable = static_cast(aScalarBarActor->GetLookupTable()); double * minmax = lookupTable->GetRange(); + bool isLogarithmic = lookupTable->GetScale() == VTK_SCALE_LOG10; std::vector nbEvents; std::vector funValues; - aNumFun->GetHistogram( nbIntervals, nbEvents, funValues, elements, minmax ); + aNumFun->GetHistogram( nbIntervals, nbEvents, funValues, elements, minmax, isLogarithmic ); QString anInitialPath = ""; if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() ) anInitialPath = QDir::currentPath(); @@ -1603,7 +1602,7 @@ aControl = SMESH_Actor::eCoincidentElems3D; break; } - + anActor->SetControlMode(aControl); anActor->GetScalarBarActor()->SetTitle( functorToString( anActor->GetFunctor() ).toLatin1().constData() ); SMESH::RepaintCurrentView(); @@ -1801,6 +1800,15 @@ } } + // Call mesh->Clear() to prevent loading mesh from file caused by hypotheses removal + for( It.Initialize( selected ); It.More(); It.Next()) // loop on selected IO's + { + Handle(SALOME_InteractiveObject) IObject = It.Value(); + SMESH::SMESH_Mesh_var mesh = SMESH::IObjectToInterface< SMESH::SMESH_Mesh >( IObject ); + if ( !mesh->_is_nil() ) + mesh->Clear(); + } + // Treat SO's in the list starting from the back aStudyBuilder->NewCommand(); // There is a transaction for ( ritSO = listSO.rbegin(); ritSO != listSO.rend(); ++ritSO ) @@ -4750,6 +4758,7 @@ void SMESHGUI::createPreferences() setPreferenceProperty( nodesLim, "max", 10000000 ); setPreferenceProperty( nodesLim, "step", 10000 ); setPreferenceProperty( nodesLim, "special", tr( "PREF_UPDATE_LIMIT_NOLIMIT" ) ); + addPreference( tr( "PREF_ELEM_INFO_GRP_DETAILS" ), infoGroup, LightApp_Preferences::Bool, "SMESH", "elem_info_grp_details" ); addPreference( tr( "PREF_DUMP_BASE_INFO" ), infoGroup, LightApp_Preferences::Bool, "SMESH", "info_dump_base" ); addPreference( tr( "PREF_DUMP_ELEM_INFO" ), infoGroup, LightApp_Preferences::Bool, "SMESH", "info_dump_elem" ); addPreference( tr( "PREF_DUMP_ADD_INFO" ), infoGroup, LightApp_Preferences::Bool, "SMESH", "info_dump_add" ); @@ -4884,32 +4893,13 @@ void SMESHGUI::createPreferences() setPreferenceProperty( shrink, "max", 100 ); int numGroup = addPreference( tr( "PREF_GROUP_NUMBERING" ), meshTab ); - setPreferenceProperty( numGroup, "columns", 6 ); - QStringList fonts; - fonts << tr( "SMESH_ARIAL" ) << tr( "SMESH_COURIER" ) << tr( "SMESH_TIMES" ); - indices.clear(); indices << 0 << 1 << 2; - // ... + setPreferenceProperty( numGroup, "columns", 2 ); + addPreference( tr( "PREF_NUMBERING_NODE" ), numGroup, LightApp_Preferences::Color, "SMESH", "numbering_node_color" ); - int NumNodeSize = addPreference( tr( "PREF_NUMBERING_SIZE" ), numGroup, LightApp_Preferences::IntSpin, "SMESH", "numbering_node_size" ); - setPreferenceProperty( NumNodeSize, "min", 1 ); - setPreferenceProperty( NumNodeSize, "max", 100 ); - int NumFontNode = addPreference( tr( "PREF_NUMBERING_FONT" ), numGroup, LightApp_Preferences::Selector, "SMESH", "numbering_node_font" ); - setPreferenceProperty( NumFontNode, "strings", fonts ); - setPreferenceProperty( NumFontNode, "indexes", indices ); - addPreference( tr( "PREF_NUMBERING_BOLD" ), numGroup, LightApp_Preferences::Bool, "SMESH", "numbering_node_bold" ); - addPreference( tr( "PREF_NUMBERING_ITALIC" ), numGroup, LightApp_Preferences::Bool, "SMESH", "numbering_node_italic" ); - addPreference( tr( "PREF_NUMBERING_SHADOW" ), numGroup, LightApp_Preferences::Bool, "SMESH", "numbering_node_shadow" ); - // ... + addVtkFontPref( tr( "PREF_NUMBERING_FONT" ), numGroup, "numbering_node_font", true ); + addPreference( tr( "PREF_NUMBERING_ELEM" ), numGroup, LightApp_Preferences::Color, "SMESH", "numbering_elem_color" ); - int NumElemSize = addPreference( tr( "PREF_NUMBERING_SIZE" ), numGroup, LightApp_Preferences::IntSpin, "SMESH", "numbering_elem_size" ); - setPreferenceProperty( NumElemSize, "min", 1 ); - setPreferenceProperty( NumElemSize, "max", 100 ); - int NumFontElem = addPreference( tr( "PREF_NUMBERING_FONT" ), numGroup, LightApp_Preferences::Selector, "SMESH", "numbering_elem_font" ); - setPreferenceProperty( NumFontElem, "strings", fonts ); - setPreferenceProperty( NumFontElem, "indexes", indices ); - addPreference( tr( "PREF_NUMBERING_BOLD" ), numGroup, LightApp_Preferences::Bool, "SMESH", "numbering_elem_bold" ); - addPreference( tr( "PREF_NUMBERING_ITALIC" ), numGroup, LightApp_Preferences::Bool, "SMESH", "numbering_elem_italic" ); - addPreference( tr( "PREF_NUMBERING_SHADOW" ), numGroup, LightApp_Preferences::Bool, "SMESH", "numbering_elem_shadow" ); + addVtkFontPref( tr( "PREF_NUMBERING_FONT" ), numGroup, "numbering_elem_font", true ); int orientGroup = addPreference( tr( "PREF_GROUP_FACES_ORIENTATION" ), meshTab ); setPreferenceProperty( orientGroup, "columns", 1 ); @@ -5097,14 +5087,10 @@ void SMESHGUI::preferencesChanged( const QString& sect, const QString& name ) QString val = aResourceMgr->stringValue( "SMESH", name ); myComponentSMESH->SetOption( name.toLatin1().constData(), val.toLatin1().constData() ); } - else if(name == QString("numbering_node_color") || name == QString("numbering_node_size") || - name == QString("numbering_node_font") || name == QString("numbering_node_bold") || - name == QString("numbering_node_italic") || name == QString("numbering_node_shadow") ) { - SMESH::UpdateFontProp( this ); + else if ( name == QString( "numbering_node_color" ) || name == QString( "numbering_node_font" ) ) { + SMESH::UpdateFontProp( this ); } - else if(name == QString("numbering_elem_color") || name == QString("numbering_elem_size") || - name == QString("numbering_elem_font") || name == QString("numbering_elem_bold") || - name == QString("numbering_elem_italic") || name == QString("numbering_elem_shadow") ) { + else if ( name == QString( "numbering_elem_color" ) || name == QString( "numbering_elem_font" ) ) { SMESH::UpdateFontProp( this ); } @@ -6374,7 +6360,7 @@ void SMESHGUI::restoreVisualParameters (int savePoint) \param param parameter \return identifier of preferences */ -int SMESHGUI::addVtkFontPref( const QString& label, const int pId, const QString& param ) +int SMESHGUI::addVtkFontPref( const QString& label, const int pId, const QString& param, const bool needSize ) { int tfont = addPreference( label, pId, LightApp_Preferences::Font, "SMESH", param ); @@ -6388,6 +6374,7 @@ int SMESHGUI::addVtkFontPref( const QString& label, const int pId, const QString setPreferenceProperty( tfont, "fonts", fam ); int f = QtxFontEdit::Family | QtxFontEdit::Bold | QtxFontEdit::Italic | QtxFontEdit::Shadow; + if ( needSize ) f = f | QtxFontEdit::Size; setPreferenceProperty( tfont, "features", f ); return tfont;