mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-31 02:40:33 +05:00
Adjust to HEAD modifications
This commit is contained in:
parent
279286ba88
commit
d9d59d4077
@ -81,13 +81,12 @@
|
|||||||
|
|
||||||
#include "SalomeApp_Tools.h"
|
#include "SalomeApp_Tools.h"
|
||||||
#include "SalomeApp_Study.h"
|
#include "SalomeApp_Study.h"
|
||||||
#include "SalomeApp_NameDlg.h"
|
#include "LightApp_DataOwner.h"
|
||||||
#include "SalomeApp_DataOwner.h"
|
|
||||||
#include "SalomeApp_Application.h"
|
#include "SalomeApp_Application.h"
|
||||||
#include "SalomeApp_Preferences.h"
|
#include "LightApp_Preferences.h"
|
||||||
#include "SalomeApp_VTKSelector.h"
|
#include "LightApp_VTKSelector.h"
|
||||||
#include "SalomeApp_Operation.h"
|
#include "LightApp_Operation.h"
|
||||||
#include "SalomeApp_UpdateFlags.h"
|
#include "LightApp_UpdateFlags.h"
|
||||||
|
|
||||||
#include "SalomeApp_ImportOperation.h"
|
#include "SalomeApp_ImportOperation.h"
|
||||||
|
|
||||||
@ -126,6 +125,7 @@
|
|||||||
#include <qstring.h>
|
#include <qstring.h>
|
||||||
#include <qwidget.h>
|
#include <qwidget.h>
|
||||||
#include <qaction.h>
|
#include <qaction.h>
|
||||||
|
#include <qinputdialog.h>
|
||||||
|
|
||||||
// BOOST Includes
|
// BOOST Includes
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
@ -184,7 +184,6 @@ namespace{
|
|||||||
if(!filename.isEmpty()) {
|
if(!filename.isEmpty()) {
|
||||||
SUIT_OverrideCursor wc;
|
SUIT_OverrideCursor wc;
|
||||||
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
|
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
|
||||||
theComponentMesh->SetCurrentStudy( _CAST(Study,aStudy)->GetStudy() );
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
SMESH::mesh_array_var aMeshes = new SMESH::mesh_array;
|
SMESH::mesh_array_var aMeshes = new SMESH::mesh_array;
|
||||||
@ -247,7 +246,7 @@ namespace{
|
|||||||
|
|
||||||
void ExportMeshToFile( int theCommandID )
|
void ExportMeshToFile( int theCommandID )
|
||||||
{
|
{
|
||||||
SalomeApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
|
LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
|
||||||
SALOME_ListIO selected;
|
SALOME_ListIO selected;
|
||||||
if( aSel )
|
if( aSel )
|
||||||
aSel->selectedObjects( selected );
|
aSel->selectedObjects( selected );
|
||||||
@ -300,6 +299,7 @@ namespace{
|
|||||||
SUIT_FileDlg* fd = new SUIT_FileDlg( SMESHGUI::desktop(), false, true, true );
|
SUIT_FileDlg* fd = new SUIT_FileDlg( SMESHGUI::desktop(), false, true, true );
|
||||||
fd->setCaption( aTitle );
|
fd->setCaption( aTitle );
|
||||||
fd->setFilters( filters );
|
fd->setFilters( filters );
|
||||||
|
fd->setSelectedFilter( QObject::tr("MED 2.2 (*.med)") );
|
||||||
bool is_ok = false;
|
bool is_ok = false;
|
||||||
while(!is_ok){
|
while(!is_ok){
|
||||||
fd->exec();
|
fd->exec();
|
||||||
@ -360,7 +360,7 @@ namespace{
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SetDisplayEntity(int theCommandID){
|
void SetDisplayEntity(int theCommandID){
|
||||||
SalomeApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
|
LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
|
||||||
SALOME_ListIO selected;
|
SALOME_ListIO selected;
|
||||||
if( aSel )
|
if( aSel )
|
||||||
aSel->selectedObjects( selected );
|
aSel->selectedObjects( selected );
|
||||||
@ -395,7 +395,7 @@ namespace{
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SetDisplayMode(int theCommandID){
|
void SetDisplayMode(int theCommandID){
|
||||||
SalomeApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
|
LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
|
||||||
SALOME_ListIO selected;
|
SALOME_ListIO selected;
|
||||||
if( aSel )
|
if( aSel )
|
||||||
aSel->selectedObjects( selected );
|
aSel->selectedObjects( selected );
|
||||||
@ -518,7 +518,7 @@ namespace{
|
|||||||
|
|
||||||
void Control( int theCommandID )
|
void Control( int theCommandID )
|
||||||
{
|
{
|
||||||
SalomeApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
|
LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
|
||||||
SALOME_ListIO selected;
|
SALOME_ListIO selected;
|
||||||
if( aSel )
|
if( aSel )
|
||||||
aSel->selectedObjects( selected );
|
aSel->selectedObjects( selected );
|
||||||
@ -583,7 +583,7 @@ namespace{
|
|||||||
aControl = SMESH_Actor::eSkew;
|
aControl = SMESH_Actor::eSkew;
|
||||||
break;
|
break;
|
||||||
case 6009:
|
case 6009:
|
||||||
aTitle = QObject::tr( "VOLUME_3D_ELEMENTS" );
|
aTitle = QObject::tr( "SMESH_VOLUME" );
|
||||||
aControl = SMESH_Actor::eVolume3D;
|
aControl = SMESH_Actor::eVolume3D;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -606,7 +606,7 @@ namespace{
|
|||||||
if( !theIO.IsNull() )
|
if( !theIO.IsNull() )
|
||||||
{
|
{
|
||||||
entry = theIO->getEntry();
|
entry = theIO->getEntry();
|
||||||
SalomeApp_DataOwner owner( entry );
|
LightApp_DataOwner owner( entry );
|
||||||
if ( aTypeFilter.isOk( &owner )) {
|
if ( aTypeFilter.isOk( &owner )) {
|
||||||
theOutTypeName = theInTypeName;
|
theOutTypeName = theInTypeName;
|
||||||
return true;
|
return true;
|
||||||
@ -644,7 +644,7 @@ namespace{
|
|||||||
QString CheckHomogeneousSelection()
|
QString CheckHomogeneousSelection()
|
||||||
{
|
{
|
||||||
//SUIT_Study* aStudy = SMESH::GetActiveStudy();
|
//SUIT_Study* aStudy = SMESH::GetActiveStudy();
|
||||||
SalomeApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
|
LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
|
||||||
SALOME_ListIO selected;
|
SALOME_ListIO selected;
|
||||||
if( aSel )
|
if( aSel )
|
||||||
aSel->selectedObjects( selected );
|
aSel->selectedObjects( selected );
|
||||||
@ -666,8 +666,8 @@ namespace{
|
|||||||
void SMESHGUI::OnEditDelete()
|
void SMESHGUI::OnEditDelete()
|
||||||
{
|
{
|
||||||
// VSR 17/11/04: check if all objects selected belong to SMESH component --> start
|
// VSR 17/11/04: check if all objects selected belong to SMESH component --> start
|
||||||
SalomeApp_SelectionMgr* aSel = SMESHGUI::selectionMgr();
|
LightApp_SelectionMgr* aSel = SMESHGUI::selectionMgr();
|
||||||
SALOME_ListIO selected; aSel->selectedObjects( selected );
|
SALOME_ListIO selected; aSel->selectedObjects( selected, QString::null, false );
|
||||||
|
|
||||||
QString aParentComponent = QString::null;
|
QString aParentComponent = QString::null;
|
||||||
for( SALOME_ListIteratorOfListIO anIt( selected ); anIt.More(); anIt.Next() )
|
for( SALOME_ListIteratorOfListIO anIt( selected ); anIt.More(); anIt.Next() )
|
||||||
@ -835,11 +835,11 @@ SMESHGUI::~SMESHGUI()
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
SalomeApp_SelectionMgr* SMESHGUI::selectionMgr()
|
LightApp_SelectionMgr* SMESHGUI::selectionMgr()
|
||||||
{
|
{
|
||||||
SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
|
SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
|
||||||
if( anApp )
|
if( anApp )
|
||||||
return dynamic_cast<SalomeApp_SelectionMgr*>( anApp->selectionMgr() );
|
return dynamic_cast<LightApp_SelectionMgr*>( anApp->selectionMgr() );
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1099,7 +1099,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
|
|
||||||
case 200: // SCALAR BAR
|
case 200: // SCALAR BAR
|
||||||
{
|
{
|
||||||
SalomeApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
|
LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
|
||||||
SALOME_ListIO selected;
|
SALOME_ListIO selected;
|
||||||
if( aSel )
|
if( aSel )
|
||||||
aSel->selectedObjects( selected );
|
aSel->selectedObjects( selected );
|
||||||
@ -1146,7 +1146,8 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
SMESH::UpdateView();
|
SMESH::UpdateView();
|
||||||
|
|
||||||
SALOME_ListIO l;
|
SALOME_ListIO l;
|
||||||
SalomeApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
|
LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
|
||||||
|
aSel->selectedObjects( l );
|
||||||
aSel->setSelectedObjects( l );
|
aSel->setSelectedObjects( l );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1162,11 +1163,14 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
case 302: anAction = SMESH::eDisplayOnly; break;
|
case 302: anAction = SMESH::eDisplayOnly; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SalomeApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
|
LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
|
||||||
SALOME_ListIO sel_objects, to_process;
|
SALOME_ListIO sel_objects, to_process;
|
||||||
if (aSel)
|
if (aSel)
|
||||||
aSel->selectedObjects( sel_objects );
|
aSel->selectedObjects( sel_objects );
|
||||||
|
|
||||||
|
if( theCommandID==302 )
|
||||||
|
startOperation( myEraseAll );
|
||||||
|
|
||||||
SALOME_ListIteratorOfListIO anIt( sel_objects );
|
SALOME_ListIteratorOfListIO anIt( sel_objects );
|
||||||
for( ; anIt.More(); anIt.Next() )
|
for( ; anIt.More(); anIt.Next() )
|
||||||
{
|
{
|
||||||
@ -1267,10 +1271,11 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
case 701: // COMPUTE MESH
|
case 701: // COMPUTE MESH
|
||||||
{
|
{
|
||||||
if(checkLock(aStudy)) break;
|
if(checkLock(aStudy)) break;
|
||||||
if ( vtkwnd ) {
|
|
||||||
SalomeApp_SelectionMgr *Sel = selectionMgr();
|
LightApp_SelectionMgr *Sel = selectionMgr();
|
||||||
SALOME_ListIO selected; Sel->selectedObjects( selected );
|
SALOME_ListIO selected; Sel->selectedObjects( selected );
|
||||||
|
|
||||||
|
if ( vtkwnd ) {
|
||||||
int nbSel = selected.Extent();
|
int nbSel = selected.Extent();
|
||||||
if (nbSel != 1){
|
if (nbSel != 1){
|
||||||
break;
|
break;
|
||||||
@ -1279,7 +1284,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
SMESH::SMESH_Mesh_var aMesh;
|
SMESH::SMESH_Mesh_var aMesh;
|
||||||
SMESH::SMESH_subMesh_var aSubMesh;
|
SMESH::SMESH_subMesh_var aSubMesh;
|
||||||
Handle(SALOME_InteractiveObject) IObject = selected.First();
|
Handle(SALOME_InteractiveObject) IObject = selected.First();
|
||||||
if (IObject->hasEntry()){
|
if (IObject->hasEntry()) {
|
||||||
_PTR(SObject) aMeshSObj = aStudy->FindObjectID(IObject->getEntry());
|
_PTR(SObject) aMeshSObj = aStudy->FindObjectID(IObject->getEntry());
|
||||||
GEOM::GEOM_Object_var aShapeObject = SMESH::GetShapeOnMeshOrSubMesh( aMeshSObj );
|
GEOM::GEOM_Object_var aShapeObject = SMESH::GetShapeOnMeshOrSubMesh( aMeshSObj );
|
||||||
if ( aShapeObject->_is_nil() ) {
|
if ( aShapeObject->_is_nil() ) {
|
||||||
@ -1287,23 +1292,30 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if( aMeshSObj ) {
|
if( aMeshSObj ) {
|
||||||
SMESH::SMESH_Mesh_var aMesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>(aMeshSObj);
|
aMesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>(aMeshSObj);
|
||||||
SMESH::SMESH_subMesh_var aSubMesh = SMESH::SObjectToInterface<SMESH::SMESH_subMesh>(aMeshSObj);
|
aSubMesh = SMESH::SObjectToInterface<SMESH::SMESH_subMesh>(aMeshSObj);
|
||||||
|
if ( !aSubMesh->_is_nil() )
|
||||||
|
aMesh = aSubMesh->GetFather();
|
||||||
|
|
||||||
if (!aMesh->_is_nil()){
|
if (!aMesh->_is_nil()) {
|
||||||
GEOM::GEOM_Object_var refShapeObject = SMESH::GetShapeOnMeshOrSubMesh(aMeshSObj);
|
// if(!GetSMESHGen()->IsReadyToCompute(aMesh,aShapeObject)) {
|
||||||
if (!refShapeObject->_is_nil()) {
|
// SUIT_MessageBox::warn1(desktop(),
|
||||||
if(!GetSMESHGen()->IsReadyToCompute(aMesh,refShapeObject)){
|
// tr("SMESH_WRN_WARNING"),
|
||||||
|
// tr("SMESH_WRN_MISSING_PARAMETERS"),
|
||||||
|
// tr("SMESH_BUT_OK"));
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
SMESH::algo_error_array_var errors = GetSMESHGen()->GetAlgoState(aMesh,aShapeObject);
|
||||||
|
if ( errors->length() > 0 ) {
|
||||||
SUIT_MessageBox::warn1(desktop(),
|
SUIT_MessageBox::warn1(desktop(),
|
||||||
tr("SMESH_WRN_WARNING"),
|
tr("SMESH_WRN_WARNING"),
|
||||||
tr("SMESH_WRN_MISSING_PARAMETERS"),
|
SMESH::GetMessageOnAlgoStateErrors( errors.in() ),
|
||||||
tr("SMESH_BUT_OK"));
|
tr("SMESH_BUT_OK"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
try{
|
try{
|
||||||
if (GetSMESHGen()->Compute(aMesh,refShapeObject))
|
if (GetSMESHGen()->Compute(aMesh,aShapeObject))
|
||||||
SMESH::ModifiedMesh(aMeshSObj,true);
|
SMESH::ModifiedMesh(aMeshSObj,true);
|
||||||
// TO Do : change icon of all submeshes
|
|
||||||
else
|
else
|
||||||
SUIT_MessageBox::warn1(desktop(),
|
SUIT_MessageBox::warn1(desktop(),
|
||||||
tr("SMESH_WRN_WARNING"),
|
tr("SMESH_WRN_WARNING"),
|
||||||
@ -1314,32 +1326,6 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
SalomeApp_Tools::QtCatchCorbaException(S_ex);
|
SalomeApp_Tools::QtCatchCorbaException(S_ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else if(!aSubMesh->_is_nil()){
|
|
||||||
aMesh = aSubMesh->GetFather();
|
|
||||||
GEOM::GEOM_Object_var refShapeObject = SMESH::GetShapeOnMeshOrSubMesh(aMeshSObj);
|
|
||||||
if(!refShapeObject->_is_nil()){
|
|
||||||
bool compute = GetSMESHGen()->IsReadyToCompute(aMesh,refShapeObject);
|
|
||||||
if(!compute){
|
|
||||||
SUIT_MessageBox::warn1(desktop(),
|
|
||||||
tr("SMESH_WRN_WARNING"),
|
|
||||||
tr("SMESH_WRN_MISSING_PARAMETERS"),
|
|
||||||
tr("SMESH_BUT_OK"));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
try{
|
|
||||||
if ( GetSMESHGen()->Compute(aMesh,refShapeObject) )
|
|
||||||
SMESH::ModifiedMesh(aMeshSObj,true);
|
|
||||||
// TO Do : change icon of all submeshes
|
|
||||||
else
|
|
||||||
SUIT_MessageBox::warn1(desktop(),
|
|
||||||
tr("SMESH_WRN_WARNING"),
|
|
||||||
tr("SMESH_WRN_COMPUTE_FAILED"),
|
|
||||||
tr("SMESH_BUT_OK"));
|
|
||||||
}catch(const SALOME::SALOME_Exception & S_ex){
|
|
||||||
SalomeApp_Tools::QtCatchCorbaException(S_ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CORBA::Long anId = aStudy->StudyId();
|
CORBA::Long anId = aStudy->StudyId();
|
||||||
@ -1363,6 +1349,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
tr("SMESH_BUT_OK"));
|
tr("SMESH_BUT_OK"));
|
||||||
}
|
}
|
||||||
updateObjBrowser();
|
updateObjBrowser();
|
||||||
|
Sel->setSelectedObjects( selected );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1516,7 +1503,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
EmitSignalDeactivateDialog();
|
EmitSignalDeactivateDialog();
|
||||||
SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_nil();
|
SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_nil();
|
||||||
|
|
||||||
SalomeApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
|
LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
|
||||||
SALOME_ListIO selected;
|
SALOME_ListIO selected;
|
||||||
if( aSel )
|
if( aSel )
|
||||||
aSel->selectedObjects( selected );
|
aSel->selectedObjects( selected );
|
||||||
@ -1543,7 +1530,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
if(checkLock(aStudy)) break;
|
if(checkLock(aStudy)) break;
|
||||||
EmitSignalDeactivateDialog();
|
EmitSignalDeactivateDialog();
|
||||||
|
|
||||||
SalomeApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
|
LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
|
||||||
SALOME_ListIO selected;
|
SALOME_ListIO selected;
|
||||||
if( aSel )
|
if( aSel )
|
||||||
aSel->selectedObjects( selected );
|
aSel->selectedObjects( selected );
|
||||||
@ -1606,7 +1593,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
if(checkLock(aStudy)) break;
|
if(checkLock(aStudy)) break;
|
||||||
EmitSignalDeactivateDialog();
|
EmitSignalDeactivateDialog();
|
||||||
|
|
||||||
SalomeApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
|
LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
|
||||||
SALOME_ListIO selected;
|
SALOME_ListIO selected;
|
||||||
if( aSel )
|
if( aSel )
|
||||||
aSel->selectedObjects( selected );
|
aSel->selectedObjects( selected );
|
||||||
@ -1697,7 +1684,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
case 900: // MESH INFOS
|
case 900: // MESH INFOS
|
||||||
{
|
{
|
||||||
EmitSignalDeactivateDialog();
|
EmitSignalDeactivateDialog();
|
||||||
SalomeApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
|
LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
|
||||||
SALOME_ListIO selected;
|
SALOME_ListIO selected;
|
||||||
if( aSel )
|
if( aSel )
|
||||||
aSel->selectedObjects( selected );
|
aSel->selectedObjects( selected );
|
||||||
@ -1721,7 +1708,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
case 902: // STANDARD MESH INFOS
|
case 902: // STANDARD MESH INFOS
|
||||||
{
|
{
|
||||||
EmitSignalDeactivateDialog();
|
EmitSignalDeactivateDialog();
|
||||||
SalomeApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
|
LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
|
||||||
SALOME_ListIO selected;
|
SALOME_ListIO selected;
|
||||||
if( aSel )
|
if( aSel )
|
||||||
aSel->selectedObjects( selected );
|
aSel->selectedObjects( selected );
|
||||||
@ -1747,7 +1734,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
{
|
{
|
||||||
if(checkLock(aStudy)) break;
|
if(checkLock(aStudy)) break;
|
||||||
|
|
||||||
SalomeApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
|
LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
|
||||||
SALOME_ListIO selected;
|
SALOME_ListIO selected;
|
||||||
if( aSel )
|
if( aSel )
|
||||||
aSel->selectedObjects( selected );
|
aSel->selectedObjects( selected );
|
||||||
@ -1783,7 +1770,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
if ( checkLock( aStudy ) )
|
if ( checkLock( aStudy ) )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
SalomeApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
|
LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
|
||||||
SALOME_ListIO selected;
|
SALOME_ListIO selected;
|
||||||
if( aSel )
|
if( aSel )
|
||||||
aSel->selectedObjects( selected );
|
aSel->selectedObjects( selected );
|
||||||
@ -1801,8 +1788,10 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
{
|
{
|
||||||
aName = anAttr;
|
aName = anAttr;
|
||||||
QString newName = QString(aName->Value().c_str());
|
QString newName = QString(aName->Value().c_str());
|
||||||
newName = SalomeApp_NameDlg::getName( desktop(), newName );
|
bool ok;
|
||||||
if ( !newName.isEmpty() )
|
newName = QInputDialog::getText( tr( "Rename" ), tr( "Enter new name:" ), QLineEdit::Normal,
|
||||||
|
newName, &ok, desktop() );
|
||||||
|
if ( ok && !newName.isEmpty() )
|
||||||
{
|
{
|
||||||
//old source: aStudy->renameIObject( IObject, newName );
|
//old source: aStudy->renameIObject( IObject, newName );
|
||||||
aName->SetValue( newName.latin1() );
|
aName->SetValue( newName.latin1() );
|
||||||
@ -1826,10 +1815,10 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
if(checkLock(aStudy)) break;
|
if(checkLock(aStudy)) break;
|
||||||
SUIT_OverrideCursor wc;
|
SUIT_OverrideCursor wc;
|
||||||
|
|
||||||
SalomeApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
|
LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
|
||||||
SALOME_ListIO selected;
|
SALOME_ListIO selected;
|
||||||
if( aSel )
|
if( aSel )
|
||||||
aSel->selectedObjects( selected );
|
aSel->selectedObjects( selected, QString::null, false );
|
||||||
|
|
||||||
SALOME_ListIteratorOfListIO It(selected);
|
SALOME_ListIteratorOfListIO It(selected);
|
||||||
for (int i = 0; It.More(); It.Next(), i++) {
|
for (int i = 0; It.More(); It.Next(), i++) {
|
||||||
@ -2068,7 +2057,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
case 6009:
|
case 6009:
|
||||||
if ( vtkwnd ) {
|
if ( vtkwnd ) {
|
||||||
|
|
||||||
SalomeApp_SelectionMgr* mgr = selectionMgr();
|
LightApp_SelectionMgr* mgr = selectionMgr();
|
||||||
SALOME_ListIO selected; mgr->selectedObjects( selected );
|
SALOME_ListIO selected; mgr->selectedObjects( selected );
|
||||||
|
|
||||||
if ( selected.Extent() == 1 && selected.First()->hasEntry() ) {
|
if ( selected.Extent() == 1 && selected.First()->hasEntry() ) {
|
||||||
@ -2099,7 +2088,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
break;
|
break;
|
||||||
case 9010:
|
case 9010:
|
||||||
{
|
{
|
||||||
SalomeApp_SelectionMgr* mgr = selectionMgr();
|
LightApp_SelectionMgr* mgr = selectionMgr();
|
||||||
SALOME_ListIO selected; mgr->selectedObjects( selected );
|
SALOME_ListIO selected; mgr->selectedObjects( selected );
|
||||||
|
|
||||||
if (selected.Extent() == 1) {
|
if (selected.Extent() == 1) {
|
||||||
@ -2113,7 +2102,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
}
|
}
|
||||||
case 9011:
|
case 9011:
|
||||||
{
|
{
|
||||||
SalomeApp_SelectionMgr* mgr = selectionMgr();
|
LightApp_SelectionMgr* mgr = selectionMgr();
|
||||||
SALOME_ListIO selected; mgr->selectedObjects( selected );
|
SALOME_ListIO selected; mgr->selectedObjects( selected );
|
||||||
|
|
||||||
if (selected.Extent() == 1) {
|
if (selected.Extent() == 1) {
|
||||||
@ -2220,6 +2209,9 @@ void SMESHGUI::createPopupItem( const int id,
|
|||||||
QChar lc = QtxPopupMgr::Selection::defEquality();
|
QChar lc = QtxPopupMgr::Selection::defEquality();
|
||||||
QString rule = "(%1) and (%2) and (%3)";
|
QString rule = "(%1) and (%2) and (%3)";
|
||||||
rule = rule.arg( QString( "%1>0" ).arg( QtxPopupMgr::Selection::defSelCountParam() ) );
|
rule = rule.arg( QString( "%1>0" ).arg( QtxPopupMgr::Selection::defSelCountParam() ) );
|
||||||
|
if( clients.isEmpty() )
|
||||||
|
rule = rule.arg( QString( "true" ) );
|
||||||
|
else
|
||||||
rule = rule.arg( QString( "%1client in {%2}" ).arg( lc ).arg( clients ) );
|
rule = rule.arg( QString( "%1client in {%2}" ).arg( lc ).arg( clients ) );
|
||||||
rule = rule.arg( QString( "%1type in {%2}" ).arg( lc ).arg( types ) );
|
rule = rule.arg( QString( "%1type in {%2}" ).arg( lc ).arg( types ) );
|
||||||
rule += theRule;
|
rule += theRule;
|
||||||
@ -2559,12 +2551,14 @@ void SMESHGUI::initialize( CAM_Application* app )
|
|||||||
createPopupItem( 801, OB, mesh ); // CREATE_GROUP
|
createPopupItem( 801, OB, mesh ); // CREATE_GROUP
|
||||||
createPopupItem( 802, OB, subMesh ); // CONSTRUCT_GROUP
|
createPopupItem( 802, OB, subMesh ); // CONSTRUCT_GROUP
|
||||||
popupMgr()->insert( separator(), -1, 0 );
|
popupMgr()->insert( separator(), -1, 0 );
|
||||||
createPopupItem( 1100, OB, hypo, "&& $hasReference={false}" ); // EDIT HYPOTHESIS
|
createPopupItem( 1100, OB, hypo, "" /*"&& $hasReference={false}"*/ ); // EDIT HYPOTHESIS
|
||||||
createPopupItem( 1102, OB, hyp_alg ); // REMOVE HYPOTHESIS / ALGORITHMS
|
createPopupItem( 1102, OB, hyp_alg ); // REMOVE HYPOTHESIS / ALGORITHMS
|
||||||
createPopupItem( 1101, OB, mesh_group + " " + hyp_alg, "&& $hasReference={false}" ); // RENAME
|
createPopupItem( 1101, OB, mesh_group + " " + hyp_alg, "" /*"&& $hasReference={false}"*/ ); // RENAME
|
||||||
popupMgr()->insert( separator(), -1, 0 );
|
popupMgr()->insert( separator(), -1, 0 );
|
||||||
createPopupItem( 125, OB, mesh ); // EXPORT_MED
|
|
||||||
createPopupItem( 126, OB, mesh ); // EXPORT_UNV
|
QString only_one_non_empty = QString( " && %1=1 && numberOfNodes>0" ).arg( QtxPopupMgr::Selection::defSelCountParam() );
|
||||||
|
createPopupItem( 125, OB, mesh, only_one_non_empty ); // EXPORT_MED
|
||||||
|
createPopupItem( 126, OB, mesh, only_one_non_empty ); // EXPORT_UNV
|
||||||
createPopupItem( 33, OB, subMesh + " " + group ); // DELETE
|
createPopupItem( 33, OB, subMesh + " " + group ); // DELETE
|
||||||
popupMgr()->insert( separator(), -1, 0 );
|
popupMgr()->insert( separator(), -1, 0 );
|
||||||
|
|
||||||
@ -2818,11 +2812,16 @@ void SMESHGUI::OnGUIEvent()
|
|||||||
|
|
||||||
SMESH::SMESH_Gen_var SMESHGUI::GetSMESHGen()
|
SMESH::SMESH_Gen_var SMESHGUI::GetSMESHGen()
|
||||||
{
|
{
|
||||||
|
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); //Document OCAF de l'etude active
|
||||||
if ( CORBA::is_nil( myComponentSMESH ) )
|
if ( CORBA::is_nil( myComponentSMESH ) )
|
||||||
{
|
{
|
||||||
SMESHGUI aGUI; //SRN BugID: IPAL9186: Create an instance of SMESHGUI to initialize myComponentSMESH
|
SMESHGUI aGUI; //SRN BugID: IPAL9186: Create an instance of SMESHGUI to initialize myComponentSMESH
|
||||||
|
if ( aStudy )
|
||||||
|
aGUI.myComponentSMESH->SetCurrentStudy(_CAST(Study,aStudy)->GetStudy());
|
||||||
return aGUI.myComponentSMESH;
|
return aGUI.myComponentSMESH;
|
||||||
}
|
}
|
||||||
|
if ( aStudy )
|
||||||
|
myComponentSMESH->SetCurrentStudy(_CAST(Study,aStudy)->GetStudy());
|
||||||
return myComponentSMESH;
|
return myComponentSMESH;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2862,22 +2861,22 @@ void SMESHGUI::createPreferences()
|
|||||||
int genTab = addPreference( tr( "PREF_TAB_GENERAL" ) );
|
int genTab = addPreference( tr( "PREF_TAB_GENERAL" ) );
|
||||||
|
|
||||||
int updateGroup = addPreference( tr( "PREF_GROUP_UPDATE" ), genTab );
|
int updateGroup = addPreference( tr( "PREF_GROUP_UPDATE" ), genTab );
|
||||||
addPreference( tr( "PREF_AUTO_UPDATE" ), updateGroup, SalomeApp_Preferences::Bool, "SMESH", "auto_update" );
|
addPreference( tr( "PREF_AUTO_UPDATE" ), updateGroup, LightApp_Preferences::Bool, "SMESH", "auto_update" );
|
||||||
|
|
||||||
int qaGroup = addPreference( tr( "PREF_GROUP_QUALITY" ), genTab );
|
int qaGroup = addPreference( tr( "PREF_GROUP_QUALITY" ), genTab );
|
||||||
addPreference( tr( "PREF_DISPLAY_ENTITY" ), qaGroup, SalomeApp_Preferences::Bool, "SMESH", "display_entity" );
|
addPreference( tr( "PREF_DISPLAY_ENTITY" ), qaGroup, LightApp_Preferences::Bool, "SMESH", "display_entity" );
|
||||||
addPreference( tr( "PREF_PRECISION_USE" ), qaGroup, SalomeApp_Preferences::Bool, "SMESH", "use_precision" );
|
addPreference( tr( "PREF_PRECISION_USE" ), qaGroup, LightApp_Preferences::Bool, "SMESH", "use_precision" );
|
||||||
|
|
||||||
int precGroup = addPreference( tr( "PREF_GROUP_PRECISION" ), genTab );
|
int precGroup = addPreference( tr( "PREF_GROUP_PRECISION" ), genTab );
|
||||||
setPreferenceProperty( precGroup, "columns", 1 );
|
setPreferenceProperty( precGroup, "columns", 1 );
|
||||||
|
|
||||||
int prec = addPreference( tr( "PREF_PRECISION_VALUE" ), precGroup, SalomeApp_Preferences::IntSpin, "SMESH", "controls_precision" );
|
int prec = addPreference( tr( "PREF_PRECISION_VALUE" ), precGroup, LightApp_Preferences::IntSpin, "SMESH", "controls_precision" );
|
||||||
|
|
||||||
setPreferenceProperty( prec, "min", 0 );
|
setPreferenceProperty( prec, "min", 0 );
|
||||||
setPreferenceProperty( prec, "max", 16 );
|
setPreferenceProperty( prec, "max", 16 );
|
||||||
|
|
||||||
int dispgroup = addPreference( tr( "PREF_DISPLAY_MODE" ), genTab );
|
int dispgroup = addPreference( tr( "PREF_DISPLAY_MODE" ), genTab );
|
||||||
int dispmode = addPreference( tr( "PREF_DISPLAY_MODE" ), dispgroup, SalomeApp_Preferences::Selector, "SMESH", "display_mode" );
|
int dispmode = addPreference( tr( "PREF_DISPLAY_MODE" ), dispgroup, LightApp_Preferences::Selector, "SMESH", "display_mode" );
|
||||||
QStringList modes;
|
QStringList modes;
|
||||||
modes.append( "Wireframe" );
|
modes.append( "Wireframe" );
|
||||||
modes.append( "Shading" );
|
modes.append( "Shading" );
|
||||||
@ -2894,21 +2893,21 @@ void SMESHGUI::createPreferences()
|
|||||||
int meshTab = addPreference( tr( "PREF_TAB_MESH" ) );
|
int meshTab = addPreference( tr( "PREF_TAB_MESH" ) );
|
||||||
int nodeGroup = addPreference( tr( "PREF_GROUP_NODES" ), meshTab );
|
int nodeGroup = addPreference( tr( "PREF_GROUP_NODES" ), meshTab );
|
||||||
|
|
||||||
addPreference( tr( "PREF_COLOR" ), nodeGroup, SalomeApp_Preferences::Color, "SMESH", "node_color" );
|
addPreference( tr( "PREF_COLOR" ), nodeGroup, LightApp_Preferences::Color, "SMESH", "node_color" );
|
||||||
int nodeSz = addPreference( tr( "PREF_SIZE" ), nodeGroup, SalomeApp_Preferences::IntSpin, "SMESH", "node_size" );
|
int nodeSz = addPreference( tr( "PREF_SIZE" ), nodeGroup, LightApp_Preferences::IntSpin, "SMESH", "node_size" );
|
||||||
|
|
||||||
setPreferenceProperty( nodeSz, "min", 1 );
|
setPreferenceProperty( nodeSz, "min", 1 );
|
||||||
setPreferenceProperty( nodeSz, "max", 5 );
|
setPreferenceProperty( nodeSz, "max", 5 );
|
||||||
|
|
||||||
int elemGroup = addPreference( tr( "PREF_GROUP_ELEMENTS" ), meshTab );
|
int elemGroup = addPreference( tr( "PREF_GROUP_ELEMENTS" ), meshTab );
|
||||||
|
|
||||||
addPreference( tr( "PREF_FILL" ), elemGroup, SalomeApp_Preferences::Color, "SMESH", "fill_color" );
|
addPreference( tr( "PREF_FILL" ), elemGroup, LightApp_Preferences::Color, "SMESH", "fill_color" );
|
||||||
addPreference( tr( "PREF_OUTLINE" ), elemGroup, SalomeApp_Preferences::Color, "SMESH", "outline_color" );
|
addPreference( tr( "PREF_OUTLINE" ), elemGroup, LightApp_Preferences::Color, "SMESH", "outline_color" );
|
||||||
addPreference( tr( "PREF_BACKFACE" ), elemGroup, SalomeApp_Preferences::Color, "SMESH", "backface_color" );
|
addPreference( tr( "PREF_BACKFACE" ), elemGroup, LightApp_Preferences::Color, "SMESH", "backface_color" );
|
||||||
addPreference( "", elemGroup, SalomeApp_Preferences::Space );
|
addPreference( "", elemGroup, LightApp_Preferences::Space );
|
||||||
|
|
||||||
int elemW = addPreference( tr( "PREF_WIDTH" ), elemGroup, SalomeApp_Preferences::IntSpin, "SMESH", "element_width" );
|
int elemW = addPreference( tr( "PREF_WIDTH" ), elemGroup, LightApp_Preferences::IntSpin, "SMESH", "element_width" );
|
||||||
int shrink = addPreference( tr( "PREF_SHRINK_COEFF" ), elemGroup, SalomeApp_Preferences::IntSpin, "SMESH", "shrink_coeff" );
|
int shrink = addPreference( tr( "PREF_SHRINK_COEFF" ), elemGroup, LightApp_Preferences::IntSpin, "SMESH", "shrink_coeff" );
|
||||||
|
|
||||||
setPreferenceProperty( elemW, "min", 1 );
|
setPreferenceProperty( elemW, "min", 1 );
|
||||||
setPreferenceProperty( elemW, "max", 5 );
|
setPreferenceProperty( elemW, "max", 5 );
|
||||||
@ -2920,33 +2919,33 @@ void SMESHGUI::createPreferences()
|
|||||||
|
|
||||||
int selGroup = addPreference( tr( "PREF_GROUP_SELECTION" ), selTab );
|
int selGroup = addPreference( tr( "PREF_GROUP_SELECTION" ), selTab );
|
||||||
|
|
||||||
addPreference( tr( "PREF_OBJECT_COLOR" ), selGroup, SalomeApp_Preferences::Color, "SMESH", "selection_object_color" );
|
addPreference( tr( "PREF_OBJECT_COLOR" ), selGroup, LightApp_Preferences::Color, "SMESH", "selection_object_color" );
|
||||||
addPreference( tr( "PREF_ELEMENT_COLOR" ), selGroup, SalomeApp_Preferences::Color, "SMESH", "selection_element_color" );
|
addPreference( tr( "PREF_ELEMENT_COLOR" ), selGroup, LightApp_Preferences::Color, "SMESH", "selection_element_color" );
|
||||||
int selW = addPreference( tr( "PREF_WIDTH" ), selGroup, SalomeApp_Preferences::IntSpin, "SMESH", "selection_width" );
|
int selW = addPreference( tr( "PREF_WIDTH" ), selGroup, LightApp_Preferences::IntSpin, "SMESH", "selection_width" );
|
||||||
|
|
||||||
setPreferenceProperty( selW, "min", 1 );
|
setPreferenceProperty( selW, "min", 1 );
|
||||||
setPreferenceProperty( selW, "max", 5 );
|
setPreferenceProperty( selW, "max", 5 );
|
||||||
|
|
||||||
int preGroup = addPreference( tr( "PREF_GROUP_PRESELECTION" ), selTab );
|
int preGroup = addPreference( tr( "PREF_GROUP_PRESELECTION" ), selTab );
|
||||||
|
|
||||||
addPreference( tr( "PREF_HIGHLIGHT_COLOR" ), preGroup, SalomeApp_Preferences::Color, "SMESH", "highlight_color" );
|
addPreference( tr( "PREF_HIGHLIGHT_COLOR" ), preGroup, LightApp_Preferences::Color, "SMESH", "highlight_color" );
|
||||||
int preW = addPreference( tr( "PREF_WIDTH" ), preGroup, SalomeApp_Preferences::IntSpin, "SMESH", "highlight_width" );
|
int preW = addPreference( tr( "PREF_WIDTH" ), preGroup, LightApp_Preferences::IntSpin, "SMESH", "highlight_width" );
|
||||||
|
|
||||||
setPreferenceProperty( preW, "min", 1 );
|
setPreferenceProperty( preW, "min", 1 );
|
||||||
setPreferenceProperty( preW, "max", 5 );
|
setPreferenceProperty( preW, "max", 5 );
|
||||||
|
|
||||||
int precSelGroup = addPreference( tr( "PREF_GROUP_PRECISION" ), selTab );
|
int precSelGroup = addPreference( tr( "PREF_GROUP_PRECISION" ), selTab );
|
||||||
|
|
||||||
addPreference( tr( "PREF_NODES" ), precSelGroup, SalomeApp_Preferences::Double, "SMESH", "selection_precision_node" );
|
addPreference( tr( "PREF_NODES" ), precSelGroup, LightApp_Preferences::Double, "SMESH", "selection_precision_node" );
|
||||||
addPreference( tr( "PREF_ELEMENTS" ), precSelGroup, SalomeApp_Preferences::Double, "SMESH", "selection_precision_element" );
|
addPreference( tr( "PREF_ELEMENTS" ), precSelGroup, LightApp_Preferences::Double, "SMESH", "selection_precision_element" );
|
||||||
|
|
||||||
int sbarTab = addPreference( tr( "SMESH_SCALARBAR" ) );
|
int sbarTab = addPreference( tr( "SMESH_SCALARBAR" ) );
|
||||||
int fontGr = addPreference( tr( "SMESH_FONT_SCALARBAR" ), sbarTab );
|
int fontGr = addPreference( tr( "SMESH_FONT_SCALARBAR" ), sbarTab );
|
||||||
|
|
||||||
int tfont = addPreference( tr( "SMESH_TITLE" ), fontGr, SalomeApp_Preferences::Font, "SMESH", "scalar_bar_title_font" );
|
int tfont = addPreference( tr( "SMESH_TITLE" ), fontGr, LightApp_Preferences::Font, "SMESH", "scalar_bar_title_font" );
|
||||||
addPreference( tr( "SMESH_TITLE" ), fontGr, SalomeApp_Preferences::Color, "SMESH", "scalar_bar_title_color" );
|
addPreference( tr( "SMESH_TITLE" ), fontGr, LightApp_Preferences::Color, "SMESH", "scalar_bar_title_color" );
|
||||||
int lfont = addPreference( tr( "SMESH_LABELS" ), fontGr, SalomeApp_Preferences::Font, "SMESH", "scalar_bar_label_font" );
|
int lfont = addPreference( tr( "SMESH_LABELS" ), fontGr, LightApp_Preferences::Font, "SMESH", "scalar_bar_label_font" );
|
||||||
addPreference( tr( "SMESH_LABELS" ), fontGr, SalomeApp_Preferences::Color, "SMESH", "scalar_bar_label_color" );
|
addPreference( tr( "SMESH_LABELS" ), fontGr, LightApp_Preferences::Color, "SMESH", "scalar_bar_label_color" );
|
||||||
|
|
||||||
QStringList fam;
|
QStringList fam;
|
||||||
fam.append( tr( "SMESH_FONT_ARIAL" ) );
|
fam.append( tr( "SMESH_FONT_ARIAL" ) );
|
||||||
@ -2963,16 +2962,16 @@ void SMESHGUI::createPreferences()
|
|||||||
|
|
||||||
int colorsLabelsGr = addPreference( tr( "SMESH_LABELS_COLORS_SCALARBAR" ), sbarTab );
|
int colorsLabelsGr = addPreference( tr( "SMESH_LABELS_COLORS_SCALARBAR" ), sbarTab );
|
||||||
|
|
||||||
int numcol = addPreference( tr( "SMESH_NUMBEROFCOLORS" ), colorsLabelsGr, SalomeApp_Preferences::IntSpin, "SMESH", "scalar_bar_num_colors" );
|
int numcol = addPreference( tr( "SMESH_NUMBEROFCOLORS" ), colorsLabelsGr, LightApp_Preferences::IntSpin, "SMESH", "scalar_bar_num_colors" );
|
||||||
setPreferenceProperty( numcol, "min", 2 );
|
setPreferenceProperty( numcol, "min", 2 );
|
||||||
setPreferenceProperty( numcol, "max", 256 );
|
setPreferenceProperty( numcol, "max", 256 );
|
||||||
|
|
||||||
int numlab = addPreference( tr( "SMESH_NUMBEROFLABELS" ), colorsLabelsGr, SalomeApp_Preferences::IntSpin, "SMESH", "scalar_bar_num_labels" );
|
int numlab = addPreference( tr( "SMESH_NUMBEROFLABELS" ), colorsLabelsGr, LightApp_Preferences::IntSpin, "SMESH", "scalar_bar_num_labels" );
|
||||||
setPreferenceProperty( numlab, "min", 2 );
|
setPreferenceProperty( numlab, "min", 2 );
|
||||||
setPreferenceProperty( numlab, "max", 65 );
|
setPreferenceProperty( numlab, "max", 65 );
|
||||||
|
|
||||||
int orientGr = addPreference( tr( "SMESH_ORIENTATION" ), sbarTab );
|
int orientGr = addPreference( tr( "SMESH_ORIENTATION" ), sbarTab );
|
||||||
int orient = addPreference( tr( "SMESH_ORIENTATION" ), orientGr, SalomeApp_Preferences::Selector, "SMESH", "scalar_bar_orientation" );
|
int orient = addPreference( tr( "SMESH_ORIENTATION" ), orientGr, LightApp_Preferences::Selector, "SMESH", "scalar_bar_orientation" );
|
||||||
QStringList orients;
|
QStringList orients;
|
||||||
orients.append( tr( "SMESH_VERTICAL" ) );
|
orients.append( tr( "SMESH_VERTICAL" ) );
|
||||||
orients.append( tr( "SMESH_HORIZONTAL" ) );
|
orients.append( tr( "SMESH_HORIZONTAL" ) );
|
||||||
@ -2981,10 +2980,10 @@ void SMESHGUI::createPreferences()
|
|||||||
setPreferenceProperty( orient, "indexes", indices );
|
setPreferenceProperty( orient, "indexes", indices );
|
||||||
|
|
||||||
int posVSizeGr = addPreference( tr( "SMESH_POSITION_SIZE_SCALARBAR" ) + " " + tr( "SMESH_VERTICAL" ), sbarTab );
|
int posVSizeGr = addPreference( tr( "SMESH_POSITION_SIZE_SCALARBAR" ) + " " + tr( "SMESH_VERTICAL" ), sbarTab );
|
||||||
int xv = addPreference( tr( "SMESH_X_SCALARBAR" ), posVSizeGr, SalomeApp_Preferences::DblSpin, "SMESH", "scalar_bar_vertical_x" );
|
int xv = addPreference( tr( "SMESH_X_SCALARBAR" ), posVSizeGr, LightApp_Preferences::DblSpin, "SMESH", "scalar_bar_vertical_x" );
|
||||||
int yv = addPreference( tr( "SMESH_Y_SCALARBAR" ), posVSizeGr, SalomeApp_Preferences::DblSpin, "SMESH", "scalar_bar_vertical_y" );
|
int yv = addPreference( tr( "SMESH_Y_SCALARBAR" ), posVSizeGr, LightApp_Preferences::DblSpin, "SMESH", "scalar_bar_vertical_y" );
|
||||||
int wv = addPreference( tr( "SMESH_WIDTH" ), posVSizeGr, SalomeApp_Preferences::DblSpin, "SMESH", "scalar_bar_vertical_width" );
|
int wv = addPreference( tr( "SMESH_WIDTH" ), posVSizeGr, LightApp_Preferences::DblSpin, "SMESH", "scalar_bar_vertical_width" );
|
||||||
int hv = addPreference( tr( "SMESH_HEIGHT" ), posVSizeGr, SalomeApp_Preferences::DblSpin, "SMESH", "scalar_bar_vertical_height" );
|
int hv = addPreference( tr( "SMESH_HEIGHT" ), posVSizeGr, LightApp_Preferences::DblSpin, "SMESH", "scalar_bar_vertical_height" );
|
||||||
setPreferenceProperty( xv, "step", 0.1 );
|
setPreferenceProperty( xv, "step", 0.1 );
|
||||||
setPreferenceProperty( xv, "min", 0.0 );
|
setPreferenceProperty( xv, "min", 0.0 );
|
||||||
setPreferenceProperty( xv, "max", 1.0 );
|
setPreferenceProperty( xv, "max", 1.0 );
|
||||||
@ -2999,10 +2998,10 @@ void SMESHGUI::createPreferences()
|
|||||||
setPreferenceProperty( hv, "step", 0.1 );
|
setPreferenceProperty( hv, "step", 0.1 );
|
||||||
|
|
||||||
int posHSizeGr = addPreference( tr( "SMESH_POSITION_SIZE_SCALARBAR" ) + " " + tr( "SMESH_HORIZONTAL" ), sbarTab );
|
int posHSizeGr = addPreference( tr( "SMESH_POSITION_SIZE_SCALARBAR" ) + " " + tr( "SMESH_HORIZONTAL" ), sbarTab );
|
||||||
int xh = addPreference( tr( "SMESH_X_SCALARBAR" ), posHSizeGr, SalomeApp_Preferences::DblSpin, "SMESH", "scalar_bar_horizontal_x" );
|
int xh = addPreference( tr( "SMESH_X_SCALARBAR" ), posHSizeGr, LightApp_Preferences::DblSpin, "SMESH", "scalar_bar_horizontal_x" );
|
||||||
int yh = addPreference( tr( "SMESH_Y_SCALARBAR" ), posHSizeGr, SalomeApp_Preferences::DblSpin, "SMESH", "scalar_bar_horizontal_y" );
|
int yh = addPreference( tr( "SMESH_Y_SCALARBAR" ), posHSizeGr, LightApp_Preferences::DblSpin, "SMESH", "scalar_bar_horizontal_y" );
|
||||||
int wh = addPreference( tr( "SMESH_WIDTH" ), posHSizeGr, SalomeApp_Preferences::DblSpin, "SMESH", "scalar_bar_horizontal_width" );
|
int wh = addPreference( tr( "SMESH_WIDTH" ), posHSizeGr, LightApp_Preferences::DblSpin, "SMESH", "scalar_bar_horizontal_width" );
|
||||||
int hh = addPreference( tr( "SMESH_HEIGHT" ), posHSizeGr, SalomeApp_Preferences::DblSpin, "SMESH", "scalar_bar_horizontal_height" );
|
int hh = addPreference( tr( "SMESH_HEIGHT" ), posHSizeGr, LightApp_Preferences::DblSpin, "SMESH", "scalar_bar_horizontal_height" );
|
||||||
setPreferenceProperty( xv, "min", 0.0 );
|
setPreferenceProperty( xv, "min", 0.0 );
|
||||||
setPreferenceProperty( xv, "max", 1.0 );
|
setPreferenceProperty( xv, "max", 1.0 );
|
||||||
setPreferenceProperty( xv, "step", 0.1 );
|
setPreferenceProperty( xv, "step", 0.1 );
|
||||||
@ -3035,7 +3034,7 @@ void SMESHGUI::preferencesChanged( const QString& sect, const QString& name )
|
|||||||
* \param theFlags - update flags
|
* \param theFlags - update flags
|
||||||
*
|
*
|
||||||
* Update viewer or/and object browser etc. in accordance with update flags ( see
|
* Update viewer or/and object browser etc. in accordance with update flags ( see
|
||||||
* SalomeApp_UpdateFlags enumeration ).
|
* LightApp_UpdateFlags enumeration ).
|
||||||
*/
|
*/
|
||||||
//================================================================================
|
//================================================================================
|
||||||
void SMESHGUI::update( const int flags )
|
void SMESHGUI::update( const int flags )
|
||||||
@ -3086,9 +3085,9 @@ void SMESHGUI::onOperationAborted( SUIT_Operation* )
|
|||||||
* It is called called automatically from startOperation method of base class.
|
* It is called called automatically from startOperation method of base class.
|
||||||
*/
|
*/
|
||||||
//================================================================================
|
//================================================================================
|
||||||
SalomeApp_Operation* SMESHGUI::createOperation( const int id ) const
|
LightApp_Operation* SMESHGUI::createOperation( const int id ) const
|
||||||
{
|
{
|
||||||
SalomeApp_Operation* op = 0;
|
LightApp_Operation* op = 0;
|
||||||
// to do : create operation here
|
// to do : create operation here
|
||||||
switch( id )
|
switch( id )
|
||||||
{
|
{
|
||||||
@ -3110,9 +3109,9 @@ SalomeApp_Operation* SMESHGUI::createOperation( const int id ) const
|
|||||||
return op;
|
return op;
|
||||||
}
|
}
|
||||||
|
|
||||||
SalomeApp_Displayer* SMESHGUI::displayer()
|
LightApp_Displayer* SMESHGUI::displayer()
|
||||||
{
|
{
|
||||||
if( !myDisplayer )
|
if( !myDisplayer )
|
||||||
myDisplayer = new SMESHGUI_Displayer( dynamic_cast<SalomeApp_Study*>( getApp()->activeStudy() ) );
|
myDisplayer = new SMESHGUI_Displayer( getApp() );
|
||||||
return myDisplayer;
|
return myDisplayer;
|
||||||
}
|
}
|
||||||
|
@ -790,7 +790,11 @@ void SMESHGUI_FilterTable::GetCriterion (const int theRow,
|
|||||||
theCriterion.Threshold = aTable->item(theRow, 2)->text().toDouble();
|
theCriterion.Threshold = aTable->item(theRow, 2)->text().toDouble();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
theCriterion.ThresholdStr = aTable->text(theRow, 2).latin1();
|
theCriterion.ThresholdStr = aTable->text(theRow, 2).latin1();
|
||||||
|
if ( aCriterionType != FT_RangeOfIds )
|
||||||
|
theCriterion.ThresholdID = aTable->text( theRow, 5 ).latin1();
|
||||||
|
}
|
||||||
|
|
||||||
QTableItem* anItem = aTable->item(theRow, 0);
|
QTableItem* anItem = aTable->item(theRow, 0);
|
||||||
if (myAddWidgets.contains(anItem))
|
if (myAddWidgets.contains(anItem))
|
||||||
@ -833,7 +837,11 @@ void SMESHGUI_FilterTable::SetCriterion (const int theRow,
|
|||||||
theCriterion.Type != FT_LyingOnGeom)
|
theCriterion.Type != FT_LyingOnGeom)
|
||||||
aTable->setText(theRow, 2, QString("%1").arg(theCriterion.Threshold, 0, 'g', 15));
|
aTable->setText(theRow, 2, QString("%1").arg(theCriterion.Threshold, 0, 'g', 15));
|
||||||
else
|
else
|
||||||
|
{
|
||||||
aTable->setText(theRow, 2, QString(theCriterion.ThresholdStr));
|
aTable->setText(theRow, 2, QString(theCriterion.ThresholdStr));
|
||||||
|
if ( theCriterion.Type != FT_RangeOfIds )
|
||||||
|
aTable->setText( theRow, 5, QString( theCriterion.ThresholdID ) );
|
||||||
|
}
|
||||||
|
|
||||||
if (theCriterion.Compare == FT_EqualTo ||
|
if (theCriterion.Compare == FT_EqualTo ||
|
||||||
theCriterion.Type == FT_BelongToPlane ||
|
theCriterion.Type == FT_BelongToPlane ||
|
||||||
@ -1314,6 +1322,7 @@ const QMap<int, QString>& SMESHGUI_FilterTable::getCriteria (const int theType)
|
|||||||
aCriteria[ SMESH::FT_BelongToGeom ] = tr("BELONG_TO_GEOM");
|
aCriteria[ SMESH::FT_BelongToGeom ] = tr("BELONG_TO_GEOM");
|
||||||
aCriteria[ SMESH::FT_LyingOnGeom ] = tr("LYING_ON_GEOM");
|
aCriteria[ SMESH::FT_LyingOnGeom ] = tr("LYING_ON_GEOM");
|
||||||
aCriteria[ SMESH::FT_BadOrientedVolume ] = tr("BAD_ORIENTED_VOLUME");
|
aCriteria[ SMESH::FT_BadOrientedVolume ] = tr("BAD_ORIENTED_VOLUME");
|
||||||
|
aCriteria[ SMESH::FT_Volume3D ] = tr("VOLUME_3D");
|
||||||
}
|
}
|
||||||
return aCriteria;
|
return aCriteria;
|
||||||
}
|
}
|
||||||
@ -1351,7 +1360,7 @@ SMESHGUI_FilterTable::Table* SMESHGUI_FilterTable::createTable (QWidget* thePar
|
|||||||
const int theType)
|
const int theType)
|
||||||
{
|
{
|
||||||
// create table
|
// create table
|
||||||
Table* aTable= new Table(0, 5, theParent);
|
Table* aTable= new Table(0, 6, theParent);
|
||||||
|
|
||||||
QHeader* aHeaders = aTable->horizontalHeader();
|
QHeader* aHeaders = aTable->horizontalHeader();
|
||||||
|
|
||||||
@ -1382,11 +1391,15 @@ SMESHGUI_FilterTable::Table* SMESHGUI_FilterTable::createTable (QWidget* thePar
|
|||||||
aHeaders->setLabel(2, tr("THRESHOLD_VALUE"));
|
aHeaders->setLabel(2, tr("THRESHOLD_VALUE"));
|
||||||
aHeaders->setLabel(3, tr("UNARY"));
|
aHeaders->setLabel(3, tr("UNARY"));
|
||||||
aHeaders->setLabel(4, tr("BINARY") + " ");
|
aHeaders->setLabel(4, tr("BINARY") + " ");
|
||||||
|
aHeaders->setLabel( 5, tr( "ID" ) );
|
||||||
|
|
||||||
// set geometry of the table
|
// set geometry of the table
|
||||||
for (int i = 0; i <= 4; i++)
|
for (int i = 0; i <= 4; i++)
|
||||||
aTable->adjustColumn(i);
|
aTable->adjustColumn(i);
|
||||||
|
|
||||||
|
// set the ID column invisible
|
||||||
|
aTable->hideColumn( 5 );
|
||||||
|
|
||||||
aTable->updateGeometry();
|
aTable->updateGeometry();
|
||||||
QSize aSize = aTable->sizeHint();
|
QSize aSize = aTable->sizeHint();
|
||||||
int aWidth = aSize.width();
|
int aWidth = aSize.width();
|
||||||
@ -1588,6 +1601,37 @@ bool SMESHGUI_FilterTable::GetThreshold (const int theRow,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
// name : SMESHGUI_FilterTable::SetID
|
||||||
|
// Purpose : Set text and internal value in cell of ID value
|
||||||
|
//=======================================================================
|
||||||
|
void SMESHGUI_FilterTable::SetID( const int theRow,
|
||||||
|
const QString& theText,
|
||||||
|
const int theEntityType )
|
||||||
|
{
|
||||||
|
Table* aTable = myTables[ theEntityType == -1 ? GetType() : theEntityType ];
|
||||||
|
aTable->setText( theRow, 5, theText );
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
// name : SMESHGUI_FilterTable::GetID
|
||||||
|
// Purpose : Get text and internal value from cell of ID value
|
||||||
|
//=======================================================================
|
||||||
|
bool SMESHGUI_FilterTable::GetID( const int theRow,
|
||||||
|
QString& theText,
|
||||||
|
const int theEntityType )
|
||||||
|
{
|
||||||
|
Table* aTable = myTables[ theEntityType == -1 ? GetType() : theEntityType ];
|
||||||
|
QTableItem* anItem = aTable->item( theRow, 5 );
|
||||||
|
if ( anItem != 0 )
|
||||||
|
{
|
||||||
|
theText = anItem->text();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Class : SMESHGUI_FilterDlg
|
Class : SMESHGUI_FilterDlg
|
||||||
Description : Dialog to specify filters for VTK viewer
|
Description : Dialog to specify filters for VTK viewer
|
||||||
@ -2424,6 +2468,7 @@ SMESH::Filter::Criterion SMESHGUI_FilterDlg::createCriterion()
|
|||||||
aCriterion.UnaryOp = FT_Undefined;
|
aCriterion.UnaryOp = FT_Undefined;
|
||||||
aCriterion.BinaryOp = FT_Undefined;
|
aCriterion.BinaryOp = FT_Undefined;
|
||||||
aCriterion.ThresholdStr = "";
|
aCriterion.ThresholdStr = "";
|
||||||
|
aCriterion.ThresholdID = "";
|
||||||
aCriterion.TypeOfElement = SMESH::ALL;
|
aCriterion.TypeOfElement = SMESH::ALL;
|
||||||
|
|
||||||
return aCriterion;
|
return aCriterion;
|
||||||
@ -2451,7 +2496,10 @@ void SMESHGUI_FilterDlg::onSelectionDone()
|
|||||||
Handle(SALOME_InteractiveObject) anIO = aList.First();
|
Handle(SALOME_InteractiveObject) anIO = aList.First();
|
||||||
GEOM::GEOM_Object_var anObj = SMESH::IObjectToInterface<GEOM::GEOM_Object>(anIO);
|
GEOM::GEOM_Object_var anObj = SMESH::IObjectToInterface<GEOM::GEOM_Object>(anIO);
|
||||||
if (!anObj->_is_nil())
|
if (!anObj->_is_nil())
|
||||||
|
{
|
||||||
myTable->SetThreshold(aRow, GEOMBase::GetName(anObj));
|
myTable->SetThreshold(aRow, GEOMBase::GetName(anObj));
|
||||||
|
myTable->SetID( aRow, GEOMBase::GetIORFromObject(anObj));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
@ -537,7 +537,7 @@ void SMESHGUI_GroupDlg::setSelectionMode (int theMode)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (mySelectionMode != theMode) {
|
if (mySelectionMode != theMode) {
|
||||||
mySelectionMgr->clearSelected();
|
// [PAL10408] mySelectionMgr->clearSelected();
|
||||||
mySelectionMgr->clearFilters();
|
mySelectionMgr->clearFilters();
|
||||||
SMESH::SetPointRepresentation(false);
|
SMESH::SetPointRepresentation(false);
|
||||||
if (theMode < 4) {
|
if (theMode < 4) {
|
||||||
@ -842,7 +842,7 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
|
|||||||
aGroupMainShape = GEOM::GEOM_Object::_duplicate(myGeomGroup);
|
aGroupMainShape = GEOM::GEOM_Object::_duplicate(myGeomGroup);
|
||||||
_PTR(SObject) aGroupMainShapeSO =
|
_PTR(SObject) aGroupMainShapeSO =
|
||||||
//aStudy->FindObjectIOR(aStudy->ConvertObjectToIOR(aGroupMainShape));
|
//aStudy->FindObjectIOR(aStudy->ConvertObjectToIOR(aGroupMainShape));
|
||||||
aStudy->FindObjectIOR(aGroupMainShape->GetStudyEntry());
|
aStudy->FindObjectID(aGroupMainShape->GetStudyEntry());
|
||||||
|
|
||||||
// The mesh SObject
|
// The mesh SObject
|
||||||
_PTR(SObject) aMeshSO = SMESH::FindSObject(myMesh);
|
_PTR(SObject) aMeshSO = SMESH::FindSObject(myMesh);
|
||||||
@ -1222,7 +1222,7 @@ void SMESHGUI_GroupDlg::onAdd()
|
|||||||
if (aGroupType == aType) {
|
if (aGroupType == aType) {
|
||||||
_PTR(SObject) aGroupSO =
|
_PTR(SObject) aGroupSO =
|
||||||
//aStudy->FindObjectIOR(aStudy->ConvertObjectToIOR(myGeomGroup));
|
//aStudy->FindObjectIOR(aStudy->ConvertObjectToIOR(myGeomGroup));
|
||||||
aStudy->FindObjectIOR(myGeomGroup->GetStudyEntry());
|
aStudy->FindObjectID(myGeomGroup->GetStudyEntry());
|
||||||
// Construct filter
|
// Construct filter
|
||||||
SMESH::FilterManager_var aFilterMgr = SMESH::GetFilterManager();
|
SMESH::FilterManager_var aFilterMgr = SMESH::GetFilterManager();
|
||||||
SMESH::Filter_var aFilter = aFilterMgr->CreateFilter();
|
SMESH::Filter_var aFilter = aFilterMgr->CreateFilter();
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
#include "SUIT_ResourceMgr.h"
|
#include "SUIT_ResourceMgr.h"
|
||||||
#include "SUIT_Desktop.h"
|
#include "SUIT_Desktop.h"
|
||||||
|
|
||||||
#include "SalomeApp_SelectionMgr.h"
|
#include "LightApp_SelectionMgr.h"
|
||||||
#include "SALOME_ListIO.hxx"
|
#include "SALOME_ListIO.hxx"
|
||||||
#include "SALOME_ListIteratorOfListIO.hxx"
|
#include "SALOME_ListIteratorOfListIO.hxx"
|
||||||
|
|
||||||
@ -437,7 +437,7 @@ void SMESHGUI_MultiEditDlg::onClose()
|
|||||||
SMESH::RemoveFilters();
|
SMESH::RemoveFilters();
|
||||||
SMESH::SetPickable();
|
SMESH::SetPickable();
|
||||||
|
|
||||||
mySelectionMgr->clearSelected();
|
//mySelectionMgr->clearSelected();
|
||||||
mySelectionMgr->clearFilters();
|
mySelectionMgr->clearFilters();
|
||||||
|
|
||||||
reject();
|
reject();
|
||||||
@ -941,7 +941,7 @@ bool SMESHGUI_MultiEditDlg::onApply()
|
|||||||
bool aResult = process(aMeshEditor, anIds.inout());
|
bool aResult = process(aMeshEditor, anIds.inout());
|
||||||
if (aResult) {
|
if (aResult) {
|
||||||
if (myActor) {
|
if (myActor) {
|
||||||
mySelectionMgr->clearSelected();
|
//mySelectionMgr->clearSelected();
|
||||||
SMESH::UpdateView();
|
SMESH::UpdateView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -286,7 +286,7 @@ void SMESHGUI_RemoveElementsDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void SMESHGUI_RemoveElementsDlg::ClickOnCancel()
|
void SMESHGUI_RemoveElementsDlg::ClickOnCancel()
|
||||||
{
|
{
|
||||||
mySelectionMgr->clearSelected();
|
//mySelectionMgr->clearSelected();
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(ActorSelection);
|
aViewWindow->SetSelectionMode(ActorSelection);
|
||||||
disconnect(mySelectionMgr, 0, this, 0);
|
disconnect(mySelectionMgr, 0, this, 0);
|
||||||
|
@ -289,7 +289,7 @@ void SMESHGUI_RemoveNodesDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void SMESHGUI_RemoveNodesDlg::ClickOnCancel()
|
void SMESHGUI_RemoveNodesDlg::ClickOnCancel()
|
||||||
{
|
{
|
||||||
mySelectionMgr->clearSelected();
|
//mySelectionMgr->clearSelected();
|
||||||
SMESH::SetPointRepresentation(false);
|
SMESH::SetPointRepresentation(false);
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(ActorSelection);
|
aViewWindow->SetSelectionMode(ActorSelection);
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
#include "SMESH_Type.h"
|
#include "SMESH_Type.h"
|
||||||
#include "SMESH_Actor.h"
|
#include "SMESH_Actor.h"
|
||||||
|
|
||||||
#include "SalomeApp_SelectionMgr.h"
|
#include "LightApp_SelectionMgr.h"
|
||||||
#include "SalomeApp_Study.h"
|
#include "SalomeApp_Study.h"
|
||||||
#include "SalomeApp_VTKSelector.h"
|
#include "LightApp_VTKSelector.h"
|
||||||
|
|
||||||
#include "SUIT_Session.h"
|
#include "SUIT_Session.h"
|
||||||
|
|
||||||
@ -25,7 +25,7 @@
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
SMESHGUI_Selection::SMESHGUI_Selection()
|
SMESHGUI_Selection::SMESHGUI_Selection()
|
||||||
: SalomeApp_Selection()
|
: LightApp_Selection()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,13 +41,16 @@ SMESHGUI_Selection::~SMESHGUI_Selection()
|
|||||||
//function : init
|
//function : init
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void SMESHGUI_Selection::init( const QString& client, SalomeApp_SelectionMgr* mgr )
|
void SMESHGUI_Selection::init( const QString& client, LightApp_SelectionMgr* mgr )
|
||||||
{
|
{
|
||||||
SalomeApp_Selection::init( client, mgr );
|
LightApp_Selection::init( client, mgr );
|
||||||
|
|
||||||
if( mgr && study() )
|
if( mgr && study() )
|
||||||
{
|
{
|
||||||
_PTR(Study) aStudy = study()->studyDS();
|
SalomeApp_Study* aSStudy = dynamic_cast<SalomeApp_Study*>(study());
|
||||||
|
if (!aSStudy)
|
||||||
|
return;
|
||||||
|
_PTR(Study) aStudy = aSStudy->studyDS();
|
||||||
|
|
||||||
for( int i=0, n=count(); i<n; i++ )
|
for( int i=0, n=count(); i<n; i++ )
|
||||||
myTypes.append( typeName( type( entry( i ), aStudy ) ) );
|
myTypes.append( typeName( type( entry( i ), aStudy ) ) );
|
||||||
@ -58,10 +61,10 @@ void SMESHGUI_Selection::init( const QString& client, SalomeApp_SelectionMgr* mg
|
|||||||
//function : processOwner
|
//function : processOwner
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void SMESHGUI_Selection::processOwner( const SalomeApp_DataOwner* ow )
|
void SMESHGUI_Selection::processOwner( const LightApp_DataOwner* ow )
|
||||||
{
|
{
|
||||||
const SalomeApp_SVTKDataOwner* owner =
|
const LightApp_SVTKDataOwner* owner =
|
||||||
dynamic_cast<const SalomeApp_SVTKDataOwner*> ( ow );
|
dynamic_cast<const LightApp_SVTKDataOwner*> ( ow );
|
||||||
if( owner )
|
if( owner )
|
||||||
myActors.append( dynamic_cast<SMESH_Actor*>( owner->GetActor() ) );
|
myActors.append( dynamic_cast<SMESH_Actor*>( owner->GetActor() ) );
|
||||||
else
|
else
|
||||||
@ -95,7 +98,7 @@ QtxValue SMESHGUI_Selection::param( const int ind, const QString& p ) const
|
|||||||
if( val.isValid() )
|
if( val.isValid() )
|
||||||
return val;
|
return val;
|
||||||
else
|
else
|
||||||
return SalomeApp_Selection::param( ind, p );
|
return LightApp_Selection::param( ind, p );
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -267,7 +270,7 @@ QVariant SMESHGUI_Selection::isComputable( int ind ) const
|
|||||||
if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
|
if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
|
||||||
{
|
{
|
||||||
/* Handle(SALOME_InteractiveObject) io =
|
/* Handle(SALOME_InteractiveObject) io =
|
||||||
static_cast<SalomeApp_DataOwner*>( myDataOwners[ ind ].get() )->IO();
|
static_cast<LightApp_DataOwner*>( myDataOwners[ ind ].get() )->IO();
|
||||||
if ( !io.IsNull() ) {
|
if ( !io.IsNull() ) {
|
||||||
SMESH::SMESH_Mesh_var mesh = SMESH::GetMeshByIO(io) ; // m,sm,gr->m
|
SMESH::SMESH_Mesh_var mesh = SMESH::GetMeshByIO(io) ; // m,sm,gr->m
|
||||||
if ( !mesh->_is_nil() ) {*/
|
if ( !mesh->_is_nil() ) {*/
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#include <SUIT_Session.h>
|
#include <SUIT_Session.h>
|
||||||
#include <SUIT_Study.h>
|
#include <SUIT_Study.h>
|
||||||
|
|
||||||
#include "SalomeApp_SelectionMgr.h"
|
#include "LightApp_SelectionMgr.h"
|
||||||
|
|
||||||
#include "SVTK_Selector.h"
|
#include "SVTK_Selector.h"
|
||||||
#include "SVTK_ViewModel.h"
|
#include "SVTK_ViewModel.h"
|
||||||
@ -50,7 +50,7 @@
|
|||||||
#include "SMESH_ObjectDef.h"
|
#include "SMESH_ObjectDef.h"
|
||||||
|
|
||||||
#include <SalomeApp_Application.h>
|
#include <SalomeApp_Application.h>
|
||||||
#include <SalomeApp_SelectionMgr.h>
|
#include <LightApp_SelectionMgr.h>
|
||||||
#include <SalomeApp_Study.h>
|
#include <SalomeApp_Study.h>
|
||||||
|
|
||||||
#include <SALOMEDSClient_Study.hxx>
|
#include <SALOMEDSClient_Study.hxx>
|
||||||
@ -370,7 +370,7 @@ namespace SMESH{
|
|||||||
|
|
||||||
void UpdateView(){
|
void UpdateView(){
|
||||||
if(SVTK_ViewWindow* aWnd = SMESH::GetCurrentVtkView()){
|
if(SVTK_ViewWindow* aWnd = SMESH::GetCurrentVtkView()){
|
||||||
SalomeApp_SelectionMgr* mgr = SMESHGUI::selectionMgr();
|
LightApp_SelectionMgr* mgr = SMESHGUI::selectionMgr();
|
||||||
SALOME_ListIO selected; mgr->selectedObjects( selected );
|
SALOME_ListIO selected; mgr->selectedObjects( selected );
|
||||||
|
|
||||||
if( selected.Extent() == 0){
|
if( selected.Extent() == 0){
|
||||||
@ -634,7 +634,7 @@ namespace SMESH{
|
|||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
int GetNameOfSelectedNodes(SalomeApp_SelectionMgr *theMgr,
|
int GetNameOfSelectedNodes(LightApp_SelectionMgr *theMgr,
|
||||||
const Handle(SALOME_InteractiveObject)& theIO,
|
const Handle(SALOME_InteractiveObject)& theIO,
|
||||||
QString& theName)
|
QString& theName)
|
||||||
{
|
{
|
||||||
@ -652,7 +652,7 @@ namespace SMESH{
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int GetNameOfSelectedNodes(SalomeApp_SelectionMgr *theMgr, QString& theName){
|
int GetNameOfSelectedNodes(LightApp_SelectionMgr *theMgr, QString& theName){
|
||||||
theName = "";
|
theName = "";
|
||||||
SALOME_ListIO selected; theMgr->selectedObjects( selected );
|
SALOME_ListIO selected; theMgr->selectedObjects( selected );
|
||||||
if(selected.Extent() == 1){
|
if(selected.Extent() == 1){
|
||||||
@ -663,7 +663,7 @@ namespace SMESH{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int GetNameOfSelectedElements(SalomeApp_SelectionMgr *theMgr,
|
int GetNameOfSelectedElements(LightApp_SelectionMgr *theMgr,
|
||||||
const Handle(SALOME_InteractiveObject)& theIO,
|
const Handle(SALOME_InteractiveObject)& theIO,
|
||||||
QString& theName)
|
QString& theName)
|
||||||
{
|
{
|
||||||
@ -687,7 +687,7 @@ namespace SMESH{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int GetNameOfSelectedElements(SalomeApp_SelectionMgr *theMgr, QString& theName)
|
int GetNameOfSelectedElements(LightApp_SelectionMgr *theMgr, QString& theName)
|
||||||
{
|
{
|
||||||
theName = "";
|
theName = "";
|
||||||
SALOME_ListIO selected; theMgr->selectedObjects( selected );
|
SALOME_ListIO selected; theMgr->selectedObjects( selected );
|
||||||
@ -699,7 +699,7 @@ namespace SMESH{
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int GetSelected(SalomeApp_SelectionMgr* theMgr,
|
int GetSelected(LightApp_SelectionMgr* theMgr,
|
||||||
TColStd_IndexedMapOfInteger& theMap,
|
TColStd_IndexedMapOfInteger& theMap,
|
||||||
const bool theIsElement)
|
const bool theIsElement)
|
||||||
{
|
{
|
||||||
@ -717,7 +717,7 @@ namespace SMESH{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int GetEdgeNodes( SalomeApp_SelectionMgr* theMgr, int& theId1, int& theId2 )
|
int GetEdgeNodes( LightApp_SelectionMgr* theMgr, int& theId1, int& theId2 )
|
||||||
{
|
{
|
||||||
SALOME_ListIO selected; theMgr->selectedObjects( selected );
|
SALOME_ListIO selected; theMgr->selectedObjects( selected );
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ class SUIT_ViewManager;
|
|||||||
class SVTK_ViewWindow;
|
class SVTK_ViewWindow;
|
||||||
class SVTK_Selector;
|
class SVTK_Selector;
|
||||||
|
|
||||||
class SalomeApp_SelectionMgr;
|
class LightApp_SelectionMgr;
|
||||||
class SMESHGUI;
|
class SMESHGUI;
|
||||||
|
|
||||||
#include <CORBA.h>
|
#include <CORBA.h>
|
||||||
@ -153,25 +153,25 @@ namespace SMESH{
|
|||||||
int& theId2);
|
int& theId2);
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
int GetNameOfSelectedNodes (SalomeApp_SelectionMgr*,
|
int GetNameOfSelectedNodes (LightApp_SelectionMgr*,
|
||||||
const Handle(SALOME_InteractiveObject)& theIO,
|
const Handle(SALOME_InteractiveObject)& theIO,
|
||||||
QString& theName);
|
QString& theName);
|
||||||
|
|
||||||
int GetNameOfSelectedNodes (SalomeApp_SelectionMgr*,
|
int GetNameOfSelectedNodes (LightApp_SelectionMgr*,
|
||||||
QString& aName);
|
QString& aName);
|
||||||
|
|
||||||
int GetNameOfSelectedElements (SalomeApp_SelectionMgr*,
|
int GetNameOfSelectedElements (LightApp_SelectionMgr*,
|
||||||
const Handle(SALOME_InteractiveObject)& theIO,
|
const Handle(SALOME_InteractiveObject)& theIO,
|
||||||
QString& theName);
|
QString& theName);
|
||||||
|
|
||||||
int GetNameOfSelectedElements (SalomeApp_SelectionMgr*,
|
int GetNameOfSelectedElements (LightApp_SelectionMgr*,
|
||||||
QString& aName);
|
QString& aName);
|
||||||
|
|
||||||
int GetSelected (SalomeApp_SelectionMgr*,
|
int GetSelected (LightApp_SelectionMgr*,
|
||||||
TColStd_IndexedMapOfInteger& theMap,
|
TColStd_IndexedMapOfInteger& theMap,
|
||||||
const bool theIsElement = true );
|
const bool theIsElement = true );
|
||||||
|
|
||||||
int GetEdgeNodes (SalomeApp_SelectionMgr*, int& theId1, int& theId2);
|
int GetEdgeNodes (LightApp_SelectionMgr*, int& theId1, int& theId2);
|
||||||
|
|
||||||
void SetControlsPrecision (const long theVal);
|
void SetControlsPrecision (const long theVal);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user