#include <QTextStream>
#include <QListView>
#include <QTreeView>
+#include <QCheckBox>
+#include <QLayout>
+#include <QDialogButtonBox>
// BOOST includes
#include <boost/shared_ptr.hpp>
void SetDisplayEntity(int theCommandID);
- int ActionToControl( int theID, bool theReversed = false );
+ int ActionToControl( int theID, bool theReversed = false );
void Control( int theCommandID );
QStringList filter;
std::string myExtension;
- if ( theCommandID == SMESHOp::OpImportMED ) {
+ if ( theCommandID == SMESHOp::OpImportMED ||
+ theCommandID == SMESHOp::OpPopupImportMED ) {
filter.append( QObject::tr( "MED_FILES_FILTER" ) + " (*.*med)" );
filter.append( QObject::tr( "ALL_FILES_FILTER" ) + " (*)" );
}
- else if ( theCommandID == SMESHOp::OpImportUNV ) {
+ else if ( theCommandID == SMESHOp::OpImportUNV ||
+ theCommandID == SMESHOp::OpPopupImportUNV ) {
filter.append( QObject::tr( "IDEAS_FILES_FILTER" ) + " (*.unv)" );
}
- else if ( theCommandID == SMESHOp::OpImportDAT ) {
+ else if ( theCommandID == SMESHOp::OpImportDAT ||
+ theCommandID == SMESHOp::OpPopupImportDAT ) {
filter.append( QObject::tr( "DAT_FILES_FILTER" ) + " (*.dat)" );
}
- else if ( theCommandID == SMESHOp::OpImportSTL ) {
+ else if ( theCommandID == SMESHOp::OpImportSTL ||
+ theCommandID == SMESHOp::OpPopupImportSTL ) {
filter.append( QObject::tr( "STL_FILES_FILTER" ) + " (*.stl)" );
}
- #ifdef WITH_CGNS
- else if ( theCommandID == SMESHOp::OpImportCGNS ) {
+ else if ( theCommandID == SMESHOp::OpImportCGNS ||
+ theCommandID == SMESHOp::OpPopupImportCGNS ) {
filter.append( QObject::tr( "CGNS_FILES_FILTER" ) + " (*.cgns)" );
}
- #endif
- else if ( theCommandID == SMESHOp::OpImportSAUV ) {
+ else if ( theCommandID == SMESHOp::OpImportSAUV ||
+ theCommandID == SMESHOp::OpPopupImportSAUV ) {
filter.append( QObject::tr( "SAUV files (*.sauv*)" ) );
filter.append( QObject::tr( "All files (*)" ) );
}
- else if ( theCommandID == SMESHOp::OpImportGMF ) {
+ else if ( theCommandID == SMESHOp::OpImportGMF ||
+ theCommandID == SMESHOp::OpPopupImportGMF ) {
filter.append( QObject::tr( "GMF_ASCII_FILES_FILTER" ) + " (*.mesh)" );
filter.append( QObject::tr( "GMF_BINARY_FILES_FILTER") + " (*.meshb)" );
}
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 {
switch ( theCommandID ) {
case SMESHOp::OpImportDAT:
+ case SMESHOp::OpPopupImportDAT:
{
// DAT format (currently unsupported)
errors.append( QString( "%1 :\n\t%2" ).arg( filename ).
break;
}
case SMESHOp::OpImportUNV:
+ case SMESHOp::OpPopupImportUNV:
{
// UNV format
aMeshes->length( 1 );
break;
}
case SMESHOp::OpImportMED:
+ case SMESHOp::OpPopupImportMED:
{
// MED format
SMESH::DriverMED_ReadStatus res;
break;
}
case SMESHOp::OpImportSTL:
+ case SMESHOp::OpPopupImportSTL:
{
// STL format
aMeshes->length( 1 );
}
break;
}
- #ifdef WITH_CGNS
case SMESHOp::OpImportCGNS:
+ case SMESHOp::OpPopupImportCGNS:
{
// CGNS format
SMESH::DriverMED_ReadStatus res;
}
break;
}
- #endif
case SMESHOp::OpImportSAUV:
+ case SMESHOp::OpPopupImportSAUV:
{
// SAUV format
SMESH::DriverMED_ReadStatus res;
break;
}
case SMESHOp::OpImportGMF:
+ case SMESHOp::OpPopupImportGMF:
{
// GMF format
SMESH::ComputeError_var res;
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();
theCommandID == SMESHOp::OpPopupExportUNV );
const bool isSTL = ( theCommandID == SMESHOp::OpExportSTL ||
theCommandID == SMESHOp::OpPopupExportSTL );
-#ifdef WITH_CGNS
const bool isCGNS= ( theCommandID == SMESHOp::OpExportCGNS ||
theCommandID == SMESHOp::OpPopupExportCGNS );
-#else
- const bool isCGNS= false;
-#endif
const bool isSAUV= ( theCommandID == SMESHOp::OpExportSAUV ||
theCommandID == SMESHOp::OpPopupExportSAUV );
const bool isGMF = ( theCommandID == SMESHOp::OpExportGMF ||
const bool multiMeshSupported = ( isMED || isCGNS ); // file can hold several meshes
if ( selected.Extent() == 0 || ( selected.Extent() > 1 && !multiMeshSupported ))
return;
-
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+ bool aCheckWarn = true;
+ if ( resMgr )
+ aCheckWarn = resMgr->booleanValue( "SMESH", "show_warning", false );
// get mesh object from selection and check duplication of their names
bool hasDuplicatedMeshNames = false;
QList< QPair< SMESH::SMESH_IDSource_var, QString > > aMeshList;
QObject::tr( "SMESH_BAD_MESH_SELECTION" ));
return;
}
+ SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( aMeshItem );
+ if ( aCheckWarn && !aGroup->_is_nil() )
+ {
+ QMessageBox msgBox(SUIT_MessageBox::Warning,
+ QObject::tr("SMESH_WRN_WARNING"),
+ QObject::tr("SMESH_EXPORT_ONLY_GPOUP"),
+ QMessageBox::StandardButton::NoButton,
+ SMESHGUI::desktop());
+ QCheckBox dontShowCheckBox(QObject::tr("SMESH_WRN_SHOW_DLG_CHECKBOX"));
+ msgBox.addButton(QMessageBox::Ok);
+ msgBox.addButton(QMessageBox::Cancel);
+ msgBox.setDefaultButton(QMessageBox::Cancel);
+ QGridLayout* lt = qobject_cast<QGridLayout*>(msgBox.layout());
+ QDialogButtonBox* btnbox = msgBox.findChild<QDialogButtonBox*>();
+ lt->addWidget(&dontShowCheckBox, lt->rowCount(), lt->columnCount()-1, lt->rowCount(), lt->columnCount());
+ lt->addWidget(btnbox, lt->rowCount(), 0, lt->rowCount(), lt->columnCount());
+ if(msgBox.exec() == QMessageBox::Ok)
+ {
+ if(dontShowCheckBox.checkState() == Qt::Checked)
+ {
+ if ( resMgr )
+ resMgr->setValue( "SMESH", "show_warning", false);
+ }
+ aCheckWarn = false;
+ }
+ else
+ return;
+ }
QString aMeshName = anIObject->getName();
// Init the parameters with the default values
bool aIsASCII_STL = true;
bool toCreateGroups = false;
- SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
if ( resMgr )
toCreateGroups = resMgr->booleanValue( "SMESH", "auto_groups", false );
bool toOverwrite = true;
aSel->selectedObjects( selected );
if ( selected.Extent() >= 1 ) {
+ SUIT_OverrideCursor wc;
SALOME_ListIteratorOfListIO It( selected );
for( ; It.More(); It.Next()){
Handle(SALOME_InteractiveObject) IObject = It.Value();
type = QObject::tr( "EQUAL_FACE" );
else if ( dynamic_cast< SMESH::Controls::CoincidentElements3D* >( f.get() ) )
type = QObject::tr( "EQUAL_VOLUME" );
+ else if ( dynamic_cast< SMESH::Controls::NodeConnectivityNumber* >( f.get() ) )
+ type = QObject::tr( "NODE_CONNECTIVITY_NB" );
return type;
}
return;
} // case SMESHOp::OpProperties:
} // switch(theCommandID)
+ SUIT_OverrideCursor wc;
SALOME_ListIteratorOfListIO It( selected );
for( ; It.More(); It.Next()){
Handle(SALOME_InteractiveObject) IObject = It.Value();
ActionControl.Bind( 0, SMESH_Actor::eNone );
ActionControl.Bind( SMESHOp::OpFreeNode, SMESH_Actor::eFreeNodes );
ActionControl.Bind( SMESHOp::OpEqualNode, SMESH_Actor::eCoincidentNodes );
+ ActionControl.Bind( SMESHOp::OpNodeConnectivityNb, SMESH_Actor::eNodeConnectivityNb );
ActionControl.Bind( SMESHOp::OpFreeEdge, SMESH_Actor::eFreeEdges );
ActionControl.Bind( SMESHOp::OpFreeBorder, SMESH_Actor::eFreeBorders );
ActionControl.Bind( SMESHOp::OpLength, SMESH_Actor::eLength );
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() ) {
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()) ) {
- QString functorName = functorToString( anActor->GetFunctor() );
+ 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() );
+ int anEntitiesCount = anActor->GetNumberControlEntities();
+ if (anEntitiesCount >= 0)
+ functorName = functorName + ": " + QString::number(anEntitiesCount);
anActor->GetScalarBarActor()->SetTitle( functorName.toLatin1().constData() );
SMESH::RepaintCurrentView();
#ifndef DISABLE_PLOT2DVIEWER
case SMESHOp::OpImportUNV:
case SMESHOp::OpImportMED:
case SMESHOp::OpImportSTL:
-#ifdef WITH_CGNS
case SMESHOp::OpImportCGNS:
-#endif
case SMESHOp::OpImportSAUV:
case SMESHOp::OpImportGMF:
+ case SMESHOp::OpPopupImportDAT:
+ case SMESHOp::OpPopupImportUNV:
+ case SMESHOp::OpPopupImportMED:
+ case SMESHOp::OpPopupImportSTL:
+ case SMESHOp::OpPopupImportCGNS:
+ case SMESHOp::OpPopupImportSAUV:
+ case SMESHOp::OpPopupImportGMF:
{
if(checkLock(aStudy)) break;
::ImportMeshesFromFile(GetSMESHGen(),theCommandID);
case SMESHOp::OpExportMED:
case SMESHOp::OpExportUNV:
case SMESHOp::OpExportSTL:
-#ifdef WITH_CGNS
case SMESHOp::OpExportCGNS:
-#endif
case SMESHOp::OpExportSAUV:
case SMESHOp::OpExportGMF:
case SMESHOp::OpPopupExportDAT:
case SMESHOp::OpPopupExportMED:
case SMESHOp::OpPopupExportUNV:
case SMESHOp::OpPopupExportSTL:
-#ifdef WITH_CGNS
case SMESHOp::OpPopupExportCGNS:
-#endif
case SMESHOp::OpPopupExportSAUV:
case SMESHOp::OpPopupExportGMF:
{
case SMESHOp::OpOrientationOnFaces:
{
+ SUIT_OverrideCursor wc;
LightApp_SelectionMgr* mgr = selectionMgr();
SALOME_ListIO selected; mgr->selectedObjects( selected );
extractContainers( sel_objects, to_process );
try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
-#endif
if (vtkwnd) {
SALOME_ListIteratorOfListIO It( to_process );
for ( ; It.More(); It.Next())
case SMESHOp::OpCreateMesh:
case SMESHOp::OpCreateSubMesh:
case SMESHOp::OpEditMeshOrSubMesh:
+ case SMESHOp::OpEditMesh:
+ case SMESHOp::OpEditSubMesh:
case SMESHOp::OpCompute:
+ case SMESHOp::OpComputeSubMesh:
case SMESHOp::OpPreCompute:
case SMESHOp::OpEvaluate:
case SMESHOp::OpMeshOrder:
for ( ; It.More(); It.Next() )
{
Handle(SALOME_InteractiveObject) IOS = It.Value();
- SMESH::SMESH_Mesh_var aMesh =
- SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IOS);
+ SMESH::SMESH_Mesh_var aMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IOS);
if ( aMesh->_is_nil()) continue;
try {
- SMESH::RemoveVisualObjectWithActors(IOS->getEntry(), true);
aMesh->Clear();
+ if ( aMesh->NbNodes() == 0 ) // imported mesh is not empty
+ SMESH::RemoveVisualObjectWithActors(IOS->getEntry(), true);
_PTR(SObject) aMeshSObj = SMESH::FindSObject(aMesh);
SMESH::ModifiedMesh( aMeshSObj, false, true);
// hide groups and submeshes
// CONTROLS
case SMESHOp::OpFreeNode:
case SMESHOp::OpEqualNode:
+ case SMESHOp::OpNodeConnectivityNb:
case SMESHOp::OpFreeEdge:
case SMESHOp::OpFreeBorder:
case SMESHOp::OpLength:
//createSMESHAction( SMESHOp::OpImportDAT, "IMPORT_DAT", "", (Qt::CTRL+Qt::Key_B) );
createSMESHAction( SMESHOp::OpImportUNV, "IMPORT_UNV", "", (Qt::CTRL+Qt::Key_I) );
createSMESHAction( SMESHOp::OpImportMED, "IMPORT_MED", "", (Qt::CTRL+Qt::Key_M) );
- //createSMESHAction( 114, "NUM" );
createSMESHAction( SMESHOp::OpImportSTL, "IMPORT_STL" );
#ifdef WITH_CGNS
createSMESHAction( SMESHOp::OpImportCGNS, "IMPORT_CGNS" );
#endif
createSMESHAction( SMESHOp::OpImportSAUV, "IMPORT_SAUV" );
createSMESHAction( SMESHOp::OpImportGMF, "IMPORT_GMF" );
+ createSMESHAction( SMESHOp::OpPopupImportUNV, "IMPORT_UNV");
+ createSMESHAction( SMESHOp::OpPopupImportMED, "IMPORT_MED");
+ createSMESHAction( SMESHOp::OpPopupImportSTL, "IMPORT_STL" );
+#ifdef WITH_CGNS
+ createSMESHAction( SMESHOp::OpPopupImportCGNS, "IMPORT_CGNS" );
+#endif
+ createSMESHAction( SMESHOp::OpPopupImportSAUV, "IMPORT_SAUV" );
+ createSMESHAction( SMESHOp::OpPopupImportGMF, "IMPORT_GMF" );
+
createSMESHAction( SMESHOp::OpExportDAT, "DAT" );
createSMESHAction( SMESHOp::OpExportMED, "MED" );
createSMESHAction( SMESHOp::OpExportUNV, "UNV" );
createSMESHAction( SMESHOp::OpCreateMesh, "CREATE_MESH", "ICON_DLG_INIT_MESH" );
createSMESHAction( SMESHOp::OpCreateSubMesh, "CREATE_SUBMESH", "ICON_DLG_ADD_SUBMESH" );
createSMESHAction( SMESHOp::OpEditMeshOrSubMesh, "EDIT_MESHSUBMESH", "ICON_DLG_EDIT_MESH" );
+ createSMESHAction( SMESHOp::OpEditMesh, "EDIT_MESH", "ICON_DLG_EDIT_MESH" );
+ createSMESHAction( SMESHOp::OpEditSubMesh, "EDIT_SUBMESH", "ICON_DLG_EDIT_MESH" );
createSMESHAction( SMESHOp::OpBuildCompoundMesh, "BUILD_COMPOUND", "ICON_BUILD_COMPOUND" );
createSMESHAction( SMESHOp::OpCopyMesh, "COPY_MESH", "ICON_COPY_MESH" );
createSMESHAction( SMESHOp::OpCompute, "COMPUTE", "ICON_COMPUTE" );
+ createSMESHAction( SMESHOp::OpComputeSubMesh, "COMPUTE_SUBMESH", "ICON_COMPUTE" );
createSMESHAction( SMESHOp::OpPreCompute, "PRECOMPUTE", "ICON_PRECOMPUTE" );
createSMESHAction( SMESHOp::OpEvaluate, "EVALUATE", "ICON_EVALUATE" );
createSMESHAction( SMESHOp::OpMeshOrder, "MESH_ORDER", "ICON_MESH_ORDER");
createSMESHAction( SMESHOp::OpIntersectGroups, "INT_GROUP", "ICON_INTERSECT" );
createSMESHAction( SMESHOp::OpCutGroups, "CUT_GROUP", "ICON_CUT" );
createSMESHAction( SMESHOp::OpGroupUnderlyingElem, "UNDERLYING_ELEMS", "ICON_UNDERLYING_ELEMS" );
- createSMESHAction( SMESHOp::OpAddElemGroupPopup, "ADD" );
- createSMESHAction( SMESHOp::OpRemoveElemGroupPopup, "REMOVE" );
+ createSMESHAction( SMESHOp::OpAddElemGroupPopup, "ADD_TO_GROUP" );
+ createSMESHAction( SMESHOp::OpRemoveElemGroupPopup, "REMOVE_FROM_GROUP" );
createSMESHAction( SMESHOp::OpDeleteGroup, "DEL_GROUP", "ICON_DEL_GROUP" );
createSMESHAction( SMESHOp::OpMeshInformation , "ADV_INFO", "ICON_ADV_INFO" );
//createSMESHAction( SMESHOp::OpStdInfo, "STD_INFO", "ICON_STD_INFO" );
//update
createSMESHAction( SMESHOp::OpFreeNode, "FREE_NODE", "ICON_FREE_NODE", 0, true );
createSMESHAction( SMESHOp::OpEqualNode, "EQUAL_NODE", "ICON_EQUAL_NODE", 0, true );
+ createSMESHAction( SMESHOp::OpNodeConnectivityNb, "NODE_CONNECTIVITY_NB", "ICON_NODE_CONN_NB", 0, true );
createSMESHAction( SMESHOp::OpFreeEdge, "FREE_EDGE", "ICON_FREE_EDGE", 0, true );
createSMESHAction( SMESHOp::OpFreeBorder, "FREE_BORDER", "ICON_FREE_EDGE_2D", 0, true );
createSMESHAction( SMESHOp::OpLength, "LENGTH", "ICON_LENGTH", 0, true );
createSMESHAction( SMESHOp::OpBareBorderVolume, "BARE_BORDER_VOLUME", "ICON_BARE_BORDER_VOLUME", 0, true );
createSMESHAction( SMESHOp::OpOverConstrainedVolume, "OVER_CONSTRAINED_VOLUME", "ICON_OVER_CONSTRAINED_VOLUME", 0, true );
createSMESHAction( SMESHOp::OpEqualVolume, "EQUAL_VOLUME", "ICON_EQUAL_VOLUME", 0, true );
- createSMESHAction( SMESHOp::OpOverallMeshQuality, "OVERALL_MESH_QUALITY" );
+ createSMESHAction( SMESHOp::OpOverallMeshQuality, "OVERALL_MESH_QUALITY", "ICON_OVL_MESH_QUALITY" );
createSMESHAction( SMESHOp::OpNode, "NODE", "ICON_DLG_NODE" );
createSMESHAction( SMESHOp::OpElem0D, "ELEM0D", "ICON_DLG_ELEM0D" );
createSMESHAction( SMESHOp::OpPropertiesArea, "MEASURE_AREA", "ICON_MEASURE_AREA" );
createSMESHAction( SMESHOp::OpPropertiesVolume, "MEASURE_VOLUME", "ICON_MEASURE_VOLUME" );
- createSMESHAction( SMESHOp::OpHide, "HIDE" );
- createSMESHAction( SMESHOp::OpShow, "SHOW" );
+ createSMESHAction( SMESHOp::OpHide, "HIDE", "ICON_HIDE" );
+ createSMESHAction( SMESHOp::OpShow, "SHOW", "ICON_SHOW" );
createSMESHAction( SMESHOp::OpShowOnly, "DISPLAY_ONLY" );
createSMESHAction( SMESHOp::OpSortChild, "SORT_CHILD_ITEMS" );
QList<int> aCtrlActions;
- aCtrlActions << SMESHOp::OpFreeNode << SMESHOp::OpEqualNode // node controls
+ aCtrlActions << SMESHOp::OpFreeNode << SMESHOp::OpEqualNode
+ << SMESHOp::OpNodeConnectivityNb // node controls
<< SMESHOp::OpFreeEdge << SMESHOp::OpFreeBorder
<< SMESHOp::OpLength << SMESHOp::OpConnection << SMESHOp::OpEqualEdge // edge controls
<< SMESHOp::OpFreeFace << SMESHOp::OpLength2D << SMESHOp::OpConnection2D
createMenu( SMESHOp::OpFreeNode, nodeId, -1 );
createMenu( SMESHOp::OpEqualNode, nodeId, -1 );
+ //createMenu( SMESHOp::OpNodeConnectivityNb, nodeId, -1 );
createMenu( SMESHOp::OpFreeBorder, edgeId, -1 );
createMenu( SMESHOp::OpLength, edgeId, -1 );
createMenu( SMESHOp::OpConnection, edgeId, -1 );
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 --------------
createTool( SMESHOp::OpFreeNode, ctrl0dTb );
createTool( SMESHOp::OpEqualNode, ctrl0dTb );
+ //createTool( SMESHOp::OpNodeConnectivityNb, ctrl0dTb );
createTool( SMESHOp::OpFreeBorder, ctrl1dTb );
createTool( SMESHOp::OpLength, ctrl1dTb );
QString dc = "selcount"; // VSR : instead of QtxPopupSelection::defSelCountParam()
myRules.clear();
- QString OB = "'ObjectBrowser'",
- View = "'" + SVTK_Viewer::Type() + "'",
- pat = "'%1'",
- mesh = pat.arg( SMESHGUI_Selection::typeName( SMESH::MESH ) ),
- group = pat.arg( SMESHGUI_Selection::typeName( SMESH::GROUP ) ),
- hypo = pat.arg( SMESHGUI_Selection::typeName( SMESH::HYPOTHESIS ) ),
- algo = pat.arg( SMESHGUI_Selection::typeName( SMESH::ALGORITHM ) ),
- elems = QString( "'%1' '%2' '%3' '%4' '%5' '%6'" ).
- arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_VERTEX ) ).
- arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_EDGE ) ).
- arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_FACE ) ).
- arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_SOLID ) ).
- arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_COMPOUND ) ).
- arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH ) ),
- subMesh = elems,
- mesh_part = mesh + " " + subMesh + " " + group,
- mesh_group = mesh + " " + group,
- hyp_alg = hypo + " " + algo;
+ QString
+ OB = "'ObjectBrowser'",
+ View = "'" + SVTK_Viewer::Type() + "'",
+ pat = "'%1'",
+ mesh = pat.arg( SMESHGUI_Selection::typeName( SMESH::MESH ) ),
+ group = pat.arg( SMESHGUI_Selection::typeName( SMESH::GROUP ) ),
+ hypo = pat.arg( SMESHGUI_Selection::typeName( SMESH::HYPOTHESIS ) ),
+ algo = pat.arg( SMESHGUI_Selection::typeName( SMESH::ALGORITHM ) ),
+ smesh = pat.arg( SMESHGUI_Selection::typeName( SMESH::COMPONENT ) ),
+ elems = QString( "'%1' '%2' '%3' '%4' '%5' '%6'" ).
+ arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_VERTEX ) ).
+ arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_EDGE ) ).
+ arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_FACE ) ).
+ arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_SOLID ) ).
+ arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_COMPOUND ) ).
+ arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH ) ),
+ subMesh = elems,
+ mesh_part = mesh + " " + subMesh + " " + group,
+ mesh_group = mesh + " " + group,
+ mesh_submesh = mesh + " " + subMesh,
+ hyp_alg = hypo + " " + algo;
// popup for object browser
QString
isNotEmpty("numberOfNodes <> 0"),
// has nodes, edges, etc in VISIBLE! actor
- hasNodes("(numberOfNodes > 0 )"),//&& isVisible)"),
+ hasNodes("(numberOfNodes > 0 ) && hasActor"),
hasElems("(count( elemTypes ) > 0)"),
hasDifferentElems("(count( elemTypes ) > 1)"),
+ hasDifferentObjElems("(count( objElemTypes ) > 1)"),
hasBalls("({'BallElem'} in elemTypes)"),
hasElems0d("({'Elem0d'} in elemTypes)"),
hasEdges("({'Edge'} in elemTypes)"),
hasVolumes("({'Volume'} in elemTypes)"),
hasFacesOrVolumes("(({'Face'} in elemTypes) || ({'Volume'} in elemTypes)) ");
- createPopupItem( SMESHOp::OpFileInformation, OB, mesh, "&& selcount=1 && isImported" );
- createPopupItem( SMESHOp::OpCreateSubMesh, OB, mesh, "&& hasGeomReference");
- createPopupItem( SMESHOp::OpEditMeshOrSubMesh, OB, mesh );
- createPopupItem( SMESHOp::OpEditMeshOrSubMesh, OB, subMesh, "&& hasGeomReference" );
- createPopupItem( SMESHOp::OpEditGroup, OB, group );
+ createPopupItem( SMESHOp::OpFileInformation, OB, mesh, "&& selcount=1 && isImported" );
+ createPopupItem( SMESHOp::OpCreateSubMesh, OB, mesh, "&& hasGeomReference");
+ createPopupItem( SMESHOp::OpEditMesh, OB, mesh, "&& selcount=1" );
+ createPopupItem( SMESHOp::OpEditSubMesh, OB, subMesh, "&& selcount=1 && hasGeomReference" );
+ createPopupItem( SMESHOp::OpEditGroup, OB, group );
createPopupItem( SMESHOp::OpEditGeomGroupAsGroup, OB, group, "&& groupType != 'Group'" );
popupMgr()->insert( separator(), -1, 0 );
- createPopupItem( SMESHOp::OpCompute, OB, mesh, "&& isComputable" );
- createPopupItem( SMESHOp::OpPreCompute, OB, mesh, "&& isPreComputable" );
- createPopupItem( SMESHOp::OpEvaluate, OB, mesh, "&& isComputable" );
- createPopupItem( SMESHOp::OpMeshOrder, OB, mesh, "&& isComputable && hasGeomReference" );
- createPopupItem( SMESHOp::OpUpdate, OB, mesh_part );
- createPopupItem( SMESHOp::OpMeshInformation, OB, mesh_part );
- createPopupItem( SMESHOp::OpFindElementByPoint, OB, mesh_group );
- createPopupItem( SMESHOp::OpOverallMeshQuality, OB, mesh_part );
+ createPopupItem( SMESHOp::OpCompute, OB, mesh, "&& selcount=1 && isComputable" );
+ createPopupItem( SMESHOp::OpComputeSubMesh, OB, subMesh, "&& selcount=1 && isComputable" );
+ createPopupItem( SMESHOp::OpPreCompute, OB, mesh, "&& selcount=1 && isPreComputable" );
+ createPopupItem( SMESHOp::OpEvaluate, OB, mesh, "&& selcount=1 && isComputable" );
+ createPopupItem( SMESHOp::OpMeshOrder, OB, mesh, "&& selcount=1 && isComputable && hasGeomReference" );
+ createPopupItem( SMESHOp::OpUpdate, OB, mesh_part );
+ createPopupItem( SMESHOp::OpMeshInformation, OB, mesh_part );
+ createPopupItem( SMESHOp::OpFindElementByPoint,OB, mesh_group, "&& selcount=1" );
+ createPopupItem( SMESHOp::OpOverallMeshQuality,OB, mesh_part );
popupMgr()->insert( separator(), -1, 0 );
- createPopupItem( SMESHOp::OpCreateGroup, OB, mesh );
- createPopupItem( SMESHOp::OpCreateGeometryGroup, OB, mesh, "&& hasGeomReference" );
- createPopupItem( SMESHOp::OpConstructGroup, OB, subMesh );
+ createPopupItem( SMESHOp::OpCreateGroup, OB, mesh, "&& selcount=1" );
+ createPopupItem( SMESHOp::OpCreateGeometryGroup, OB, mesh, "&& selcount=1 && hasGeomReference" );
+ createPopupItem( SMESHOp::OpConstructGroup, OB, subMesh );
popupMgr()->insert( separator(), -1, 0 );
- createPopupItem( SMESHOp::OpEditHypothesis, OB, hypo, "&& isEditableHyp");
- createPopupItem( SMESHOp::OpUnassign, OB, hyp_alg ); // REMOVE HYPOTHESIS / ALGORITHMS
+ createPopupItem( SMESHOp::OpEditHypothesis, OB, hypo, "&& isEditableHyp");
+ createPopupItem( SMESHOp::OpUnassign, OB, hyp_alg );
popupMgr()->insert( separator(), -1, 0 );
- createPopupItem( SMESHOp::OpConvertMeshToQuadratic, OB, mesh + " " + subMesh ); // convert to quadratic
- createPopupItem( SMESHOp::OpCreateBoundaryElements, OB, mesh + " " + group, // create 2D mesh from 3D
- "&& dim>=2");
+ createPopupItem( SMESHOp::OpConvertMeshToQuadratic, OB, mesh_submesh );
+ createPopupItem( SMESHOp::OpCreateBoundaryElements, OB, mesh_group, "&& selcount=1 && dim>=2");
popupMgr()->insert( separator(), -1, 0 );
createPopupItem( SMESHOp::OpClearMesh, OB, mesh );
- popupMgr()->insert( separator(), -1, 0 );
+ //popupMgr()->insert( separator(), -1, 0 );
QString only_one_non_empty = QString( " && %1=1 && numberOfNodes>0" ).arg( dc );
QString multiple_non_empty = QString( " && %1>0 && numberOfNodes>0" ).arg( dc );
createPopupItem( SMESHOp::OpPopupExportDAT, OB, mesh_group, only_one_non_empty, anId );
createPopupItem( SMESHOp::OpDelete, OB, mesh_part + " " + hyp_alg );
createPopupItem( SMESHOp::OpDeleteGroup, OB, group );
+
+ anId = popupMgr()->insert( tr( "MEN_IMPORT" ), -1, -1 ); // IMPORT submenu
+ createPopupItem( SMESHOp::OpPopupImportMED, OB, smesh, "", anId );
+ createPopupItem( SMESHOp::OpPopupImportUNV, OB, smesh, "", anId );
+ createPopupItem( SMESHOp::OpPopupImportSTL, OB, smesh, "", anId );
+#ifdef WITH_CGNS
+ createPopupItem( SMESHOp::OpPopupImportCGNS, OB, smesh, "", anId );
+#endif
+ createPopupItem( SMESHOp::OpPopupImportSAUV, OB, smesh, "", anId );
+ createPopupItem( SMESHOp::OpPopupImportGMF, OB, smesh, "", anId );
+ createPopupItem( SMESHOp::OpPopupImportDAT, OB, smesh, "", anId );
popupMgr()->insert( separator(), -1, 0 );
// popup for viewer
createPopupItem( SMESHOp::OpEditGroup, View, group );
- createPopupItem( SMESHOp::OpAddElemGroupPopup, View, elems );
- createPopupItem( SMESHOp::OpRemoveElemGroupPopup, View, elems );
+ createPopupItem( SMESHOp::OpAddElemGroupPopup, View, elems, "&& guiState = 800" );
+ createPopupItem( SMESHOp::OpRemoveElemGroupPopup, View, elems, "&& guiState = 800" );
popupMgr()->insert( separator(), -1, 0 );
createPopupItem( SMESHOp::OpUpdate, View, mesh_part );
popupMgr()->setRule( action( SMESHOp::OpDMShading ), "displayMode = 'eSurface'", QtxPopupMgr::ToggleRule );
popupMgr()->insert( action( SMESHOp::OpDMNodes ), anId, -1 );
- popupMgr()->setRule( action( SMESHOp::OpDMNodes ), aMeshInVTK + "&&" + hasNodes, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( SMESHOp::OpDMNodes ), aMeshInVTK + "&&" + hasNodes + "&&" + hasElems, QtxPopupMgr::VisibleRule );
popupMgr()->setRule( action( SMESHOp::OpDMNodes ), "displayMode = 'ePoint'", QtxPopupMgr::ToggleRule );
popupMgr()->insert( separator(), anId, -1 );
popupMgr()->insert( separator(), anId, -1 );
popupMgr()->insert( action( SMESHOp::OpDEChoose ), anId, -1 );
- popupMgr()->setRule( action( SMESHOp::OpDEChoose ), aClient + "&&" + aType + "&&" + isNotEmpty, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( SMESHOp::OpDEChoose ), aClient + "&& $type in {" + mesh + "} &&" + hasDifferentObjElems, QtxPopupMgr::VisibleRule );
popupMgr()->insert( separator(), anId, -1 );
// Controls
//-------------------------------------------------
QString
- aMeshInVtkHasNodes = aMeshInVTK + "&&" + hasNodes,
- aMeshInVtkHasEdges = aMeshInVTK + "&&" + hasEdges,
- aMeshInVtkHasFaces = aMeshInVTK + "&&" + hasFaces,
+ aMeshInVtkHasNodes = aMeshInVTK + "&&" + hasNodes,
+ aMeshInVtkHasEdges = aMeshInVTK + "&&" + hasEdges,
+ aMeshInVtkHasFaces = aMeshInVTK + "&&" + hasFaces,
aMeshInVtkHasVolumes = aMeshInVTK + "&&" + hasVolumes;
anId = popupMgr()->insert( tr( "MEN_CTRL" ), -1, -1 );
popupMgr()->setRule( action( SMESHOp::OpEqualNode ), aMeshInVtkHasNodes, QtxPopupMgr::VisibleRule );
popupMgr()->setRule( action( SMESHOp::OpEqualNode ), "controlMode = 'eCoincidentNodes'", QtxPopupMgr::ToggleRule);
+ // popupMgr()->insert( action( SMESHOp::OpNodeConnectivityNb ), aSubId, -1 );
+ // popupMgr()->setRule( action( SMESHOp::OpNodeConnectivityNb ), aMeshInVtkHasNodes, QtxPopupMgr::VisibleRule );
+ // popupMgr()->setRule( action( SMESHOp::OpNodeConnectivityNb ), "controlMode = 'eNodeConnectivityNb'", QtxPopupMgr::ToggleRule );
+
aSubId = popupMgr()->insert( tr( "MEN_EDGE_CTRL" ), anId, -1 ); // EDGE CONTROLS
popupMgr()->insert( action( SMESHOp::OpFreeBorder ), aSubId, -1 );
setPreferenceProperty( lim, "special", tr( "PREF_UPDATE_LIMIT_NOLIMIT" ) );
addPreference( tr( "PREF_INCREMENTAL_LIMIT" ), autoUpdate, LightApp_Preferences::Bool, "SMESH", "incremental_limit" );
- int qaGroup = addPreference( tr( "PREF_GROUP_QUALITY" ), genTab );
- setPreferenceProperty( qaGroup, "columns", 2 );
- addPreference( tr( "PREF_DISPLAY_ENTITY" ), qaGroup, LightApp_Preferences::Bool, "SMESH", "display_entity" );
- addPreference( tr( "PREF_PRECISION_USE" ), qaGroup, LightApp_Preferences::Bool, "SMESH", "use_precision" );
- int prec = addPreference( tr( "PREF_PRECISION_VALUE" ), qaGroup, LightApp_Preferences::IntSpin, "SMESH", "controls_precision" );
- setPreferenceProperty( prec, "min", 0 );
- setPreferenceProperty( prec, "max", 100 );
- int doubleNodesTol = addPreference( tr( "PREF_EQUAL_NODES_TOL" ), qaGroup, LightApp_Preferences::DblSpin, "SMESH", "equal_nodes_tolerance" );
- setPreferenceProperty( doubleNodesTol, "precision", 10 );
- setPreferenceProperty( doubleNodesTol, "min", 0.0000000001 );
- setPreferenceProperty( doubleNodesTol, "max", 1000000.0 );
- setPreferenceProperty( doubleNodesTol, "step", 0.0000001 );
-
int dispgroup = addPreference( tr( "PREF_DISPLAY_MODE_GROUP" ), genTab );
setPreferenceProperty( dispgroup, "columns", 2 );
int dispmode = addPreference( tr( "PREF_DISPLAY_MODE" ), dispgroup, LightApp_Preferences::Selector, "SMESH", "display_mode" );
setPreferenceProperty( maxAngle, "min", 1 );
setPreferenceProperty( maxAngle, "max", 90 );
+ int qaGroup = addPreference( tr( "PREF_GROUP_QUALITY" ), genTab );
+ setPreferenceProperty( qaGroup, "columns", 2 );
+ addPreference( tr( "PREF_DISPLAY_ENTITY" ), qaGroup, LightApp_Preferences::Bool, "SMESH", "display_entity" );
+ addPreference( tr( "PREF_PRECISION_USE" ), qaGroup, LightApp_Preferences::Bool, "SMESH", "use_precision" );
+ int prec = addPreference( tr( "PREF_PRECISION_VALUE" ), qaGroup, LightApp_Preferences::IntSpin, "SMESH", "controls_precision" );
+ setPreferenceProperty( prec, "min", 0 );
+ setPreferenceProperty( prec, "max", 100 );
+ int doubleNodesTol = addPreference( tr( "PREF_EQUAL_NODES_TOL" ), qaGroup, LightApp_Preferences::DblSpin, "SMESH", "equal_nodes_tolerance" );
+ setPreferenceProperty( doubleNodesTol, "precision", 10 );
+ setPreferenceProperty( doubleNodesTol, "min", 0.0000000001 );
+ setPreferenceProperty( doubleNodesTol, "max", 1000000.0 );
+ setPreferenceProperty( doubleNodesTol, "step", 0.0000001 );
int exportgroup = addPreference( tr( "PREF_GROUP_EXPORT" ), genTab );
setPreferenceProperty( exportgroup, "columns", 2 );
addPreference( tr( "PREF_AUTO_GROUPS" ), exportgroup, LightApp_Preferences::Bool, "SMESH", "auto_groups" );
+ addPreference( tr( "PREF_SHOW_WARN" ), exportgroup, LightApp_Preferences::Bool, "SMESH", "show_warning" );
//addPreference( tr( "PREF_RENUMBER" ), exportgroup, LightApp_Preferences::Bool, "SMESH", "renumbering" );
int computeGroup = addPreference( tr( "PREF_GROUP_COMPUTE" ), genTab );
/*!
* \brief Set default selection mode
*
-* SLOT called when operation commited. Sets default selection mode
+* SLOT called when operation committed. Sets default selection mode
*/
//================================================================================
void SMESHGUI::onOperationCommited( SUIT_Operation* )
op = new SMESHGUI_MeshOp( true, false );
break;
case SMESHOp::OpEditMeshOrSubMesh:
+ case SMESHOp::OpEditMesh:
+ case SMESHOp::OpEditSubMesh:
op = new SMESHGUI_MeshOp( false );
break;
case SMESHOp::OpCompute:
+ case SMESHOp::OpComputeSubMesh:
op = new SMESHGUI_ComputeOp();
break;
case SMESHOp::OpPreCompute:
Handle(SALOME_InteractiveObject) io = aSmeshActor->getIO();
if (io->hasEntry())
{
- // entry is "encoded" = it does NOT contain component adress,
+ // entry is "encoded" = it does NOT contain component address,
// since it is a subject to change on next component loading
std::string entry = ip->encodeEntry(io->getEntry(), componentName);
for (std::vector<std::string>::iterator entIt = entries.begin(); entIt != entries.end(); ++entIt)
{
- // entry is a normal entry - it should be "decoded" (setting base adress of component)
+ // entry is a normal entry - it should be "decoded" (setting base address of component)
QString entry (ip->decodeEntry(*entIt).c_str());
// Check that the entry corresponds to a real object in the Study
if (ac->IsA("SMESH_Actor")) {
SMESH_Actor* aGeomAc = SMESH_Actor::SafeDownCast(ac);
if (aGeomAc->hasIO()) {
- Handle(SALOME_InteractiveObject) io =
- Handle(SALOME_InteractiveObject)::DownCast(aGeomAc->getIO());
+ Handle(SALOME_InteractiveObject) io = aGeomAc->getIO();
if (io->hasEntry() && strcmp(io->getEntry(), entry.toLatin1().data()) == 0) {
isFound = true;
vtkActors.Bind(viewIndex, aGeomAc);
*/
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;
+ }
}
}
}