-This is the version 3.1.0b1 of SALOMEGUI
+This is the version 3.1.0 of SALOMEGUI
Compatible with :
- - KERNEL 3.1.0b1
+ - KERNEL 3.1.0
channel.cfg \
BIN_SCRIPT= VERSION \
-runLightSalome.csh
+runLightSalome.csh \
+runLightSalome.sh
# copy header files in common directory
OWN_CONFIG_H=@OWN_CONFIG_H@
-THIS IS SALOME - SALOMEGUI VERSION: 3.1.0b1
+THIS IS SALOME - SALOMEGUI VERSION: 3.1.0
--- /dev/null
+#!/bin/bash -f
+
+if [ -z "$SUITRoot" ] ; then
+ export SUITRoot=${GUI_ROOT_DIR}/share/salome
+fi
+# this variable necessary for loading .ini or .xml file
+if [ -z "$LightAppConfig" ] ; then
+ export LightAppConfig=${GUI_ROOT_DIR}/share/salome/resources
+fi
+if [ -z "$LightAppResources" ] ; then
+ export LightAppResources=${GUI_ROOT_DIR}/share/salome/resources
+fi
+
+SUITApp LightApp -style salome $* &
# make a link allowing AC_OUTPUT to find the salome_adm/.../*.in files
echo "" >> configure.in_tmp1
-echo 'ln -fs ${KERNEL_ROOT_DIR}/salome_adm ${ROOT_SRCDIR}/salome_adm' >> configure.in_tmp1
+echo 'ln -fs ${KERNEL_ROOT_DIR}/salome_adm ${ROOT_SRCDIR}/.' >> configure.in_tmp1
echo "" >> configure.in_tmp1
echo "AC_OUTPUT([ \\" >> configure.in_tmp1
--- /dev/null
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+
+ <meta http-equiv="Content-Type"
+ content="text/html; charset=iso-8859-1">
+
+ <meta name="GENERATOR"
+ content="Mozilla/4.73 [en] (WinNT; I) [Netscape]">
+ <title>Gui Module Documentation</title>
+</head>
+ <body bgcolor="#cccccc" text="#000000" link="#0000ee" alink="#0000ee"
+ vlink="#551a8b">
+
+<div align="center">
+<center>
+<center>
+ </center>
+
+<table width="96%" align="center">
+ <tbody>
+ <tr>
+ <td><a href="http://www.opencascade.com"><img
+ src="tui/SUIT/sources/logocorp.gif" border="0" height="46" width="122">
+ </a></td>
+ <td>
+
+ <div align="right"><a href="http://www.opencascade.org/SALOME/"><img
+ src="tui/SUIT/sources/application.gif" border="0" height="46" width="108">
+ </a></div>
+ </td>
+ </tr>
+
+ </tbody>
+</table>
+
+<div align="center">
+<center>
+<hr width="100%" size="2">
+<h1>GUI MODULE Documentation</h1>
+ </center>
+ </div>
+
+<table width="96%">
+ <tbody>
+
+ </tbody>
+</table>
+ </center>
+
+<div align="center">
+<p> <img src="tui/SUIT/sources/Application-About.png"
+ alt="Application-About.png" width="30%" height="20%">
+ </p>
+ </div>
+
+<center>
+<table width="96%">
+ <tbody>
+
+ </tbody>
+</table>
+ <br>
+ <br>
+ <br>
+ </center>
+
+<address> </address>
+
+<center><big><a href="gui/KERNEL/kernel.htm">GUI Documentation</a></big></center>
+
+<address> </address>
+
+<center></center>
+
+<center><br>
+ </center>
+
+<address> </address>
+
+<center><big><a href="tui/SUIT/index.html">TUI Documentation</a></big></center>
+
+<address> </address>
+
+<center></center>
+
+<center><br>
+ <br>
+ </center>
+ </div>
+ <br>
+ <br>
+ <br>
+</body>
+</html>
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
-PROJECT_NAME = "SALOME v.3.1.0a"
+PROJECT_NAME = "SALOME v.3.1.0"
PROJECT_NUMBER = id#1.1
OUTPUT_DIRECTORY = ../
CREATE_SUBDIRS = NO
#include <LogWindow.h>
#include <OB_Browser.h>
+#include <OB_ListView.h>
#include <PythonConsole_PyConsole.h>
#include <GLViewer_Viewer.h>
#include <qobjectlist.h>
#include <qcombobox.h>
#include <qinputdialog.h>
-
-#define OBJECT_BROWSER_WIDTH 300
-#define OBJECT_COLUMN_WIDTH 150
-
-#ifdef WIN32
-#define DEFAULT_BROWSER "start iexplore.exe"
-#else
-#define DEFAULT_BROWSER "mozilla"
-#endif
+#include <qmessagebox.h>
#define FIRST_HELP_ID 1000000
//! Preferences
createAction( PreferencesId, tr( "TOT_DESK_PREFERENCES" ), QIconSet(),
tr( "MEN_DESK_PREFERENCES" ), tr( "PRP_DESK_PREFERENCES" ),
- CTRL+Key_P, desk, false, this, SLOT( onPreferences() ) );
+ CTRL+Key_F, desk, false, this, SLOT( onPreferences() ) );
//! Help for modules
int helpMenu = createMenu( tr( "MEN_DESK_HELP" ), -1, -1, 1000 );
createMenu( a, newWinMenu, -1 );
}
- createAction( RenameId, tr( "TOT_RENAME" ), QIconSet(), tr( "MEN_RENAME" ), tr( "PRP_RENAME" ),
- 0, desk, false, this, SLOT( onRenameWindow() ) );
+ createAction( RenameId, tr( "TOT_RENAME" ), QIconSet(), tr( "MEN_DESK_RENAME" ), tr( "PRP_RENAME" ),
+ SHIFT+Key_R, desk, false, this, SLOT( onRenameWindow() ) );
createMenu( RenameId, windowMenu, -1 );
connect( modGroup, SIGNAL( selected( QAction* ) ), this, SLOT( onModuleActivation( QAction* ) ) );
postEvent (qApp, ce2000);
}
}
-
- if( myStatus != 0 || myApp.isEmpty())
+ if( myStatus != 0)
{
- myParams = "";
- aCommand.sprintf("%s %s %s", QString(DEFAULT_BROWSER).latin1(),myParams.latin1(), myHelpFile.latin1());
- myStatus = system(aCommand);
- if(myStatus != 0)
- {
- QCustomEvent* ce2001 = new QCustomEvent (2001);
- postEvent (qApp, ce2001);
- }
+ qApp->lock();
+ SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").arg(myApp).arg(myHelpFile),
+ QObject::tr("BUT_OK"));
+ qApp->unlock();
}
}
QString anApp = resMgr->stringValue("ExternalBrowser", "application");
QString aParams = resMgr->stringValue("ExternalBrowser", "parameters");
- RunBrowser* rs = new RunBrowser(anApp, aParams, helpFile);
- rs->start();
+ if (!anApp.isEmpty()) {
+ RunBrowser* rs = new RunBrowser(anApp, aParams, helpFile);
+ rs->start();
+ }
+ else {
+ SUIT_MessageBox::warn1(desktop(), tr("WRN_WARNING"),
+ tr("DEFINE_EXTERNAL_BROWSER"),
+ tr("BUT_OK"));
+ }
}
/*!Sets enable or disable some actions on selection changed.*/
myWindows[flag]->setResizeEnabled( true );
myWindows[flag]->setCloseMode( QDockWindow::Always );
myWindows[flag]->setName( QString( "dock_window_%1" ).arg( flag ) );
+ myWindows[flag]->setFixedExtentWidth( wid->width() );
+ myWindows[flag]->setFixedExtentHeight( wid->height() );
}
QFont f;
if( wid->inherits( "PythonConsole" ) )
- f = ( ( PythonConsole* )wid )->font();
+ {
+ if( resourceMgr()->hasValue( "PyConsole", "font" ) )
+ f = resourceMgr()->fontValue( "PyConsole", "font" );
+ else
+ {
+ f = ( ( PythonConsole* )wid )->font();
+ resourceMgr()->setValue( "PyConsole", "font", f );
+ }
+ }
else
f = wid->font();
if ( objectBrowser() )
{
objectBrowser()->updateGeometry();
- objectBrowser()->updateTree();
+ objectBrowser()->updateTree( 0, false );
}
}
if ( !prefDlg )
return;
- prefDlg->exec();
+ if ( ( prefDlg->exec() == QDialog::Accepted || prefDlg->isSaved() ) && resourceMgr() ) {
+ if ( desktop() )
+ desktop()->saveGeometry( resourceMgr(), "desktop" );
+ resourceMgr()->save();
+ }
delete prefDlg;
}
ob->setAutoUpdate( true );
ob->setAutoOpenLevel( 1 );
ob->setCaption( tr( "OBJECT_BROWSER" ) );
- ob->listView()->setColumnWidth( 0, OBJECT_COLUMN_WIDTH );
- ob->resize( OBJECT_BROWSER_WIDTH, ob->height() );
- ob->setFilter( new LightApp_OBFilter( selectionMgr() ) );
+ OB_ListView* ob_list = dynamic_cast<OB_ListView*>( const_cast<QListView*>( ob->listView() ) );
+ if( ob_list )
+ ob_list->setColumnMaxWidth( 0, desktop()->width()/4 );
+
+ ob->setFilter( new LightApp_OBFilter( selectionMgr() ) );
ob->setNameTitle( tr( "OBJ_BROWSER_NAME" ) );
// Create OBSelector
LightApp_Application* that = (LightApp_Application*)this;
- if ( !_prefs_ && crt )
+ bool toCreate = !_prefs_ && crt;
+ if( toCreate )
{
_prefs_ = new LightApp_Preferences( resourceMgr() );
that->createPreferences( _prefs_ );
{
int modCat = _prefs_->addPreference( mod->moduleName() );
_prefs_->setItemProperty( modCat, "info", QString::null );
- mod->createPreferences();
+ if( toCreate )
+ mod->createPreferences();
}
}
}
int undoPref = pref->addPreference( tr( "PREF_UNDO_LEVEL" ), studyGroup, LightApp_Preferences::IntSpin, "Study", "undo_level" );
pref->setItemProperty( undoPref, "min", 1 );
pref->setItemProperty( undoPref, "max", 100 );
+ pref->addPreference( tr( "PREF_STORE_POS" ), studyGroup, LightApp_Preferences::Bool, "Study", "store_positions" );
int extgroup = pref->addPreference( tr( "PREF_GROUP_EXT_BROWSER" ), genTab );
pref->setItemProperty( extgroup, "columns", 1 );
int apppref = pref->addPreference( tr( "PREF_APP" ), extgroup, LightApp_Preferences::File, "ExternalBrowser", "application" );
pref->setItemProperty( apppref, "existing", true );
pref->setItemProperty( apppref, "flags", QFileInfo::ExeUser );
+ pref->setItemProperty( apppref, "readOnly", false );
pref->addPreference( tr( "PREF_PARAM" ), extgroup, LightApp_Preferences::String, "ExternalBrowser", "parameters" );
LightApp_Preferences::Color, "SUPERVGraph", "Title" );
// pref->addPreference( tr( "PREF_SUPERV_CTRL_COLOR" ), supervGroup,
// LightApp_Preferences::Color, "SUPERVGraph", "Ctrl" );
+
+ int obTab = pref->addPreference( tr( "PREF_TAB_OBJBROWSER" ), salomeCat );
+ int objSetGroup = pref->addPreference( tr( "PREF_OBJ_BROWSER_SETTINGS" ), obTab );
+ pref->addPreference( tr( "PREF_AUTO_SIZE_FIRST" ), objSetGroup, LightApp_Preferences::Bool,
+ "ObjectBrowser", "auto_size_first" );
+ pref->addPreference( tr( "PREF_AUTO_SIZE" ), objSetGroup, LightApp_Preferences::Bool,
+ "ObjectBrowser", "auto_size" );
}
/*!Changed preferences */
if( sec=="ObjectBrowser" )
{
- if( param=="auto_size" )
+ if( param=="auto_size" || param=="auto_size_first" )
{
OB_Browser* ob = objectBrowser();
if( !ob )
return;
- bool autoSize = resMgr->booleanValue( "ObjectBrowser", "auto_size", false );
+ bool autoSize = resMgr->booleanValue( "ObjectBrowser", "auto_size", false ),
+ autoSizeFirst = resMgr->booleanValue( "ObjectBrowser", "auto_size_first", true );
ob->setWidthMode( autoSize ? QListView::Maximum : QListView::Manual );
-
+ ob->listView()->setColumnWidthMode( 0, autoSizeFirst ? QListView::Maximum : QListView::Manual );
updateObjectBrowser( false );
}
}
+ if( sec=="Study" )
+ {
+ if( param=="store_positions" )
+ updateWindows();
+ }
+
if( sec=="PyConsole" )
{
if( param=="font" )
/*!Load windows geometry.*/
void LightApp_Application::loadWindowsGeometry()
{
+ bool store = resourceMgr()->booleanValue( "Study", "store_positions", true );
+ if( !store )
+ return;
+
QtxDockAction* dockMgr = 0;
QAction* a = action( ViewWindowsId );
/*!Save windows geometry.*/
void LightApp_Application::saveWindowsGeometry()
{
+ bool store = resourceMgr()->booleanValue( "Study", "store_positions", true );
+ if( !store )
+ return;
+
QtxDockAction* dockMgr = 0;
QAction* a = action( ViewWindowsId );
}
/*!Deactivate module.*/
-bool LightApp_Module::deactivateModule( SUIT_Study* )
+bool LightApp_Module::deactivateModule( SUIT_Study* study )
{
delete mySwitchOp;
mySwitchOp = 0;
- return true;
+ // abort all operations
+ MapOfOperation::const_iterator anIt;
+ for( anIt = myOperations.begin(); anIt != myOperations.end(); anIt++ ) {
+ anIt.data()->abort();
+ }
+
+ return CAM_Module::activateModule( study );
}
/*!NOT IMPLEMENTED*/
*/
LightApp_PreferencesDlg::LightApp_PreferencesDlg( LightApp_Preferences* prefs, QWidget* parent )
: QtxDialog( parent, 0, true, false, OK | Close | Apply ),
-myPrefs( prefs )
+myPrefs( prefs ), mySaved ( false )
{
setCaption( tr( "CAPTION" ) );
QtxDialog::accept();
myPrefs->store();
+ mySaved = true;
}
/*!Reject. Restore preferences from backup.*/
{
myPrefs->store();
myPrefs->toBackup();
+ mySaved = true;
}
virtual void accept();
virtual void reject();
+ bool isSaved() { return mySaved; }
+ void setSaved( bool saved ) { mySaved = saved; }
+
private slots:
void onHelp();
void onApply();
private:
LightApp_Preferences* myPrefs;
+ bool mySaved;
};
#endif
abort();
return;
}
- QString aStr = sel.param( 0, "component" ).toString();
- QString mod_name = app->moduleTitle( aStr );//sel.param( 0, "component" ).toString() );
+
+ QString mod_name;
+ if( sel.count()>0 )
+ {
+ QString aStr = sel.param( 0, "component" ).toString();
+ mod_name = app->moduleTitle( aStr );
+ }
+ else if( app->activeModule() )
+ mod_name = app->moduleTitle( app->activeModule()->name() );
+
LightApp_Displayer* d = LightApp_Displayer::FindDisplayer( mod_name, true );
if( !d )
{
<parameter name="QuickDirList" value=""/>
<!-- Here go other common user preferences -->
</section>
+ <section name="Study">
+ <parameter value="true" name="store_positions" />
+ </section>
<section name="OCCViewer" >
<parameter value="35, 136, 145" name="background" />
<parameter value="1" name="iso_number_u" />
msgid "LightApp_Application::TOT_RENAME"
msgstr "Rename"
-msgid "LightApp_Application::MEN_RENAME"
-msgstr "Rename"
+msgid "LightApp_Application::MEN_DESK_RENAME"
+msgstr "&Rename"
msgid "LightApp_Application::PRP_RENAME"
msgstr "Rename active window"
msgstr "Preferences"
msgid "LightApp_Application::MEN_DESK_PREFERENCES"
-msgstr "Preferences..."
+msgstr "Pre&ferences..."
msgid "LightApp_Application::TOT_DESK_MRU"
msgstr "Most recently used"
msgstr "Switch to the module \"%1\""
msgid "LightApp_Application::NEW_WINDOW_0"
-msgstr "GL view"
+msgstr "&GL view"
msgid "LightApp_Application::NEW_WINDOW_1"
-msgstr "Plot2d view"
+msgstr "&Plot2d view"
msgid "LightApp_Application::NEW_WINDOW_2"
-msgstr "OCC view"
+msgstr "&OCC view"
msgid "LightApp_Application::NEW_WINDOW_3"
-msgstr "VTK view"
+msgstr "VT&K view"
msgid "LightApp_Application::INF_CANCELLED"
msgstr "Module activation cancelled"
+msgid "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"
+msgstr "External browser \"%1\" can not show help page \"%2\""
+
+msgid "LightApp_Application::DEFINE_EXTERNAL_BROWSER"
+msgstr "Define external browser in preferences"
+
msgid "LightApp_Application::DATA_MODELS"
msgstr "Data models"
msgid "LightApp_Application::PREF_UNDO_LEVEL"
msgstr "Undo level"
+msgid "LightApp_Application::PREF_STORE_POS"
+msgstr "Store positions of windows"
+
msgid "LightApp_Application::PREF_GROUP_EXT_BROWSER"
msgstr "External browser"
msgid "LightApp_Application::PREF_TAB_OBJBROWSER"
msgstr "Object browser"
+msgid "LightApp_Application::PREF_OBJ_BROWSER_SETTINGS"
+msgstr "Object browser settings"
+
msgid "LightApp_Application::PREF_GROUP_DEF_COLUMNS"
msgstr "Default columns"
msgid "LightApp_Application::PREF_SUPERV_CTRL_COLOR"
msgstr "Ctrl color"
+msgid "LightApp_Application::PREF_AUTO_SIZE"
+msgstr "Auto size for other columns"
+
+msgid "LightApp_Application::PREF_AUTO_SIZE_FIRST"
+msgstr "Auto size for first column"
+
//=======================================================================================
msgid "LightApp_PreferencesDlg::CAPTION"
"................................",
"................................",
"................................"};
-
-
-QPixmap zoomPixmap(imageZoomCursor);
-QPixmap rotatePixmap(imageRotateCursor);
-QPixmap globalPanPixmap(imageCrossCursor);
-
-QCursor defCursor(Qt::ArrowCursor);
-QCursor handCursor(Qt::PointingHandCursor);
-QCursor panCursor(Qt::SizeAllCursor);
-QCursor zoomCursor(zoomPixmap);
-QCursor rotCursor(rotatePixmap);
-QCursor glPanCursor(globalPanPixmap);
-
//////////////////////////////////////////////////////////////////////
myCursor = cursor(); /* save old cursor */
if ( myOperation != ZOOMVIEW ) {
+ QPixmap zoomPixmap (imageZoomCursor);
+ QCursor zoomCursor (zoomPixmap);
setTransformRequested ( ZOOMVIEW );
setCursor( zoomCursor );
}
myCursor = cursor(); // save old cursor
if ( myOperation != PANVIEW ) {
+ QCursor panCursor (Qt::SizeAllCursor);
setTransformRequested ( PANVIEW );
setCursor( panCursor );
}
myCursor = cursor(); // save old cursor
if ( myOperation != ROTATE ) {
+ QPixmap rotatePixmap (imageRotateCursor);
+ QCursor rotCursor (rotatePixmap);
setTransformRequested ( ROTATE );
setCursor( rotCursor );
}
{
Handle(V3d_View) aView3d = myViewPort->getView();
if ( !aView3d.IsNull() ) {
+ QPixmap globalPanPixmap (imageCrossCursor);
+ QCursor glPanCursor (globalPanPixmap);
myCurScale = aView3d->Scale();
aView3d->FitAll(0.01, false);
myCursor = cursor(); // save old cursor
myCursor = cursor(); /* save old cursor */
if ( myOperation != WINDOWFIT ) {
+ QCursor handCursor (Qt::PointingHandCursor);
setTransformRequested ( WINDOWFIT );
setCursor ( handCursor );
myCursorIsHand = true;
if ( myDrawRect ) {
drawRect();
if ( !myCursorIsHand ) { // we are going to sketch a rectangle
+ QCursor handCursor (Qt::PointingHandCursor);
myCursorIsHand = true;
myCursor = cursor();
setCursor( handCursor );
return;
myRootDecorated = decor;
- updateTree();
+ updateTree( 0, false );
}
int OB_Browser::autoOpenLevel() const
myView->setAppropriate( myColumnIds[id], on );
}
-void OB_Browser::updateTree( SUIT_DataObject* obj )
+void OB_Browser::updateTree( SUIT_DataObject* obj, const bool autoOpen )
{
if ( !obj && !(obj = getRootObject()) )
return;
restoreState( selObjs, openObjs, curObj, selKeys, openKeys, curKey );
- autoOpenBranches();
+ if( autoOpen )
+ autoOpenBranches();
if ( selNum != numberOfSelected() )
emit selectionChanged();
if ( openObjs.contains( obj ) )
{
- if ( openObjs[obj] )
+ bool parentOpen = true;
+ if( item && item->parent() )
+ parentOpen = item->parent()->isOpen();
+
+ if ( openObjs[obj] && parentOpen )
lv->setOpen( item, true );
}
else if ( !key.isNull() && openKeys.contains( key ) )
- lv->setOpen( item, true );
+ {
+ bool parentOpen = true;
+ if( item && item->parent() )
+ parentOpen = item->parent()->isOpen();
+
+ if( parentOpen )
+ lv->setOpen( item, true );
+ }
if ( !curItem && ( curObj == obj || ( !curKey.isNull() && curKey == key )) )
curItem = item;
void OB_Browser::keyPressEvent( QKeyEvent* e )
{
if ( e->key() == Qt::Key_F5 )
- updateTree();
+ updateTree( 0, false );
QFrame::keyPressEvent( e );
}
if ( isAutoUpdate() )
{
SUIT_DataObject* pObj = item && item->parent() ? dataObject( item->parent() ) : 0;
- updateTree( pObj );
+ updateTree( pObj, false );
}
else
delete item;
bool isAutoDeleteObjects() const;
virtual void setAutoDeleteObjects( const bool );
- virtual void updateTree( SUIT_DataObject* = 0 );
+ virtual void updateTree( SUIT_DataObject* = 0, const bool autoOpen = true );
virtual void replaceTree( SUIT_DataObject*, SUIT_DataObject* );
bool isShowToolTips();
return RTTI();
}
+void OB_ListItem::setText( int column, const QString& text )
+{
+ QListViewItem::setText( column, text );
+ QFontMetrics fm = listView()->fontMetrics();
+ int necessary = width( fm, listView(), column ),
+ current = listView()->columnWidth( column );
+
+ if( listView()->columnWidthMode( column )==QListView::Maximum && necessary>current )
+ listView()->setColumnWidth( column, necessary );
+}
+
/*!
Class: OB_CheckListItem
Descr: Check list view item for OB_Browser.
virtual void paintFocus( QPainter* p, const QColorGroup& cg, const QRect& r );
virtual void paintCell( QPainter* p, const QColorGroup& cg, int c, int w, int align );
+ virtual void setText ( int column, const QString & text );
virtual int rtti() const;
return dropObj->isDropAccepted( dragObj );
}
+
+void OB_ListView::setColumnWidth( int col, int width )
+{
+ int max = columnMaxWidth( col );
+ if( max>0 && width>max )
+ width = max;
+ QListView::setColumnWidth( col, width );
+}
+
+int OB_ListView::columnMaxWidth( const int col ) const
+{
+ int res = -1;
+ if( myMaxColWidth.contains( col ) )
+ res = myMaxColWidth[col];
+ else if( myMaxColRatio.contains( col ) )
+ res = int( myMaxColRatio[col]*height() );
+ return res;
+}
+
+void OB_ListView::setColumnMaxWidth( const int col, const int w )
+{
+ myMaxColWidth.insert( col, w );
+}
+
+double OB_ListView::columnMaxRatio( const int col ) const
+{
+ double res = 0.0;
+ if( myMaxColRatio.contains( col ) )
+ res = myMaxColRatio[col];
+ return res;
+}
+
+void OB_ListView::setColumnMaxRatio( const int col, const double r )
+{
+ myMaxColRatio.insert( col, r );
+}
void setFilter( OB_Filter* );
bool isOk( QListViewItem* ) const;
+ virtual void setColumnWidth( int, int );
+ int columnMaxWidth( const int ) const;
+ void setColumnMaxWidth( const int, const int );
+ double columnMaxRatio( const int ) const;
+ void setColumnMaxRatio( const int, const double );
signals:
void dropped( QPtrList<QListViewItem>, QListViewItem*, int );
protected:
QPtrList<QListViewItem> myItems;
OB_Filter* myFilter;
+ QMap<int,int> myMaxColWidth;
+ QMap<int,double> myMaxColRatio;
};
#ifdef WIN32
"................................"};
-QPixmap zoomPixmap(imageZoomCursor);
-QPixmap globalPanPixmap(imageCrossCursor);
-
-QCursor panCursor(Qt::SizeAllCursor);
-QCursor zoomCursor(zoomPixmap);
-QCursor glPanCursor(globalPanPixmap);
-
//=================================================================================
// Plot2d_ViewFrame implementation
//=================================================================================
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
myCurveType = resMgr->integerValue( "Plot2d", "CurveType", myCurveType );
- if ( myCurveType < 1 || myCurveType > 2 )
- myCurveType = 1;
+ setCurveType( resMgr->integerValue( "Plot2d", "CurveType", myCurveType ) );
+
myShowLegend = resMgr->booleanValue( "Plot2d", "ShowLegend", myShowLegend );
myLegendPos = resMgr->integerValue( "Plot2d", "LegendPos", myLegendPos );
myMarkerSize = resMgr->integerValue( "Plot2d", "MarkerSize", myMarkerSize );
if ( curveKey ) {
myPlot->removeCurve( curveKey );
myCurves.remove( curveKey );
+ updateTitles();
if ( update )
myPlot->replot();
}
switch (btn)
{
case zoomBtn:
- myPlot->canvas()->setCursor( zoomCursor );
- return ZoomId;
+ {
+ QPixmap zoomPixmap (imageZoomCursor);
+ QCursor zoomCursor (zoomPixmap);
+ myPlot->canvas()->setCursor( zoomCursor );
+ return ZoomId;
+ }
case panBtn:
myPlot->canvas()->setCursor( QCursor( Qt::SizeAllCursor ) );
return PanId;
*/
void Plot2d_ViewFrame::onViewPan()
{
+ QCursor panCursor (Qt::SizeAllCursor);
myPlot->canvas()->setCursor( panCursor );
myOperation = PanId;
qApp->installEventFilter( this );
*/
void Plot2d_ViewFrame::onViewZoom()
{
+ QPixmap zoomPixmap (imageZoomCursor);
+ QCursor zoomCursor (zoomPixmap);
myPlot->canvas()->setCursor( zoomCursor );
myOperation = ZoomId;
qApp->installEventFilter( this );
*/
void Plot2d_ViewFrame::onViewGlobalPan()
{
+ QPixmap globalPanPixmap (imageCrossCursor);
+ QCursor glPanCursor (globalPanPixmap);
myPlot->canvas()->setCursor( glPanCursor );
myPlot->changeAxisOptions( QwtPlot::xBottom, QwtAutoScale::Logarithmic, false );
myPlot->changeAxisOptions( QwtPlot::yLeft, QwtAutoScale::Logarithmic, false );
//****************************************************************
void Plot2d_ViewWindow::onChangeCurveMode()
{
- myCurveBtn->SetItem(myViewFrame->getCurveType());
+ int aCurveType = myViewFrame->getCurveType();
+ myCurveBtn->SetItem(aCurveType);
+
+ myActionsMap[CurvPointsId]->setOn(aCurveType == 0);
+ myActionsMap[CurvLinesId]->setOn(aCurveType == 1);
+ myActionsMap[CurvSplinesId]->setOn(aCurveType == 2);
}
//****************************************************************
void Plot2d_ViewWindow::onCurves()
{
QtxAction* aSender = (QtxAction*) sender();
- if(aSender == myActionsMap[CurvPointsId]) {
- myActionsMap[CurvPointsId]->setOn(true);
- myActionsMap[CurvLinesId]->setOn(false);
- myActionsMap[CurvSplinesId]->setOn(false);
+ if(aSender == myActionsMap[CurvPointsId])
myViewFrame->setCurveType(0);
- }
- else if(aSender == myActionsMap[CurvLinesId]) {
- myActionsMap[CurvLinesId]->setOn(true);
- myActionsMap[CurvPointsId]->setOn(false);
- myActionsMap[CurvSplinesId]->setOn(false);
+ else if(aSender == myActionsMap[CurvLinesId])
myViewFrame->setCurveType(1);
- }
- else if(aSender == myActionsMap[CurvSplinesId]) {
- myActionsMap[CurvSplinesId]->setOn( true );
- myActionsMap[CurvPointsId]->setOn( false );
- myActionsMap[CurvLinesId]->setOn( false );
+ else if(aSender == myActionsMap[CurvSplinesId])
myViewFrame->setCurveType(2);
- }
}
-
+
//****************************************************************
void Plot2d_ViewWindow::onDumpView()
{
safeExecute();
myMutex.lock();
- if ( !IsSync() && getListener() && getEvent() )
+ //if ( !IsSync() && getListener() && getEvent() )
+ if ( getListener() && getEvent() )
postEvent();
myMutex.unlock();
}
QEvent* PyInterp_Request::getEvent()
{
- if ( !myEvent && !IsSync() )
+ //if ( !myEvent && !IsSync() )
+ if ( !myEvent )
myEvent = createEvent();
return myEvent;
}
if ( !theRequest )
return;
- if ( theRequest->IsSync() && !IsBusy() ) // synchronous processing - nothing is done if dispatcher is busy!
+ //if ( theRequest->IsSync() && !IsBusy() ) // synchronous processing - nothing is done if dispatcher is busy!
+ if ( theRequest->IsSync() ) // synchronous processing - nothing is done if dispatcher is busy!
processRequest( theRequest );
else { // asynchronous processing
myQueueMutex.lock();
myThreadState(theThreadState),
mySaveThreadState(0)
{
- PyEval_AcquireLock();
- mySaveThreadState = PyThreadState_Swap(myThreadState); // store previous current in save,
- // set local in current
+#if defined(USE_GILSTATE)
+ if (myThreadState->interp == PyInterp_base::_interp) {
+ _savestate = PyGILState_Ensure();
+ } else {
+ PyEval_AcquireThread(myThreadState);
+ }
+#else
+ PyEval_AcquireThread(myThreadState);
+#endif
}
-
-PyLockWrapper::~PyLockWrapper(){
- PyThreadState_Swap(mySaveThreadState); // restore previous current (no need to get local,
- PyEval_ReleaseLock(); // local thread state* already in _tstate
+PyLockWrapper::~PyLockWrapper()
+{
+#if defined(USE_GILSTATE)
+ if (myThreadState->interp == PyInterp_base::_interp) {
+ PyGILState_Release(_savestate);
+ } else {
+ PyEval_ReleaseThread(myThreadState);
+ }
+#else
+ PyEval_ReleaseThread(myThreadState);
+#endif
}
-
class PyReleaseLock{
public:
~PyReleaseLock(){
}
-// main python interpreter
+// main python interpreter (static attributes)
-//PyThreadState *PyInterp_base::_gtstate = 0; // force 0 before execution
int PyInterp_base::_argc = 1;
char* PyInterp_base::_argv[] = {""};
PyObject *PyInterp_base::builtinmodule = NULL;
+PyThreadState *PyInterp_base::_gtstate = NULL;
+PyInterpreterState *PyInterp_base::_interp = NULL;
+
/*!
* basic constructor here : herited classes constructors must call initalize() method
PyInterp_base::~PyInterp_base()
{
- PyLockWrapper aLock(_tstate);
- //Py_EndInterpreter(_tstate);
}
init_python();
// Here the global lock is released
- // The lock will be acquired in initState. Make provision to release it on exit
- PyReleaseLock aReleaseLock;
-
initState();
+
+ PyLockWrapper aLock= GetLockWrapper();
+
initContext();
// used to interpret & compile commands
if(!m){
PyErr_Print();
return;
- }
-
+ }
+
// Create cStringIO to capture stdout and stderr
PycString_IMPORT;
- //PycStringIO = (PycStringIO_CAPI *)xxxPyCObject_Import("cStringIO", "cStringIO_CAPI");
_vout = PycStringIO->NewOutput(128);
_verr = PycStringIO->NewOutput(128);
-
+
// All the initRun outputs are redirected to the standard output (console)
initRun();
}
void PyInterp_base::init_python()
{
- static PyThreadState *_gtstate = 0;
-
_atFirst = false;
if (Py_IsInitialized())
return;
+ // Python is not initialized
Py_SetProgramName(_argv[0]);
Py_Initialize(); // Initialize the interpreter
PySys_SetArgv(_argc, _argv);
PyEval_InitThreads(); // Create (and acquire) the interpreter lock
+ _interp = PyThreadState_Get()->interp;
_gtstate = PyEval_SaveThread(); // Release global thread state
-// if(!_gtstate){
-// PyReleaseLock aReleaseLock;
-// Py_Initialize(); // Initialize the interpreter
-// PyEval_InitThreads(); // Initialize and acquire the global interpreter lock
-// PySys_SetArgv(_argc,_argv); // initialize sys.argv
-// _gtstate = PyThreadState_Get();
-// }
}
string PyInterp_base::getbanner()
{
+ // Should we take the lock ?
+ // PyEval_RestoreThread(_tstate);
string aBanner("Python ");
aBanner = aBanner + Py_GetVersion() + " on " + Py_GetPlatform() ;
aBanner = aBanner + "\ntype help to get general information on environment\n";
+ //PyEval_SaveThread();
return aBanner;
}
return 1;
}else{
// Complete and correct text. We evaluate it.
-#if PY_VERSION_HEX < 0x02040000 // python version earlier than 2.4.0
- PyObjWrapper r(PyEval_EvalCode(v,context,context));
-#else
+ //#if PY_VERSION_HEX < 0x02040000 // python version earlier than 2.4.0
+ // PyObjWrapper r(PyEval_EvalCode(v,context,context));
+ //#else
PyObjWrapper r(PyEval_EvalCode((PyCodeObject *)(void *)v,context,context));
-#endif
+ //#endif
if(!r){
// Execution error. We return -1
PyErr_Print();
// Reset redirected outputs before treatment
PySys_SetObject("stderr",_verr);
PySys_SetObject("stdout",_vout);
-
+
PyObjWrapper verr(PyObject_CallMethod(_verr,"reset",""));
PyObjWrapper vout(PyObject_CallMethod(_vout,"reset",""));
-
+
int ier = compile_command(command,_g);
// Outputs are redirected on standards outputs (console)
PySys_SetObject("stdout",PySys_GetObject("__stdout__"));
PySys_SetObject("stderr",PySys_GetObject("__stderr__"));
+
return ier;
}
string aRet(PyString_AsString(v));
return aRet;
}
-
//#include <pthread.h> // must be before Python.h !
#include <Python.h> // must be before qt includes ...
+#include <compile.h> // Python include needed for versions before 2.4. Included in Python.h now.
+#include <eval.h> // Python include needed for versions before 2.4. Included in Python.h now.
-#if PY_VERSION_HEX < 0x02040000 // python version earlier than 2.4.0
-extern "C" PyObject * PyEval_EvalCode(PyObject *co, PyObject *g, PyObject *l);
+//#if PY_VERSION_HEX < 0x02040000 // python version earlier than 2.4.0
+//extern "C" PyObject * PyEval_EvalCode(PyObject *co, PyObject *g, PyObject *l);
+//#endif
+
+/* For 2.3, use the PyGILState_ calls */
+#if (PY_VERSION_HEX >= 0x02030000)
+#define USE_GILSTATE
#endif
#define TOP_HISTORY_PY "--- top of history ---"
{
PyThreadState* myThreadState;
PyThreadState* mySaveThreadState;
+#if defined(USE_GILSTATE)
+ PyGILState_STATE _savestate ;
+#endif
public:
PyLockWrapper(PyThreadState* theThreadState);
~PyLockWrapper();
};
-
class PYINTERP_EXPORT PyInterp_base{
public:
static int _argc;
static char* _argv[];
static PyObject *builtinmodule;
+ static PyThreadState *_gtstate;
+ static PyInterpreterState *_interp;
PyInterp_base();
~PyInterp_base();
class ExecCommand : public PyInterp_LockRequest
{
public:
- ExecCommand(PyInterp_base* theInterp, const char* theCommand, PythonConsole_PyEditor* theListener)
-: PyInterp_LockRequest( theInterp, theListener ), myCommand(theCommand), myState( PyInterp_Event::OK )
+ ExecCommand(PyInterp_base* theInterp, const char* theCommand,
+ PythonConsole_PyEditor* theListener, bool sync = false)
+ : PyInterp_LockRequest( theInterp, theListener, sync ),
+ myCommand( theCommand ), myState( PyInterp_Event::OK )
{}
protected:
_tstate->interp->builtins = PyModule_GetDict(builtinmodule);
Py_INCREF(_tstate->interp->builtins);
}
+ PyEval_ReleaseThread(_tstate);
return true;
}
: PrefItem( Font, edit, pItem, parent ),
myFlags( QFileInfo::ReadUser ),
myIsExisting( true ),
+ myIsReadOnly ( true ),
myFileDlg( 0 )
{
new QLabel( title, this );
myFile = new QLineEdit( this );
myFile->setValidator( new FileValidator( this, myFile ) );
- myFile->setReadOnly( true );
+ myFile->setReadOnly( myIsReadOnly );
myOpenFile = new QToolButton( this );
myOpenFile->setText( "..." );
connect( myOpenFile, SIGNAL( clicked() ), this, SLOT( onOpenFile() ) );
return myIsExisting;
else if( name=="flags" )
return myFlags;
+ else if( name=="readOnly")
+ return myIsReadOnly;
return QVariant();
}
else if( name=="flags" && value.canCast( QVariant::UInt ) )
myFlags = value.toUInt();
+
+ else if( name=="readOnly" && value.canCast( QVariant::Bool) ) {
+ myIsReadOnly = value.toBool();
+ myFile->setReadOnly( myIsReadOnly );
+ }
}
void QtxListResourceEdit::FileItem::onOpenFile()
private:
uint myFlags;
+ bool myIsReadOnly;
QStringList myFilter;
bool myIsExisting;
QLineEdit* myFile;
PyLockWrapper aLock = myInterp->GetLockWrapper();
// ... (the Python module is already imported)
// ... finally call Python module's initialize() method
- PyObjWrapper res( PyObject_CallMethod( myModule, "initialize", "" ) );
- if( !res ) {
- // VSR: this method may not be implemented in Python module
- // PyErr_Print();
- PyErr_Clear();
+ if(PyObject_HasAttrString(myModule , "initialize")){
+ PyObjWrapper res( PyObject_CallMethod( myModule, "initialize", "" ) );
+ if( !res ) {
+ PyErr_Print();
+ }
}
// get the windows list from the Python module by calling windows() method
// VSR: LogWindow is not yet implemented
// myWindowsMap.insert( SalomeApp_Application::WT_LogWindow, Qt::DockBottom );
- PyObjWrapper res1( PyObject_CallMethod( myModule, "windows", "" ) );
- if( !res1 ) {
- // VSR: this method may not be implemented in Python module
- // PyErr_Print();
- PyErr_Clear();
- }
- else {
- myWindowsMap.clear();
- if ( PyDict_Check( res1 ) ) {
- PyObject* key;
- PyObject* value;
- int pos = 0;
- while ( PyDict_Next( res1, &pos, &key, &value ) ) {
- // parse the return value
- // it should be a map: {integer:integer}
- int aKey, aValue;
- if( key && PyInt_Check( key ) && value && PyInt_Check( value ) ) {
- aKey = PyInt_AsLong( key );
- aValue = PyInt_AsLong( value );
- myWindowsMap[ aKey ] = aValue;
- }
+ if(PyObject_HasAttrString(myModule , "windows")){
+ PyObjWrapper res1( PyObject_CallMethod( myModule, "windows", "" ) );
+ if( !res1 ) {
+ PyErr_Print();
+ }
+ else {
+ myWindowsMap.clear();
+ if ( PyDict_Check( res1 ) ) {
+ PyObject* key;
+ PyObject* value;
+ int pos = 0;
+ while ( PyDict_Next( res1, &pos, &key, &value ) ) {
+ // parse the return value
+ // it should be a map: {integer:integer}
+ int aKey, aValue;
+ if( key && PyInt_Check( key ) && value && PyInt_Check( value ) ) {
+ aKey = PyInt_AsLong( key );
+ aValue = PyInt_AsLong( value );
+ myWindowsMap[ aKey ] = aValue;
+ }
+ }
}
}
}
// get the windows list from the Python module by calling views() method
- PyObjWrapper res2( PyObject_CallMethod( myModule, "views", "" ) );
- if( !res2 ) {
- // VSR: this method may not be implemented in Python module
- // PyErr_Print();
- PyErr_Clear();
- }
- else {
- // parse the return value
- // result can be one string...
- if ( PyString_Check( res2 ) ) {
- myViewMgrList.append( PyString_AsString( res2 ) );
+ if(PyObject_HasAttrString(myModule , "views")){
+ PyObjWrapper res2( PyObject_CallMethod( myModule, "views", "" ) );
+ if( !res2 ) {
+ PyErr_Print();
}
- // ... or list of strings
- else if ( PyList_Check( res2 ) ) {
- int size = PyList_Size( res2 );
- for ( int i = 0; i < size; i++ ) {
- PyObject* value = PyList_GetItem( res2, i );
- if( value && PyString_Check( value ) ) {
- myViewMgrList.append( PyString_AsString( value ) );
- }
+ else {
+ // parse the return value
+ // result can be one string...
+ if ( PyString_Check( res2 ) ) {
+ myViewMgrList.append( PyString_AsString( res2 ) );
+ }
+ // ... or list of strings
+ else if ( PyList_Check( res2 ) ) {
+ int size = PyList_Size( res2 );
+ for ( int i = 0; i < size; i++ ) {
+ PyObject* value = PyList_GetItem( res2, i );
+ if( value && PyString_Check( value ) ) {
+ myViewMgrList.append( PyString_AsString( value ) );
+ }
+ }
}
}
}
if ( IsCallOldMethods ) { //__CALL_OLD_METHODS__
// call Python module's setSettings() method (obsolete)
- PyObjWrapper res( PyObject_CallMethod( myModule, "setSettings", "" ) );
- if( !res ) {
- // VSR: this method may not be implemented in Python module
- // PyErr_Print();
- PyErr_Clear();
+ if(PyObject_HasAttrString(myModule , "setSettings")){
+ PyObjWrapper res( PyObject_CallMethod( myModule, "setSettings", "" ) );
+ if( !res ) {
+ PyErr_Print();
+ }
}
} //__CALL_OLD_METHODS__
// call Python module's activate() method (for the new modules)
- PyObjWrapper res1( PyObject_CallMethod( myModule, "activate", "" ) );
- if( !res1 ) {
- // VSR: this method may not be implemented in Python module
- // PyErr_Print();
- PyErr_Clear();
+ if(PyObject_HasAttrString(myModule , "activate")){
+ PyObjWrapper res1( PyObject_CallMethod( myModule, "activate", "" ) );
+ if( !res1 ) {
+ PyErr_Print();
+ }
}
}
return;
}
// then call Python module's deactivate() method
- PyObjWrapper res( PyObject_CallMethod( myModule, "deactivate", "" ) );
- if( !res ) {
- // VSR: this method may not be implemented in Python module
- // PyErr_Print();
- PyErr_Clear();
+ if(PyObject_HasAttrString(myModule , "deactivate")){
+ PyObjWrapper res( PyObject_CallMethod( myModule, "deactivate", "" ) );
+ if( !res ) {
+ PyErr_Print();
+ }
}
}
PyLockWrapper aLock = myInterp->GetLockWrapper();
// call Python module's activeStudyChanged() method
- PyObjWrapper res( PyObject_CallMethod( myModule, "activeStudyChanged", "i", aStudyId ) );
- if( !res ) {
- // VSR: this method may not be implemented in Python module
- // PyErr_Print();
- PyErr_Clear();
+ if(PyObject_HasAttrString(myModule , "activeStudyChanged")){
+ PyObjWrapper res( PyObject_CallMethod( myModule, "activeStudyChanged", "i", aStudyId ) );
+ if( !res ) {
+ PyErr_Print();
+ }
}
}
return;
QString aContext( theContext ), aObject( "" ), aParent( "" );
-
- if ( IsCallOldMethods ) { //__CALL_OLD_METHODS__
+
+ if ( IsCallOldMethods && PyObject_HasAttrString(myModule , "definePopup") ) { //__CALL_OLD_METHODS__
// call definePopup() Python module's function
// this is obsolete function, used only for compatibility reasons
PyObjWrapper res(PyObject_CallMethod( myModule,
aObject.latin1(),
aParent.latin1() ) );
if( !res ) {
- // VSR: this method may not be implemented in Python module
- // PyErr_Print();
- PyErr_Clear();
+ PyErr_Print();
}
else {
// parse return value
PyObjWrapper sipPopup( sipBuildResult( 0, "M", thePopupMenu, sipClass_QPopupMenu ) );
// then call Python module's createPopupMenu() method (for new modules)
- PyObjWrapper res1( PyObject_CallMethod( myModule,
+ if ( PyObject_HasAttrString(myModule , "createPopupMenu") ) {
+ PyObjWrapper res1( PyObject_CallMethod( myModule,
"createPopupMenu",
"Os",
sipPopup.get(),
aContext.latin1() ) );
- if( !res1 ) {
- // VSR: this method may not be implemented in Python module
- // PyErr_Print();
- PyErr_Clear();
+ if( !res1 ) {
+ PyErr_Print();
+ }
}
- if ( IsCallOldMethods ) { //__CALL_OLD_METHODS__
+ if ( IsCallOldMethods && PyObject_HasAttrString(myModule , "customPopup") ) { //__CALL_OLD_METHODS__
// call customPopup() Python module's function
// this is obsolete function, used only for compatibility reasons
PyObjWrapper res2( PyObject_CallMethod( myModule,
aObject.latin1(),
aParent.latin1() ) );
if( !res2 ) {
- // VSR: this method may not be implemented in Python module
- // PyErr_Print();
- PyErr_Clear();
+ PyErr_Print();
}
} //__CALL_OLD_METHODS__
}
if ( !myInterp || !myModule )
return;
- PyObjWrapper res( PyObject_CallMethod( myModule, "OnGUIEvent", "i", theId ) );
- if( !res ) {
- // VSR: this method may not be implemented in Python module
- // PyErr_Print();
- PyErr_Clear();
+ if ( PyObject_HasAttrString(myModule , "OnGUIEvent") ) {
+ PyObjWrapper res( PyObject_CallMethod( myModule, "OnGUIEvent", "i", theId ) );
+ if( !res ) {
+ PyErr_Print();
+ }
}
}
}
PyObjWrapper pyws( sipBuildResult( 0, "M", aWorkspace, sipClass_QWidget ) );
// ... and finally call Python module's setWorkspace() method (obsolete)
- PyObjWrapper res( PyObject_CallMethod( myModule, "setWorkSpace", "O", pyws.get() ) );
- if( !res ) {
- // VSR: this method may not be implemented in Python module
- // PyErr_Print();
- PyErr_Clear();
+ if ( PyObject_HasAttrString(myModule , "setWorkSpace") ) {
+ PyObjWrapper res( PyObject_CallMethod( myModule, "setWorkSpace", "O", pyws.get() ) );
+ if( !res ) {
+ PyErr_Print();
+ }
}
} //__CALL_OLD_METHODS__
}
*/
SCRUTE(KERNEL_PYTHON::_gtstate);
_tstate = KERNEL_PYTHON::_gtstate;
- PyEval_AcquireLock();
- PyThreadState_Swap(_tstate);
+ PyEval_AcquireThread(_tstate);
SCRUTE(_tstate);
+ PyEval_ReleaseThread(_tstate);
return true;
}
PyErr_Print();
return -1;
}
-#if PY_VERSION_HEX < 0x02040000 // python version earlier than 2.4.0
- PyObject *r = PyEval_EvalCode(code,_g,_g);
-#else
- PyObject *r = PyEval_EvalCode((PyCodeObject*)code,_g,_g);
-#endif
+ //#if PY_VERSION_HEX < 0x02040000 // python version earlier than 2.4.0
+ // PyObject *r = PyEval_EvalCode(code,_g,_g);
+ //#else
+ PyObject *r = PyEval_EvalCode((PyCodeObject *)code,_g,_g);
+ //#endif
Py_DECREF(code);
if(!r){
// Une erreur s est produite a l execution
Py_DECREF(r);
return 0;
}
-
static const QString getActiveComponent();
static void updateObjBrowser( const int = 0, bool = true );
- static QString getFileName ( QWidget*, const QString&, const QStringList&, const QString&, bool );
+ static QString getFileName ( QWidget*, const QString&, const QStringList&, const QString&, bool ) /ReleaseGIL/ ;
static QStringList getOpenFileNames ( QWidget*, const QString&, const QStringList&, const QString& );
static QString getExistingDirectory( QWidget*, const QString&, const QString& );
createAction( FileSaveAsId, tr( "TOT_DESK_FILE_SAVEAS" ), QIconSet(),
tr( "MEN_DESK_FILE_SAVEAS" ), tr( "PRP_DESK_FILE_SAVEAS" ),
- 0, desk, false, this, SLOT( onSaveAsDoc() ) );
+ CTRL+Key_A, desk, false, this, SLOT( onSaveAsDoc() ) );
createAction( EditCopyId, tr( "TOT_DESK_EDIT_COPY" ),
resMgr->loadPixmap( "STD", tr( "ICON_EDIT_COPY" ) ),
QAction* a = createAction( ViewStatusBarId, tr( "TOT_DESK_VIEW_STATUSBAR" ),
QIconSet(), tr( "MEN_DESK_VIEW_STATUSBAR" ),
- tr( "PRP_DESK_VIEW_STATUSBAR" ), 0, desk, true );
+ tr( "PRP_DESK_VIEW_STATUSBAR" ), SHIFT+Key_S, desk, true );
a->setOn( desk->statusBar()->isVisibleTo( desk ) );
connect( a, SIGNAL( toggled( bool ) ), this, SLOT( onViewStatusBar( bool ) ) );
createAction( HelpAboutId, tr( "TOT_DESK_HELP_ABOUT" ), QIconSet(),
tr( "MEN_DESK_HELP_ABOUT" ), tr( "PRP_DESK_HELP_ABOUT" ),
- 0, desk, false, this, SLOT( onHelpAbout() ) );
+ SHIFT+Key_A, desk, false, this, SLOT( onHelpAbout() ) );
//SRN: BugID IPAL9021, add an action "Load"
createAction( FileLoadId, tr( "TOT_DESK_FILE_LOAD" ),
myWorkstack = new QtxWorkstack( base );
// setting Expanding size policy for central workstack. If there are several widgets
- // in central area of Desktop, other widgets will be added below the workstack (CATHARE, TIRPOLI modules).
+ // in central area of Desktop, other widgets will be added below the workstack (CATHARE, TRIPOLI modules).
// But the workstack must occupy as much space as possible -- set Expanding for it.
myWorkstack->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
msgstr "T&oolbars"
msgid "MEN_DESK_VIEW_STATUSBAR"
-msgstr "Stat&us Bar"
+msgstr "&Status Bar"
msgid "MEN_DESK_VIEW_STDTOOLBAR"
msgstr "&Standard"
/*!
Shows info message box with one button [ static ]
*/
-int SUIT_MessageBox::info1( QWidget* parent, const QString& caption, const QString& text,
- const QString& textButton0 )
+int SUIT_MessageBox::info1( QWidget* parent,
+ const QString& caption,
+ const QString& text,
+ const QString& textButton0 )
{
- SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::arrowCursor );
- int ret = QMessageBox::information( parent, caption, text, textButton0,
- QString::null, QString::null, 0, 0 );
- qApp->processEvents();
- return ret;
+ SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::arrowCursor );
+ int ret = QMessageBox::information( parent, caption, text, textButton0,
+ QString::null, QString::null, 0, 0 );
+ qApp->processEvents();
+ return ret;
}
/*!
Shows warning message box with one button [ static ]
*/
-int SUIT_MessageBox::warn1( QWidget* parent, const QString& caption, const QString& text,
- const QString& textButton0 )
+int SUIT_MessageBox::warn1( QWidget* parent,
+ const QString& caption,
+ const QString& text,
+ const QString& textButton0 )
{
- SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::arrowCursor );
- int ret = QMessageBox::warning( parent, caption, text, textButton0,
- QString::null, QString::null, 0, 0 );
- qApp->processEvents();
- return ret;
+ SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::arrowCursor );
+ int ret = QMessageBox::warning( parent, caption, text, textButton0,
+ QString::null, QString::null, 0, 0 );
+ qApp->processEvents();
+ return ret;
}
/*!
Shows error message box with one button [ static ]
*/
-int SUIT_MessageBox::error1( QWidget* parent, const QString& caption,
- const QString& text, const QString& textButton0 )
+int SUIT_MessageBox::error1( QWidget* parent,
+ const QString& caption,
+ const QString& text,
+ const QString& textButton0 )
{
- SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::arrowCursor );
- int ret = QMessageBox::critical( parent, caption, text, textButton0,
- QString::null, QString::null, 0, 0 );
- qApp->processEvents();
- return ret;
+ SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::arrowCursor );
+ int ret = QMessageBox::critical( parent, caption, text, textButton0,
+ QString::null, QString::null, 0, 0 );
+ qApp->processEvents();
+ return ret;
+}
+
+/*!
+ Shows question message box with one button [ static ]
+*/
+int SUIT_MessageBox::question1( QWidget* parent,
+ const QString& caption,
+ const QString& text,
+ const QString& textButton0 )
+{
+ SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::arrowCursor );
+ int ret = QMessageBox::question( parent, caption, text, textButton0,
+ QString::null, QString::null, 0, 0 );
+ qApp->processEvents();
+ return ret;
}
/*!
Shows info message box with two buttons.
Returns id of the pressed button or -1 if escaped [ static ]
*/
-int SUIT_MessageBox::info2( QWidget* parent, const QString& caption,
- const QString& text, const QString& textButton0,
- const QString& textButton1, int idButton0, int idButton1, int idDefault )
+int SUIT_MessageBox::info2( QWidget* parent,
+ const QString& caption,
+ const QString& text,
+ const QString& textButton0,
+ const QString& textButton1,
+ int idButton0, int idButton1, int idDefault )
{
- SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::arrowCursor );
- if ( idDefault == idButton0 )
- idDefault = 0;
- else if ( idDefault == idButton1 )
- idDefault = 1;
- else
- idDefault = 0;
-
- int ret = QMessageBox::information( parent, caption, text, textButton0,
- textButton1, QString::null, idDefault );
- qApp->processEvents();
- return ( ret == 0 ? idButton0 : idButton1 );
+ SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::arrowCursor );
+ if ( idDefault == idButton0 )
+ idDefault = 0;
+ else if ( idDefault == idButton1 )
+ idDefault = 1;
+ else
+ idDefault = 0;
+
+ int ret = QMessageBox::information( parent, caption, text, textButton0,
+ textButton1, QString::null, idDefault );
+ qApp->processEvents();
+ return ( ret == 0 ? idButton0 : idButton1 );
}
/*!
- Shows warning message box with two buttons.
+ Shows warning message box with two buttons.
Returns id of the pressed button or -1 if escaped [ static ]
*/
-int SUIT_MessageBox::warn2( QWidget* parent, const QString& caption, const QString& text,
- const QString& textButton0, const QString& textButton1,
- int idButton0, int idButton1, int idDefault )
+int SUIT_MessageBox::warn2( QWidget* parent,
+ const QString& caption,
+ const QString& text,
+ const QString& textButton0,
+ const QString& textButton1,
+ int idButton0, int idButton1, int idDefault )
{
- SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::arrowCursor );
-
- if ( idDefault == idButton0 )
- idDefault = 0;
- else if ( idDefault == idButton1 )
- idDefault = 1;
- else
- idDefault = 0;
-
- int ret = QMessageBox::warning( parent, caption, text, textButton0,
- textButton1, QString::null, idDefault );
- qApp->processEvents();
- return ( ret == 0 ? idButton0 : idButton1 );
+ SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::arrowCursor );
+
+ if ( idDefault == idButton0 )
+ idDefault = 0;
+ else if ( idDefault == idButton1 )
+ idDefault = 1;
+ else
+ idDefault = 0;
+
+ int ret = QMessageBox::warning( parent, caption, text, textButton0,
+ textButton1, QString::null, idDefault );
+ qApp->processEvents();
+ return ( ret == 0 ? idButton0 : idButton1 );
}
/*!
Shows error message box with two buttons
Returns id of the pressed button or -1 if escaped [ static ]
*/
-int SUIT_MessageBox::error2( QWidget* parent, const QString& caption, const QString& text,
- const QString& textButton0, const QString& textButton1,
- int idButton0, int idButton1, int idDefault )
+int SUIT_MessageBox::error2( QWidget* parent,
+ const QString& caption,
+ const QString& text,
+ const QString& textButton0,
+ const QString& textButton1,
+ int idButton0, int idButton1, int idDefault )
{
- SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::arrowCursor );
-
- if ( idDefault == idButton0 )
- idDefault = 0;
- else if ( idDefault == idButton1 )
- idDefault = 1;
- else
- idDefault = 0;
+ SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::arrowCursor );
+
+ if ( idDefault == idButton0 )
+ idDefault = 0;
+ else if ( idDefault == idButton1 )
+ idDefault = 1;
+ else
+ idDefault = 0;
+
+ int ret = QMessageBox::critical( parent, caption, text, textButton0,
+ textButton1, QString::null, idDefault );
+ qApp->processEvents();
+ return ( ret == 0 ? idButton0 : idButton1 );
+}
- int ret = QMessageBox::critical( parent, caption, text, textButton0,
- textButton1, QString::null, idDefault );
- qApp->processEvents();
- return ( ret == 0 ? idButton0 : idButton1 );
+/*!
+ Shows question message box with two buttons
+ Returns id of the pressed button or -1 if escaped [ static ]
+*/
+int SUIT_MessageBox::question2( QWidget* parent,
+ const QString& caption,
+ const QString& text,
+ const QString& textButton0,
+ const QString& textButton1,
+ int idButton0, int idButton1, int idDefault )
+{
+ SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::arrowCursor );
+
+ if ( idDefault == idButton0 )
+ idDefault = 0;
+ else if ( idDefault == idButton1 )
+ idDefault = 1;
+ else
+ idDefault = 0;
+
+ int ret = QMessageBox::question( parent, caption, text, textButton0,
+ textButton1, QString::null, idDefault );
+ qApp->processEvents();
+ return ( ret == 0 ? idButton0 : idButton1 );
}
/*!
Shows info message box with three buttons.
Returns id of the pressed button or -1 if escaped [ static ]
*/
-int SUIT_MessageBox::info3( QWidget* parent, const QString& caption, const QString& text,
- const QString& textButton0, const QString& textButton1,
- const QString& textButton2, int idButton0, int idButton1,
- int idButton2, int idDefault )
+int SUIT_MessageBox::info3( QWidget* parent,
+ const QString& caption,
+ const QString& text,
+ const QString& textButton0,
+ const QString& textButton1,
+ const QString& textButton2,
+ int idButton0, int idButton1,
+ int idButton2, int idDefault )
{
- SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::arrowCursor );
-
- if ( idDefault == idButton0 )
- idDefault = 0;
- else if ( idDefault == idButton1 )
- idDefault = 1;
- else if ( idDefault == idButton2 )
- idDefault = 2;
- else
- idDefault = 0;
-
- int ret = QMessageBox::information( parent, caption, text, textButton0,
- textButton1, textButton2, idDefault );
- qApp->processEvents();
- switch ( ret )
+ SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::arrowCursor );
+
+ if ( idDefault == idButton0 )
+ idDefault = 0;
+ else if ( idDefault == idButton1 )
+ idDefault = 1;
+ else if ( idDefault == idButton2 )
+ idDefault = 2;
+ else
+ idDefault = 0;
+
+ int ret = QMessageBox::information( parent, caption, text, textButton0,
+ textButton1, textButton2, idDefault );
+ qApp->processEvents();
+ switch ( ret )
{
- case 0:
- return idButton0;
- case 1:
- return idButton1;
- case 2:
- return idButton2;
+ case 0:
+ return idButton0;
+ case 1:
+ return idButton1;
+ case 2:
+ return idButton2;
}
- return -1;
+ return -1;
}
/*!
Shows warning message box with three buttons.
Returns id of the pressed button or -1 if escaped [ static ]
*/
-int SUIT_MessageBox::warn3( QWidget* parent, const QString& caption, const QString& text,
- const QString& textButton0, const QString& textButton1,
- const QString& textButton2, int idButton0, int idButton1,
- int idButton2, int idDefault )
+int SUIT_MessageBox::warn3( QWidget* parent,
+ const QString& caption,
+ const QString& text,
+ const QString& textButton0,
+ const QString& textButton1,
+ const QString& textButton2,
+ int idButton0, int idButton1,
+ int idButton2, int idDefault )
{
- SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::arrowCursor );
-
- if ( idDefault == idButton0 )
- idDefault = 0;
- else if ( idDefault == idButton1 )
- idDefault = 1;
- else if ( idDefault == idButton2 )
- idDefault = 2;
- else
- idDefault = 0;
-
- int ret = QMessageBox::warning( parent, caption, text, textButton0,
- textButton1, textButton2, idDefault );
- qApp->processEvents();
- switch ( ret )
+ SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::arrowCursor );
+
+ if ( idDefault == idButton0 )
+ idDefault = 0;
+ else if ( idDefault == idButton1 )
+ idDefault = 1;
+ else if ( idDefault == idButton2 )
+ idDefault = 2;
+ else
+ idDefault = 0;
+
+ int ret = QMessageBox::warning( parent, caption, text, textButton0,
+ textButton1, textButton2, idDefault );
+ qApp->processEvents();
+ switch ( ret )
{
- case 0:
- return idButton0;
- case 1:
- return idButton1;
- case 2:
- return idButton2;
+ case 0:
+ return idButton0;
+ case 1:
+ return idButton1;
+ case 2:
+ return idButton2;
}
- return -1;
+ return -1;
}
/*!
Shows error message box with three buttons.
Returns id of the pressed button or -1 if escaped [ static ]
*/
-int SUIT_MessageBox::error3( QWidget* parent, const QString& caption, const QString& text,
- const QString& textButton0, const QString& textButton1,
- const QString& textButton2, int idButton0, int idButton1,
- int idButton2, int idDefault )
+int SUIT_MessageBox::error3( QWidget* parent,
+ const QString& caption,
+ const QString& text,
+ const QString& textButton0,
+ const QString& textButton1,
+ const QString& textButton2,
+ int idButton0, int idButton1,
+ int idButton2, int idDefault )
{
- SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::arrowCursor );
-
- if ( idDefault == idButton0 )
- idDefault = 0;
- else if ( idDefault == idButton1 )
- idDefault = 1;
- else if ( idDefault == idButton2 )
- idDefault = 2;
- else
- idDefault = 0;
+ SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::arrowCursor );
+
+ if ( idDefault == idButton0 )
+ idDefault = 0;
+ else if ( idDefault == idButton1 )
+ idDefault = 1;
+ else if ( idDefault == idButton2 )
+ idDefault = 2;
+ else
+ idDefault = 0;
+
+ int ret = QMessageBox::critical( parent, caption, text, textButton0,
+ textButton1, textButton2, idDefault );
+ qApp->processEvents();
+ switch ( ret )
+ {
+ case 0:
+ return idButton0;
+ case 1:
+ return idButton1;
+ case 2:
+ return idButton2;
+ }
+ return -1;
+}
- int ret = QMessageBox::critical( parent, caption, text, textButton0,
- textButton1, textButton2, idDefault );
- qApp->processEvents();
- switch ( ret )
+/*!
+ Shows question message box with three buttons.
+ Returns id of the pressed button or -1 if escaped [ static ]
+*/
+int SUIT_MessageBox::question3( QWidget* parent,
+ const QString& caption,
+ const QString& text,
+ const QString& textButton0,
+ const QString& textButton1,
+ const QString& textButton2,
+ int idButton0, int idButton1,
+ int idButton2, int idDefault )
+{
+ SUIT_OverrideCursor cw( parent ? parent->cursor() : Qt::arrowCursor );
+
+ if ( idDefault == idButton0 )
+ idDefault = 0;
+ else if ( idDefault == idButton1 )
+ idDefault = 1;
+ else if ( idDefault == idButton2 )
+ idDefault = 2;
+ else
+ idDefault = 0;
+
+ int ret = QMessageBox::question( parent, caption, text, textButton0,
+ textButton1, textButton2, idDefault );
+ qApp->processEvents();
+ switch ( ret )
{
- case 0:
- return idButton0;
- case 1:
- return idButton1;
- case 2:
- return idButton2;
+ case 0:
+ return idButton0;
+ case 1:
+ return idButton1;
+ case 2:
+ return idButton2;
}
- return -1;
+ return -1;
}
const QString& textButton0 );
static int error1 ( QWidget* parent, const QString& caption, const QString& text,
const QString& textButton0 );
+ static int question1 ( QWidget* parent, const QString& caption, const QString& text,
+ const QString& textButton0 );
//@}
/** @name Two buttons message boxes.*/
static int error2 ( QWidget* parent, const QString& caption, const QString& text,
const QString& textButton0, const QString& textButton1,
int idButton0, int idButton1, int idDefault );
+ static int question2 ( QWidget* parent, const QString& caption, const QString& text,
+ const QString& textButton0, const QString& textButton1,
+ int idButton0, int idButton1, int idDefault );
//@}
/** @name Three buttons message boxes.*/
const QString& textButton0, const QString& textButton1,
const QString& textButton2, int idButton0, int idButton1,
int idButton2, int idDefault );
+ static int question3 ( QWidget* parent, const QString& caption, const QString& text,
+ const QString& textButton0, const QString& textButton1,
+ const QString& textButton2, int idButton0, int idButton1,
+ int idButton2, int idDefault );
//@}
};
//
// See http://www.salome-platform.org/
//
-#include <qpopupmenu.h>\r
-#include <qcolordialog.h>\r
-\r
-#include <vtkCamera.h>\r
-#include <vtkRenderer.h>\r
-#include <vtkActorCollection.h>\r
-\r
-#include "SUIT_Session.h"\r
-\r
-#include "SVTK_Selection.h"\r
-#include "SVTK_ViewModel.h"\r
-#include "SVTK_ViewWindow.h"\r
-#include "SVTK_Prs.h"\r
-\r
-#include "VTKViewer_ViewModel.h"\r
-\r
-#include "SVTK_RenderWindowInteractor.h"\r
-#include "SVTK_RenderWindow.h"\r
-\r
-//#include <ToolsGUI.h>\r
-\r
-#include <SALOME_Actor.h>\r
-#include <SALOME_InteractiveObject.hxx>\r
-\r
-// Temporarily commented to avoid awful dependecy on SALOMEDS\r
-// TODO: better mechanism of storing display/erse status in a study\r
-// should be provided...\r
-//#include "Utils_ORB_INIT.hxx"\r
-//#include "Utils_SINGLETON.hxx"\r
-//#include "SALOME_ModuleCatalog_impl.hxx"\r
-//#include "SALOME_NamingService.hxx"\r
-\r
-//#include "SALOMEDSClient.hxx"\r
-//#include "SALOMEDS_StudyManager.hxx"\r
-\r
-// in order NOT TO link with SalomeApp, here the code returns SALOMEDS_Study.\r
-// SalomeApp_Study::studyDS() does it as well, but -- here it is retrieved from \r
-// SALOMEDS::StudyManager - no linkage with SalomeApp. \r
-\r
-// Temporarily commented to avoid awful dependecy on SALOMEDS\r
-// TODO: better mechanism of storing display/erse status in a study\r
-// should be provided...\r
-//static _PTR(Study) getStudyDS() \r
-//{\r
-// SALOMEDSClient_Study* aStudy = NULL;\r
-// _PTR(StudyManager) aMgr( new SALOMEDS_StudyManager() );\r
- // get id of SUIT_Study, if it's a SalomeApp_Study, it will return\r
- // id of its underlying SALOMEDS::Study\r
-// SUIT_Application* app = SUIT_Session::session()->activeApplication();\r
-// if ( !app ) return _PTR(Study)(aStudy); \r
-// SUIT_Study* stud = app->activeStudy();\r
-// if ( !stud ) return _PTR(Study)(aStudy); \r
-// const int id = stud->id(); // virtual method, must return SALOMEDS_Study id\r
- // get SALOMEDS_Study with this id from StudyMgr\r
-// return aMgr->GetStudyByID( id );\r
-//}\r
-\r
-//==========================================================\r
-SVTK_Viewer::SVTK_Viewer()\r
-{\r
- myTrihedronSize = 100;\r
-}\r
-\r
-//==========================================================\r
-SVTK_Viewer::~SVTK_Viewer() \r
-{\r
-}\r
-\r
-QColor SVTK_Viewer::backgroundColor() const\r
-{\r
- return myBgColor;\r
-}\r
-\r
-void SVTK_Viewer::setBackgroundColor( const QColor& c )\r
-{\r
- if ( c.isValid() )\r
- myBgColor = c;\r
-}\r
-\r
-//==========================================================\r
-SUIT_ViewWindow* SVTK_Viewer::createView( SUIT_Desktop* theDesktop )\r
-{\r
- SVTK_ViewWindow* vw = new SVTK_ViewWindow( theDesktop, this );\r
- vw->setBackgroundColor( backgroundColor() );\r
- vw->SetTrihedronSize( trihedronSize() );\r
- return vw;\r
-}\r
-\r
-int SVTK_Viewer::trihedronSize() const\r
-{\r
- return myTrihedronSize;\r
-}\r
-\r
-void SVTK_Viewer::setTrihedronSize( const int sz )\r
-{\r
- myTrihedronSize = sz;\r
-\r
- SUIT_ViewManager* vm = getViewManager();\r
- if ( !vm )\r
- return;\r
-\r
- QPtrVector<SUIT_ViewWindow> vec = vm->getViews();\r
- for ( int i = 0; i < vec.count(); i++ )\r
- {\r
- SUIT_ViewWindow* win = vec.at( i );\r
- if ( !win || !win->inherits( "SVTK_ViewWindow" ) )\r
- continue;\r
-\r
- SVTK_ViewWindow* vw = (SVTK_ViewWindow*)win;\r
- vw->SetTrihedronSize( sz );\r
- }\r
-}\r
-\r
-//==========================================================\r
-void SVTK_Viewer::setViewManager(SUIT_ViewManager* theViewManager)\r
-{\r
- SUIT_ViewModel::setViewManager(theViewManager);\r
-\r
- if ( !theViewManager )\r
- return;\r
-\r
- connect(theViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)), \r
- this, SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*)));\r
- \r
- connect(theViewManager, SIGNAL(mouseMove(SUIT_ViewWindow*, QMouseEvent*)), \r
- this, SLOT(onMouseMove(SUIT_ViewWindow*, QMouseEvent*)));\r
- \r
- connect(theViewManager, SIGNAL(mouseRelease(SUIT_ViewWindow*, QMouseEvent*)), \r
- this, SLOT(onMouseRelease(SUIT_ViewWindow*, QMouseEvent*)));\r
-}\r
-\r
-//==========================================================\r
-void SVTK_Viewer::contextMenuPopup( QPopupMenu* thePopup )\r
-{\r
- thePopup->insertItem( VTKViewer_Viewer::tr( "MEN_DUMP_VIEW" ), this, SLOT( onDumpView() ) );\r
- thePopup->insertItem( VTKViewer_Viewer::tr( "MEN_CHANGE_BACKGROUD" ), this, SLOT( onChangeBgColor() ) );\r
-\r
- thePopup->insertSeparator();\r
-\r
- SVTK_ViewWindow* aView = (SVTK_ViewWindow*)(myViewManager->getActiveView());\r
- if ( aView && !aView->getToolBar()->isVisible() )\r
- thePopup->insertItem( VTKViewer_Viewer::tr( "MEN_SHOW_TOOLBAR" ), this, SLOT( onShowToolbar() ) );\r
-}\r
-\r
-//==========================================================\r
-void SVTK_Viewer::onMousePress(SUIT_ViewWindow* vw, QMouseEvent* event)\r
-{\r
- if(SVTK_ViewWindow* aVW = dynamic_cast<SVTK_ViewWindow*>(vw)){\r
- if(SVTK_RenderWindowInteractor* aRWI = aVW->getRWInteractor()){\r
- switch(event->button()) {\r
- case LeftButton:\r
- aRWI->LeftButtonPressed(event) ;\r
- break ;\r
- case MidButton:\r
- aRWI->MiddleButtonPressed(event) ;\r
- break ;\r
- case RightButton:\r
- aRWI->RightButtonPressed(event) ;\r
- break;\r
- default:\r
- break ;\r
- }\r
- }\r
- }\r
-}\r
-\r
-//==========================================================\r
-void \r
-SVTK_Viewer\r
-::onMouseMove(SUIT_ViewWindow* vw, QMouseEvent* event)\r
-{\r
- if(SVTK_ViewWindow* aVW = dynamic_cast<SVTK_ViewWindow*>(vw)){\r
- if(SVTK_RenderWindowInteractor* aRWI = aVW->getRWInteractor()){\r
- aRWI->MouseMove( event );\r
- }\r
- }\r
-}\r
-\r
-//==========================================================\r
-void \r
-SVTK_Viewer\r
-::onMouseRelease(SUIT_ViewWindow* vw, QMouseEvent* event)\r
-{\r
- if(SVTK_ViewWindow* aVW = dynamic_cast<SVTK_ViewWindow*>(vw)){\r
- if(SVTK_RenderWindowInteractor* aRWI = aVW->getRWInteractor()){\r
- switch(event->button()) {\r
- case LeftButton:\r
- aRWI->LeftButtonReleased(event) ;\r
- break ;\r
- case MidButton:\r
- aRWI->MiddleButtonReleased(event) ;\r
- break ;\r
- case RightButton:\r
- aRWI->RightButtonReleased(event) ;\r
- break;\r
- default:\r
- break ;\r
- }\r
- }\r
- }\r
-}\r
-\r
-//==========================================================\r
-void \r
-SVTK_Viewer\r
-::enableSelection(bool isEnabled)\r
-{\r
- mySelectionEnabled = isEnabled;\r
- //!! To be done for view windows\r
-}\r
-\r
-//==========================================================\r
-void\r
-SVTK_Viewer\r
-::enableMultiselection(bool isEnable)\r
-{\r
- myMultiSelectionEnabled = isEnable;\r
- //!! To be done for view windows\r
-}\r
-\r
-void SVTK_Viewer::onDumpView()\r
-{\r
- SVTK_ViewWindow* aView = (SVTK_ViewWindow*)(myViewManager->getActiveView());\r
- if ( aView )\r
- aView->onDumpView();\r
-}\r
-\r
-//==========================================================\r
-void SVTK_Viewer::onChangeBgColor()\r
-{\r
- QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();\r
- for(int i = 0, iEnd = aViews.size(); i < iEnd; i++)\r
- if(SUIT_ViewWindow* aViewWindow = aViews.at(i))\r
- if(SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(aViewWindow)){\r
- QColor aColor = QColorDialog::getColor( aView->backgroundColor(), aView);\r
- if ( aColor.isValid() )\r
- aView->setBackgroundColor(aColor);\r
- }\r
-}\r
-\r
-//==========================================================\r
-void\r
-SVTK_Viewer\r
-::onShowToolbar() \r
-{\r
- QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();\r
- for(int i = 0, iEnd = aViews.size(); i < iEnd; i++)\r
- if(SUIT_ViewWindow* aViewWindow = aViews.at(i))\r
- if(SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(aViewWindow))\r
- aView->getToolBar()->show(); \r
-}\r
-\r
-//==========================================================\r
-void\r
-SVTK_Viewer\r
-::Display( const SALOME_VTKPrs* prs )\r
-{\r
- // try do downcast object\r
- if(const SVTK_Prs* aPrs = dynamic_cast<const SVTK_Prs*>( prs )){\r
- if(aPrs->IsNull())\r
- return;\r
- if(vtkActorCollection* anActorCollection = aPrs->GetObjects()){\r
- // get SALOMEDS Study\r
- // Temporarily commented to avoid awful dependecy on SALOMEDS\r
- // TODO: better mechanism of storing display/erse status in a study\r
- // should be provided...\r
- // _PTR(Study) aStudy(getStudyDS());\r
- anActorCollection->InitTraversal();\r
- while(vtkActor* anActor = anActorCollection->GetNextActor()){\r
- if(SALOME_Actor* anAct = SALOME_Actor::SafeDownCast(anActor)){\r
- // Set visibility flag\r
- // Temporarily commented to avoid awful dependecy on SALOMEDS\r
- // TODO: better mechanism of storing display/erse status in a study\r
- // should be provided...\r
- //Handle(SALOME_InteractiveObject) anObj = anAct->getIO();\r
- //if(!anObj.IsNull() && anObj->hasEntry() && aStudy){\r
- // ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),true,this);\r
- //}\r
- // just display the object\r
- QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();\r
- for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){\r
- if(SUIT_ViewWindow* aViewWindow = aViews.at(i)){\r
- if(SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(aViewWindow)){\r
- if(SVTK_RenderWindowInteractor* aRWI = aView->getRWInteractor()){\r
- aRWI->Display(anAct,false);\r
- if(anAct->IsSetCamera()){\r
- vtkRenderer* aRenderer = aView->getRenderer();\r
- anAct->SetCamera( aRenderer->GetActiveCamera() );\r
- }\r
- }\r
- }\r
- }\r
- }\r
- }\r
- }\r
- }\r
- }\r
-}\r
-\r
-//==========================================================\r
-void\r
-SVTK_Viewer\r
-::Erase( const SALOME_VTKPrs* prs, const bool forced )\r
-{\r
- // try do downcast object\r
- if(const SVTK_Prs* aPrs = dynamic_cast<const SVTK_Prs*>( prs )){\r
- if(aPrs->IsNull())\r
- return;\r
- if(vtkActorCollection* anActorCollection = aPrs->GetObjects()){\r
- // get SALOMEDS Study\r
- // Temporarily commented to avoid awful dependecy on SALOMEDS\r
- // TODO: better mechanism of storing display/erse status in a study\r
- // should be provided...\r
- //_PTR(Study) aStudy(getStudyDS());\r
- anActorCollection->InitTraversal();\r
- while(vtkActor* anActor = anActorCollection->GetNextActor())\r
- if(SALOME_Actor* anAct = SALOME_Actor::SafeDownCast(anActor)){\r
- // Set visibility flag\r
- // Temporarily commented to avoid awful dependecy on SALOMEDS\r
- // TODO: better mechanism of storing display/erse status in a study\r
- // should be provided...\r
- //Handle(SALOME_InteractiveObject) anObj = anAct->getIO();\r
- //if(!anObj.IsNull() && anObj->hasEntry() && aStudy){\r
- // ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),false,this);\r
- //}\r
- // just display the object\r
- QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();\r
- for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){\r
- if(SUIT_ViewWindow* aViewWindow = aViews.at(i))\r
- if(SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(aViewWindow))\r
- if(SVTK_RenderWindowInteractor* aRWI = aView->getRWInteractor())\r
- if ( forced )\r
- aRWI->Remove(anAct,false);\r
- else\r
- aRWI->Erase(anAct,forced);\r
- }\r
- }\r
- }\r
- }\r
-}\r
- \r
-//==========================================================\r
-void\r
-SVTK_Viewer\r
-::EraseAll( const bool forced )\r
-{\r
- // Temporarily commented to avoid awful dependecy on SALOMEDS\r
- // TODO: better mechanism of storing display/erse status in a study\r
- // should be provided...\r
- //_PTR(Study) aStudy(getStudyDS());\r
- QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();\r
- for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){\r
- if(SUIT_ViewWindow* aViewWindow = aViews.at(i)){\r
- if(SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(aViewWindow)){\r
- vtkRenderer* aRenderer = aView->getRenderer();\r
- vtkActorCollection* anActorCollection = aRenderer->GetActors();\r
- anActorCollection->InitTraversal();\r
- while(vtkActor* anActor = anActorCollection->GetNextActor()){\r
- if(SALOME_Actor* anAct = SALOME_Actor::SafeDownCast(anActor)){\r
- // Set visibility flag\r
- // Temporarily commented to avoid awful dependecy on SALOMEDS\r
- // TODO: better mechanism of storing display/erse status in a study\r
- // should be provided...\r
- //Handle(SALOME_InteractiveObject) anObj = anAct->getIO();\r
- //if(!anObj.IsNull() && anObj->hasEntry() && aStudy)\r
- // ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),false,this);\r
- if(forced)\r
- aRenderer->RemoveActor(anAct);\r
- else{\r
- // just erase actor\r
- anAct->SetVisibility( false );\r
- // erase dependent actors\r
- vtkActorCollection* aCollection = vtkActorCollection::New();\r
- anAct->GetChildActors( aCollection );\r
- aCollection->InitTraversal();\r
- while(vtkActor* aSubAct = aCollection->GetNextActor())\r
- aSubAct->SetVisibility( false );\r
- aCollection->Delete();\r
- }\r
- }\r
- }\r
- }\r
- }\r
- }\r
- Repaint();\r
-}\r
-\r
-//==========================================================\r
-SALOME_Prs* \r
-SVTK_Viewer\r
-::CreatePrs( const char* entry )\r
-{\r
- SVTK_Prs* prs = new SVTK_Prs();\r
- if ( entry ) {\r
- vtkRenderer* rnr = ( (SVTK_ViewWindow*) getViewManager()->getActiveView() )->getRenderer();\r
- vtkActorCollection* theActors = rnr->GetActors();\r
- theActors->InitTraversal();\r
- vtkActor* ac;\r
- while( ( ac = theActors->GetNextActor() ) ) {\r
- SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( ac );\r
- if ( anActor && anActor->hasIO() && !strcmp( anActor->getIO()->getEntry(), entry ) ) {\r
- prs->AddObject( ac );\r
- }\r
- }\r
- }\r
- return prs;\r
-}\r
-\r
-//==========================================================\r
-void\r
-SVTK_Viewer\r
-::BeforeDisplay( SALOME_Displayer* d )\r
-{\r
- d->BeforeDisplay( this, SALOME_VTKViewType() );\r
-}\r
-\r
-//==========================================================\r
-void\r
-SVTK_Viewer::AfterDisplay( SALOME_Displayer* d )\r
-{\r
- d->AfterDisplay( this, SALOME_VTKViewType() );\r
-}\r
-\r
-//==========================================================\r
-bool\r
-SVTK_Viewer\r
-::isVisible( const Handle(SALOME_InteractiveObject)& io )\r
-{\r
- QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();\r
- for(int i = 0, iEnd = aViews.size(); i < iEnd; i++)\r
- if(SUIT_ViewWindow* aViewWindow = aViews.at(i))\r
- if(SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(aViewWindow))\r
- if(SVTK_RenderWindowInteractor* aRWI = aView->getRWInteractor())\r
- if(!aRWI->isVisible( io ))\r
- return false;\r
- return true;\r
-}\r
-\r
-//==========================================================\r
-void \r
-SVTK_Viewer\r
-::Repaint()\r
-{\r
-// if (theUpdateTrihedron) onAdjustTrihedron();\r
- QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();\r
- for(int i = 0, iEnd = aViews.size(); i < iEnd; i++)\r
- if(SUIT_ViewWindow* aViewWindow = aViews.at(i))\r
- if(SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(aViewWindow))\r
- if(SVTK_RenderWindow* aRW = aView->getRenderWindow())\r
- aRW->update();\r
-}\r
-\r
-void \r
-SVTK_Viewer\r
-::onSelectionChanged()\r
-{\r
- emit selectionChanged();\r
-}\r
-\r
+#include <qpopupmenu.h>
+#include <qcolordialog.h>
+
+#include <vtkCamera.h>
+#include <vtkRenderer.h>
+#include <vtkActorCollection.h>
+
+#include "SUIT_Session.h"
+
+#include "SVTK_Selection.h"
+#include "SVTK_ViewModel.h"
+#include "SVTK_ViewWindow.h"
+#include "SVTK_Prs.h"
+
+#include "VTKViewer_ViewModel.h"
+
+#include "SVTK_RenderWindowInteractor.h"
+#include "SVTK_RenderWindow.h"
+
+//#include <ToolsGUI.h>
+
+#include <SALOME_Actor.h>
+#include <SALOME_InteractiveObject.hxx>
+
+// Temporarily commented to avoid awful dependecy on SALOMEDS
+// TODO: better mechanism of storing display/erse status in a study
+// should be provided...
+//#include "Utils_ORB_INIT.hxx"
+//#include "Utils_SINGLETON.hxx"
+//#include "SALOME_ModuleCatalog_impl.hxx"
+//#include "SALOME_NamingService.hxx"
+
+//#include "SALOMEDSClient.hxx"
+//#include "SALOMEDS_StudyManager.hxx"
+
+// in order NOT TO link with SalomeApp, here the code returns SALOMEDS_Study.
+// SalomeApp_Study::studyDS() does it as well, but -- here it is retrieved from
+// SALOMEDS::StudyManager - no linkage with SalomeApp.
+
+// Temporarily commented to avoid awful dependecy on SALOMEDS
+// TODO: better mechanism of storing display/erse status in a study
+// should be provided...
+//static _PTR(Study) getStudyDS()
+//{
+// SALOMEDSClient_Study* aStudy = NULL;
+// _PTR(StudyManager) aMgr( new SALOMEDS_StudyManager() );
+ // get id of SUIT_Study, if it's a SalomeApp_Study, it will return
+ // id of its underlying SALOMEDS::Study
+// SUIT_Application* app = SUIT_Session::session()->activeApplication();
+// if ( !app ) return _PTR(Study)(aStudy);
+// SUIT_Study* stud = app->activeStudy();
+// if ( !stud ) return _PTR(Study)(aStudy);
+// const int id = stud->id(); // virtual method, must return SALOMEDS_Study id
+ // get SALOMEDS_Study with this id from StudyMgr
+// return aMgr->GetStudyByID( id );
+//}
+
+//==========================================================
+SVTK_Viewer::SVTK_Viewer()
+{
+ myTrihedronSize = 100;
+}
+
+//==========================================================
+SVTK_Viewer::~SVTK_Viewer()
+{
+}
+
+QColor SVTK_Viewer::backgroundColor() const
+{
+ return myBgColor;
+}
+
+void SVTK_Viewer::setBackgroundColor( const QColor& c )
+{
+ if ( c.isValid() )
+ myBgColor = c;
+}
+
+//==========================================================
+SUIT_ViewWindow* SVTK_Viewer::createView( SUIT_Desktop* theDesktop )
+{
+ SVTK_ViewWindow* vw = new SVTK_ViewWindow( theDesktop, this );
+ vw->setBackgroundColor( backgroundColor() );
+ vw->SetTrihedronSize( trihedronSize() );
+ return vw;
+}
+
+int SVTK_Viewer::trihedronSize() const
+{
+ return myTrihedronSize;
+}
+
+void SVTK_Viewer::setTrihedronSize( const int sz )
+{
+ myTrihedronSize = sz;
+
+ SUIT_ViewManager* vm = getViewManager();
+ if ( !vm )
+ return;
+
+ QPtrVector<SUIT_ViewWindow> vec = vm->getViews();
+ for ( int i = 0; i < vec.count(); i++ )
+ {
+ SUIT_ViewWindow* win = vec.at( i );
+ if ( !win || !win->inherits( "SVTK_ViewWindow" ) )
+ continue;
+
+ SVTK_ViewWindow* vw = (SVTK_ViewWindow*)win;
+ vw->SetTrihedronSize( sz );
+ }
+}
+
+//==========================================================
+void SVTK_Viewer::setViewManager(SUIT_ViewManager* theViewManager)
+{
+ SUIT_ViewModel::setViewManager(theViewManager);
+
+ if ( !theViewManager )
+ return;
+
+ connect(theViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
+ this, SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*)));
+
+ connect(theViewManager, SIGNAL(mouseMove(SUIT_ViewWindow*, QMouseEvent*)),
+ this, SLOT(onMouseMove(SUIT_ViewWindow*, QMouseEvent*)));
+
+ connect(theViewManager, SIGNAL(mouseRelease(SUIT_ViewWindow*, QMouseEvent*)),
+ this, SLOT(onMouseRelease(SUIT_ViewWindow*, QMouseEvent*)));
+}
+
+//==========================================================
+void SVTK_Viewer::contextMenuPopup( QPopupMenu* thePopup )
+{
+ thePopup->insertItem( VTKViewer_Viewer::tr( "MEN_DUMP_VIEW" ), this, SLOT( onDumpView() ) );
+ thePopup->insertItem( VTKViewer_Viewer::tr( "MEN_CHANGE_BACKGROUD" ), this, SLOT( onChangeBgColor() ) );
+
+ thePopup->insertSeparator();
+
+ SVTK_ViewWindow* aView = (SVTK_ViewWindow*)(myViewManager->getActiveView());
+ if ( aView && !aView->getToolBar()->isVisible() )
+ thePopup->insertItem( VTKViewer_Viewer::tr( "MEN_SHOW_TOOLBAR" ), this, SLOT( onShowToolbar() ) );
+}
+
+//==========================================================
+void SVTK_Viewer::onMousePress(SUIT_ViewWindow* vw, QMouseEvent* event)
+{
+ if(SVTK_ViewWindow* aVW = dynamic_cast<SVTK_ViewWindow*>(vw)){
+ if(SVTK_RenderWindowInteractor* aRWI = aVW->getRWInteractor()){
+ switch(event->button()) {
+ case LeftButton:
+ aRWI->LeftButtonPressed(event) ;
+ break ;
+ case MidButton:
+ aRWI->MiddleButtonPressed(event) ;
+ break ;
+ case RightButton:
+ aRWI->RightButtonPressed(event) ;
+ break;
+ default:
+ break ;
+ }
+ }
+ }
+}
+
+//==========================================================
+void
+SVTK_Viewer
+::onMouseMove(SUIT_ViewWindow* vw, QMouseEvent* event)
+{
+ if(SVTK_ViewWindow* aVW = dynamic_cast<SVTK_ViewWindow*>(vw)){
+ if(SVTK_RenderWindowInteractor* aRWI = aVW->getRWInteractor()){
+ aRWI->MouseMove( event );
+ }
+ }
+}
+
+//==========================================================
+void
+SVTK_Viewer
+::onMouseRelease(SUIT_ViewWindow* vw, QMouseEvent* event)
+{
+ if(SVTK_ViewWindow* aVW = dynamic_cast<SVTK_ViewWindow*>(vw)){
+ if(SVTK_RenderWindowInteractor* aRWI = aVW->getRWInteractor()){
+ switch(event->button()) {
+ case LeftButton:
+ aRWI->LeftButtonReleased(event) ;
+ break ;
+ case MidButton:
+ aRWI->MiddleButtonReleased(event) ;
+ break ;
+ case RightButton:
+ aRWI->RightButtonReleased(event) ;
+ break;
+ default:
+ break ;
+ }
+ }
+ }
+}
+
+//==========================================================
+void
+SVTK_Viewer
+::enableSelection(bool isEnabled)
+{
+ mySelectionEnabled = isEnabled;
+ //!! To be done for view windows
+}
+
+//==========================================================
+void
+SVTK_Viewer
+::enableMultiselection(bool isEnable)
+{
+ myMultiSelectionEnabled = isEnable;
+ //!! To be done for view windows
+}
+
+void SVTK_Viewer::onDumpView()
+{
+ SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(myViewManager->getActiveView());
+ if ( aView )
+ aView->onDumpView();
+}
+
+//==========================================================
+void SVTK_Viewer::onChangeBgColor()
+{
+ SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(myViewManager->getActiveView());
+ if ( aView ) {
+ QColor aColor = QColorDialog::getColor( aView->backgroundColor(), aView );
+ if ( aColor.isValid() )
+ aView->setBackgroundColor( aColor );
+ }
+}
+
+//==========================================================
+void
+SVTK_Viewer
+::onShowToolbar()
+{
+ QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
+ for(int i = 0, iEnd = aViews.size(); i < iEnd; i++)
+ if(SUIT_ViewWindow* aViewWindow = aViews.at(i))
+ if(SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(aViewWindow))
+ aView->getToolBar()->show();
+}
+
+//==========================================================
+void
+SVTK_Viewer
+::Display( const SALOME_VTKPrs* prs )
+{
+ // try do downcast object
+ if(const SVTK_Prs* aPrs = dynamic_cast<const SVTK_Prs*>( prs )){
+ if(aPrs->IsNull())
+ return;
+ if(vtkActorCollection* anActorCollection = aPrs->GetObjects()){
+ // get SALOMEDS Study
+ // Temporarily commented to avoid awful dependecy on SALOMEDS
+ // TODO: better mechanism of storing display/erse status in a study
+ // should be provided...
+ // _PTR(Study) aStudy(getStudyDS());
+ anActorCollection->InitTraversal();
+ while(vtkActor* anActor = anActorCollection->GetNextActor()){
+ if(SALOME_Actor* anAct = SALOME_Actor::SafeDownCast(anActor)){
+ // Set visibility flag
+ // Temporarily commented to avoid awful dependecy on SALOMEDS
+ // TODO: better mechanism of storing display/erse status in a study
+ // should be provided...
+ //Handle(SALOME_InteractiveObject) anObj = anAct->getIO();
+ //if(!anObj.IsNull() && anObj->hasEntry() && aStudy){
+ // ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),true,this);
+ //}
+ // just display the object
+ QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
+ for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
+ if(SUIT_ViewWindow* aViewWindow = aViews.at(i)){
+ if(SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(aViewWindow)){
+ if(SVTK_RenderWindowInteractor* aRWI = aView->getRWInteractor()){
+ aRWI->Display(anAct,false);
+ if(anAct->IsSetCamera()){
+ vtkRenderer* aRenderer = aView->getRenderer();
+ anAct->SetCamera( aRenderer->GetActiveCamera() );
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+//==========================================================
+void
+SVTK_Viewer
+::Erase( const SALOME_VTKPrs* prs, const bool forced )
+{
+ // try do downcast object
+ if(const SVTK_Prs* aPrs = dynamic_cast<const SVTK_Prs*>( prs )){
+ if(aPrs->IsNull())
+ return;
+ if(vtkActorCollection* anActorCollection = aPrs->GetObjects()){
+ // get SALOMEDS Study
+ // Temporarily commented to avoid awful dependecy on SALOMEDS
+ // TODO: better mechanism of storing display/erse status in a study
+ // should be provided...
+ //_PTR(Study) aStudy(getStudyDS());
+ anActorCollection->InitTraversal();
+ while(vtkActor* anActor = anActorCollection->GetNextActor())
+ if(SALOME_Actor* anAct = SALOME_Actor::SafeDownCast(anActor)){
+ // Set visibility flag
+ // Temporarily commented to avoid awful dependecy on SALOMEDS
+ // TODO: better mechanism of storing display/erse status in a study
+ // should be provided...
+ //Handle(SALOME_InteractiveObject) anObj = anAct->getIO();
+ //if(!anObj.IsNull() && anObj->hasEntry() && aStudy){
+ // ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),false,this);
+ //}
+ // just display the object
+ QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
+ for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
+ if(SUIT_ViewWindow* aViewWindow = aViews.at(i))
+ if(SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(aViewWindow))
+ if(SVTK_RenderWindowInteractor* aRWI = aView->getRWInteractor())
+ if ( forced )
+ aRWI->Remove(anAct,false);
+ else
+ aRWI->Erase(anAct,forced);
+ }
+ }
+ }
+ }
+}
+
+//==========================================================
+void
+SVTK_Viewer
+::EraseAll( const bool forced )
+{
+ // Temporarily commented to avoid awful dependecy on SALOMEDS
+ // TODO: better mechanism of storing display/erse status in a study
+ // should be provided...
+ //_PTR(Study) aStudy(getStudyDS());
+ QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
+ for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
+ if(SUIT_ViewWindow* aViewWindow = aViews.at(i)){
+ if(SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(aViewWindow)){
+
+ aView->unHighlightAll();
+
+ vtkRenderer* aRenderer = aView->getRenderer();
+ vtkActorCollection* anActorCollection = aRenderer->GetActors();
+ anActorCollection->InitTraversal();
+ while(vtkActor* anActor = anActorCollection->GetNextActor()){
+ if(SALOME_Actor* anAct = SALOME_Actor::SafeDownCast(anActor)){
+ // Set visibility flag
+ // Temporarily commented to avoid awful dependecy on SALOMEDS
+ // TODO: better mechanism of storing display/erse status in a study
+ // should be provided...
+ //Handle(SALOME_InteractiveObject) anObj = anAct->getIO();
+ //if(!anObj.IsNull() && anObj->hasEntry() && aStudy)
+ // ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),false,this);
+ if(forced)
+ aRenderer->RemoveActor(anAct);
+ else{
+ // just erase actor
+ anAct->SetVisibility( false );
+ // erase dependent actors
+ vtkActorCollection* aCollection = vtkActorCollection::New();
+ anAct->GetChildActors( aCollection );
+ aCollection->InitTraversal();
+ while(vtkActor* aSubAct = aCollection->GetNextActor())
+ aSubAct->SetVisibility( false );
+ aCollection->Delete();
+ }
+ }
+ }
+ }
+ }
+ }
+ Repaint();
+}
+
+//==========================================================
+SALOME_Prs*
+SVTK_Viewer
+::CreatePrs( const char* entry )
+{
+ SVTK_Prs* prs = new SVTK_Prs();
+ if ( entry ) {
+ vtkRenderer* rnr = ( (SVTK_ViewWindow*) getViewManager()->getActiveView() )->getRenderer();
+ vtkActorCollection* theActors = rnr->GetActors();
+ theActors->InitTraversal();
+ vtkActor* ac;
+ while( ( ac = theActors->GetNextActor() ) ) {
+ SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( ac );
+ if ( anActor && anActor->hasIO() && !strcmp( anActor->getIO()->getEntry(), entry ) ) {
+ prs->AddObject( ac );
+ }
+ }
+ }
+ return prs;
+}
+
+//==========================================================
+void
+SVTK_Viewer
+::BeforeDisplay( SALOME_Displayer* d )
+{
+ d->BeforeDisplay( this, SALOME_VTKViewType() );
+}
+
+//==========================================================
+void
+SVTK_Viewer::AfterDisplay( SALOME_Displayer* d )
+{
+ d->AfterDisplay( this, SALOME_VTKViewType() );
+}
+
+//==========================================================
+bool
+SVTK_Viewer
+::isVisible( const Handle(SALOME_InteractiveObject)& io )
+{
+ QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
+ for(int i = 0, iEnd = aViews.size(); i < iEnd; i++)
+ if(SUIT_ViewWindow* aViewWindow = aViews.at(i))
+ if(SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(aViewWindow))
+ if(SVTK_RenderWindowInteractor* aRWI = aView->getRWInteractor())
+ if(!aRWI->isVisible( io ))
+ return false;
+ return true;
+}
+
+//==========================================================
+void
+SVTK_Viewer
+::Repaint()
+{
+// if (theUpdateTrihedron) onAdjustTrihedron();
+ QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
+ for(int i = 0, iEnd = aViews.size(); i < iEnd; i++)
+ if(SUIT_ViewWindow* aViewWindow = aViews.at(i))
+ if(SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(aViewWindow))
+ if(SVTK_RenderWindow* aRW = aView->getRenderWindow())
+ aRW->update();
+}
+
+void
+SVTK_Viewer
+::onSelectionChanged()
+{
+ emit selectionChanged();
+}
+
*/
SalomeApp_Application::~SalomeApp_Application()
{
- SalomeApp_EventFilter::Destroy();
+ // Do not destroy. It's a singleton !
+ //SalomeApp_EventFilter::Destroy();
}
/*!Start application.*/
//! Dump study
createAction( DumpStudyId, tr( "TOT_DESK_FILE_DUMP_STUDY" ), QIconSet(),
tr( "MEN_DESK_FILE_DUMP_STUDY" ), tr( "PRP_DESK_FILE_DUMP_STUDY" ),
- 0, desk, false, this, SLOT( onDumpStudy() ) );
+ CTRL+Key_D, desk, false, this, SLOT( onDumpStudy() ) );
//! Load script
createAction( LoadScriptId, tr( "TOT_DESK_FILE_LOAD_SCRIPT" ), QIconSet(),
tr( "MEN_DESK_FILE_LOAD_SCRIPT" ), tr( "PRP_DESK_FILE_LOAD_SCRIPT" ),
- 0, desk, false, this, SLOT( onLoadScript() ) );
+ CTRL+Key_T, desk, false, this, SLOT( onLoadScript() ) );
//! Properties
createAction( PropertiesId, tr( "TOT_DESK_PROPERTIES" ), QIconSet(),
tr( "MEN_DESK_PROPERTIES" ), tr( "PRP_DESK_PROPERTIES" ),
- 0, desk, false, this, SLOT( onProperties() ) );
+ CTRL+Key_P, desk, false, this, SLOT( onProperties() ) );
//! Catalog Generator
createAction( CatalogGenId, tr( "TOT_DESK_CATALOG_GENERATOR" ), QIconSet(),
tr( "MEN_DESK_CATALOG_GENERATOR" ), tr( "PRP_DESK_CATALOG_GENERATOR" ),
- 0, desk, false, this, SLOT( onCatalogGen() ) );
+ SHIFT+Key_G, desk, false, this, SLOT( onCatalogGen() ) );
//! Registry Display
createAction( RegDisplayId, tr( "TOT_DESK_REGISTRY_DISPLAY" ), QIconSet(),
tr( "MEN_DESK_REGISTRY_DISPLAY" ), tr( "PRP_DESK_REGISTRY_DISPLAY" ),
- 0, desk, false, this, SLOT( onRegDisplay() ) );
+ SHIFT+Key_D, desk, false, this, SLOT( onRegDisplay() ) );
int fileMenu = createMenu( tr( "MEN_DESK_FILE" ), -1 );
LightApp_SelectionMgr* mgr = selectionMgr();
mgr->selectedObjects(list);
- SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>(activeStudy());
- if(study == NULL) return;
+ bool canCopy = false;
+ bool canPaste = false;
- _PTR(Study) stdDS = study->studyDS();
- if(!stdDS) return;
+ SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>(activeStudy());
+ if (study != NULL) {
+ _PTR(Study) stdDS = study->studyDS();
- QAction* qaction;
+ if (stdDS) {
+ SALOME_ListIteratorOfListIO it ( list );
- SALOME_ListIteratorOfListIO it( list );
- if(it.More() && list.Extent() == 1)
- {
- _PTR(SObject) so = stdDS->FindObjectID(it.Value()->getEntry());
+ if (it.More() && list.Extent() == 1) {
+ _PTR(SObject) so = stdDS->FindObjectID(it.Value()->getEntry());
- qaction = action(EditCopyId);
- if( so ) {
- SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(so.get());
- if ( aSO && studyMgr()->CanCopy(so) ) qaction->setEnabled(true);
- else qaction->setEnabled(false);
- }
- else qaction->setEnabled(false);
+ if ( so ) {
+ SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(so.get());
- qaction = action(EditPasteId);
- if( so ) {
- SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(so.get());
- if( aSO && studyMgr()->CanPaste(so) ) qaction->setEnabled(true);
- qaction->setEnabled(false);
- }
- else qaction->setEnabled(false);
- }
- else {
- qaction = action(EditCopyId);
- qaction->setEnabled(false);
- qaction = action(EditPasteId);
- qaction->setEnabled(false);
+ if ( aSO ) {
+ canCopy = studyMgr()->CanCopy(so);
+ canPaste = studyMgr()->CanPaste(so);
+ }
+ }
+ }
+ }
}
+
+ action(EditCopyId)->setEnabled(canCopy);
+ action(EditPasteId)->setEnabled(canPaste);
}
/*!Delete references.*/
-void SalomeApp_Application::onDeleteReferences()
+void SalomeApp_Application::onDeleteInvalidReferences()
{
SALOME_ListIO aList;
LightApp_SelectionMgr* mgr = selectionMgr();
- mgr->selectedObjects(aList);
+ mgr->selectedObjects( aList, QString::null, false );
- if (aList.Extent() < 1) return;
+ if( aList.IsEmpty() )
+ return;
SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(activeStudy());
_PTR(Study) aStudyDS = aStudy->studyDS();
_PTR(StudyBuilder) aStudyBuilder = aStudyDS->NewBuilder();
_PTR(SObject) anObj;
- for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() )
+ for( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() )
+ if ( it.Value()->hasEntry() )
{
- if ( it.Value()->hasEntry() )
- {
- _PTR(SObject) aSObject = aStudyDS->FindObjectID( it.Value()->getEntry() );
- if ( aSObject->ReferencedObject(anObj) )
- aStudyBuilder->RemoveReference(aSObject);
- }
- }
+ _PTR(SObject) aSObject = aStudyDS->FindObjectID( it.Value()->getEntry() ), aRefObj = aSObject;
+ while( aRefObj && aRefObj->ReferencedObject( anObj ) )
+ aRefObj = anObj;
+ if( aRefObj && aRefObj!=aSObject && QString( aRefObj->GetName().c_str() ).isEmpty() )
+ aStudyBuilder->RemoveReference( aSObject );
+ }
updateObjectBrowser();
}
if( a )
a->setEnabled( activeStudy() );
- a = action(EditCopyId);
- a->setEnabled(false);
- a = action(EditPasteId);
- a->setEnabled(false);
+ // update state of Copy/Paste menu items
+ onSelectionChanged();
}
/*!Private SLOT. On dump study.*/
/*!Create window.*/
QWidget* SalomeApp_Application::createWindow( const int flag )
{
- QWidget* wid = LightApp_Application::createWindow(flag);
+ QWidget* wid = 0;
+ if ( flag != WT_PyConsole ) wid = LightApp_Application::createWindow(flag);
SUIT_ResourceMgr* resMgr = resourceMgr();
{
OB_Browser* ob = (OB_Browser*)wid;
connect( ob->listView(), SIGNAL( doubleClicked( QListViewItem* ) ), this, SLOT( onDblClick( QListViewItem* ) ) );
- bool autoSize = resMgr->booleanValue( "ObjectBrowser", "auto_size", false );
+ bool autoSize = resMgr->booleanValue( "ObjectBrowser", "auto_size", false ),
+ autoSizeFirst = resMgr->booleanValue( "ObjectBrowser", "auto_size_first", true );
for ( int i = SalomeApp_DataObject::CT_Value; i <= SalomeApp_DataObject::CT_RefEntry; i++ )
{
ob->addColumn( tr( QString().sprintf( "OBJ_BROWSER_COLUMN_%d", i ) ), i );
QString().sprintf( "visibility_column_%d", i ), true ) );
}
ob->setWidthMode( autoSize ? QListView::Maximum : QListView::Manual );
+ ob->listView()->setColumnWidthMode( 0, autoSizeFirst ? QListView::Maximum : QListView::Manual );
+ ob->resize( desktop()->width()/3, ob->height() );
}
else if ( flag == WT_PyConsole )
{
- delete wid;
- wid = 0;
PythonConsole* pyCons = new PythonConsole( desktop(), new SalomeApp_PyInterp() );
pyCons->setCaption( tr( "PYTHON_CONSOLE" ) );
wid = pyCons;
- // pyCons->connectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
+ pyCons->resize( pyCons->width(), desktop()->height()/4 );
+ //pyCons->connectPopupRequest(this, SLOT(onConnectPopupRequest(SUIT_PopupClient*, QContextMenuEvent*)));
}
return wid;
}
LightApp_Preferences::Bool, "ObjectBrowser", QString().sprintf( "visibility_column_%d", i ) );
}
pref->setItemProperty( defCols, "columns", 1 );
-
- int objSetGroup = pref->addPreference( tr( "PREF_OBJ_BROWSER_SETTINGS" ), obTab );
- pref->addPreference( tr( "PREF_AUTO_SIZE" ), objSetGroup, LightApp_Preferences::Bool, "ObjectBrowser", "auto_size" );
}
/*!Update desktop title.*/
// Get selected objects
SALOME_ListIO aList;
LightApp_SelectionMgr* mgr = selectionMgr();
- mgr->selectedObjects(aList);
+ mgr->selectedObjects( aList, QString::null, false );
// "Delete reference" item should appear only for invalid references
- // Check if selected objects is invalid references
- bool isInvalidRefs = true;
-
- if ( aList.Extent() < 1 )
- isInvalidRefs = false;
+ // isInvalidRefs will be true, if at least one of selected objects is invalid reference
+ bool isInvalidRefs = false;
+ SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(activeStudy());
+ _PTR(Study) aStudyDS = aStudy->studyDS();
+ _PTR(SObject) anObj;
- if ( isInvalidRefs )
+ for( SALOME_ListIteratorOfListIO it( aList ); it.More() && !isInvalidRefs; it.Next() )
+ if( it.Value()->hasEntry() )
{
- SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(activeStudy());
- _PTR(Study) aStudyDS = aStudy->studyDS();
- _PTR(SObject) anObj;
+ _PTR(SObject) aSObject = aStudyDS->FindObjectID( it.Value()->getEntry() ), aRefObj = aSObject;
+ while( aRefObj && aRefObj->ReferencedObject( anObj ) )
+ aRefObj = anObj;
- for ( SALOME_ListIteratorOfListIO it( aList ); it.More() && isInvalidRefs; it.Next() )
- {
- if ( it.Value()->hasEntry() )
- {
- _PTR(SObject) aSObject = aStudyDS->FindObjectID( it.Value()->getEntry() );
- SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(aSObject.get());
- if( aSO )
- if ( aSObject->ReferencedObject(anObj) == false || !QString(anObj->GetName().c_str()).isEmpty() )
- isInvalidRefs = false;
- }
- }
+ if( aRefObj && aRefObj!=aSObject && QString( aRefObj->GetName().c_str() ).isEmpty() )
+ isInvalidRefs = true;
}
- // Add "Delete refrence" item to popup
+ // Add "Delete reference" item to popup
if ( isInvalidRefs )
- {
- thePopup->insertSeparator();
- thePopup->insertItem( tr( "MEN_DELETE_REFERENCE" ), this, SLOT( onDeleteReferences() ) );
- return;
- }
+ {
+ thePopup->insertSeparator();
+ thePopup->insertItem( tr( "MEN_DELETE_INVALID_REFERENCE" ), this, SLOT( onDeleteInvalidReferences() ) );
+ return;
+ }
+
+ aList.Clear();
+ mgr->selectedObjects( aList );
// "Activate module" item should appear only if it's necessary
if (aList.Extent() != 1)
if (currentModule && currentModule->moduleName() == aModuleTitle)
return;
thePopup->insertItem( tr( "MEN_OPENWITH" ), this, SLOT( onOpenWith() ) );
-
}
/*!Update obect browser:
if ( objectBrowser() )
{
objectBrowser()->updateGeometry();
- objectBrowser()->updateTree();
+ objectBrowser()->updateTree( 0, false );
}
}
virtual void updateDesktopTitle();
private slots:
- void onDeleteReferences();
+ void onDeleteInvalidReferences();
void onDblClick( QListViewItem* );
void onProperties();
void onDumpStudy();
#include "PyInterp_base.h" // this include must be first (see PyInterp_base.h)!
#include <cStringIO.h>
+using namespace std;
/*!
* constructor : multi Python interpreter, one per SALOME study.
/*!\class SalomeApp_PyInterp
* EDF-CCAR
- * Wasashen SALOME uses multi Python interpreter feature,
+ * When SALOME uses multi Python interpreter feature,
* Every study has its own interpreter and thread state (_tstate = Py_NewInterpreter())
* This is fine because every study has its own modules (sys.modules) stdout and stderr
* BUT some Python modules must be imported only once. In multi interpreter context Python
if ( !PythonConsole_PyInterp::initContext() )
return false;
- // Debut modif CCAR
// Import special module to change the import mechanism
PyObjWrapper m1( PyImport_ImportModule( "import_hook" ) );
if ( !m1 )
{
MESSAGE( "initContext: problem with import_hook import" );
PyErr_Print();
- PyErr_Clear();
ASSERT( 0 );
return false;
}
PyObjWrapper m2( PyObject_CallMethod( m1, "init_shared_modules", "O", KERNEL_PYTHON::salome_shared_modules_module ) );
if ( !m2 )
{
- MESSAGE( "initContext: problem with init_shared_modules call" );
- PyErr_Print();
- PyErr_Clear();
- ASSERT( 0 );
+ MESSAGE( "initContext: problem with init_shared_modules call" );
+ PyErr_Print();
+ ASSERT( 0 );
return false;
}
void SalomeApp_PyInterp::init_python()
{
/*
- * Initialize the main state (_gtstate) if not already done
- * The lock is released on init_python output
- * It is the caller responsability to acquire it if needed
+ * Do nothing
+ * The initialization has been done in main
*/
MESSAGE("PyInterp_base::init_python");
ASSERT(KERNEL_PYTHON::_gtstate); // initialisation in main
SCRUTE(KERNEL_PYTHON::_gtstate);
-// if(!_gtstate){
-// PyReleaseLock aReleaseLock;
-// Py_Initialize(); // Initialize the interpreter
-// PyEval_InitThreads(); // Initialize and acquire the global interpreter lock
-// PySys_SetArgv(_argc,_argv); // initialize sys.argv
-// _gtstate = PyThreadState_Get();
-// }
+ _gtstate=KERNEL_PYTHON::_gtstate;
+ _interp=KERNEL_PYTHON::_interp;
}
<parameter name="xterm" value="no"/>
<parameter name="portkill" value="no"/>
<parameter name="killall" value="no"/>
+ <parameter name="noexcepthandler" value="no"/>
<parameter name="modules" value="GEOM,SMESH,VISU,SUPERV,MED,COMPONENT"/>
<parameter name="pyModules" value=""/>
- <parameter name="embedded" value="SalomeAppEngine,study"/>
- <parameter name="standalone" value="pyContainer,cppContainer,registry,moduleCatalog"/>
+ <parameter name="embedded" value="SalomeAppEngine,study,cppContainer,registry,moduleCatalog"/>
+ <parameter name="standalone" value="pyContainer,supervContainer"/>
</section>
<section name="language">
<parameter name="language" value="en"/>
<parameter name="MED" value="${MED_ROOT_DIR}/share/salome/resources"/>
<parameter name="StdMeshers" value="${SMESH_ROOT_DIR}/share/salome/resources"/>
<parameter name="COMPONENT" value="${COMPONENT_ROOT_DIR}/share/salome/resources"/>
- <parameter name="HELLO" value="${HELLO1_ROOT_DIR}/share/salome/resources"/>
+ <parameter name="HELLO" value="${HELLO_ROOT_DIR}/share/salome/resources"/>
+ <parameter name="PYHELLO" value="${PYHELLO_ROOT_DIR}/share/salome/resources"/>
<parameter name="NETGENPlugin" value="${NETGENPLUGIN_ROOT_DIR}/share/salome/resources"/>
<parameter name="GHS3DPlugin" value="${GHS3DPLUGIN_ROOT_DIR}/share/salome/resources"/>
<parameter name="ToolsGUI" value="${SUITRoot}/resources"/>
</section>
+ <section name="PyConsole">
+ <parameter name="font" value="Helvetic,12" />
+ </section>
+ <section name="Study">
+ <parameter name="store_positions" value="false" />
+ </section>
<section name="GEOM">
<parameter name="name" value="Geometry"/>
<parameter name="icon" value="ModuleGeom.png"/>
<parameter name="name" value="Hello"/>
<parameter name="icon" value="HELLO.png"/>
</section>
+ <section name="PYHELLO">
+ <parameter name="name" value="PyHello"/>
+ <parameter name="icon" value="PYHELLO.png"/>
+ <parameter name="library" value="SalomePyQtGUI"/>
+ </section>
<!-- values below this line are just an example, they are not used -->
<section name="application">
</section>
<section name="ObjectBrowser" >
<parameter value="false" name="auto_size" />
- <parameter value="true" name="visibility_column_0" />
+ <parameter value="true" name="auto_size_first" />
+ <parameter value="true" name="visibility_column_0" />
<parameter value="false" name="visibility_column_1" />
<parameter value="false" name="visibility_column_2" />
<parameter value="false" name="visibility_column_3" />
<parameter value="105" name="trihedron_size" />
<parameter value="true" name="relative_size" />
</section>
+ <section name="ExternalBrowser" >
+ <parameter value="/usr/bin/mozilla" name="application" />
+ </section>
<section name="Plot2d" >
<parameter value="255, 255, 255" name="Background" />
<parameter value="1" name="CurveType" />
<parameter value="5" name="selection_width" />
<parameter value="5" name="highlight_width" />
<parameter value="0" name="controls_precision" />
- <parameter value="0.12" name="scalar_bar_horizontal_height" />
- <parameter value="0.6" name="scalar_bar_horizontal_width" />
- <parameter value="0.2" name="scalar_bar_horizontal_x" />
+ <parameter value="0.05" name="scalar_bar_horizontal_height" />
+ <parameter value="0.5" name="scalar_bar_horizontal_width" />
+ <parameter value="0.01" name="scalar_bar_horizontal_x" />
<parameter value="0.01" name="scalar_bar_horizontal_y" />
<parameter value="255, 255, 255" name="scalar_bar_label_color" />
<parameter value="Arial,12" name="scalar_bar_label_font" />
<parameter value="0" name="scalar_bar_orientation" />
<parameter value="255, 255, 255" name="scalar_bar_title_color" />
<parameter value="Arial,12" name="scalar_bar_title_font" />
- <parameter value="0.8" name="scalar_bar_vertical_height" />
- <parameter value="0.1" name="scalar_bar_vertical_width" />
+ <parameter value="0.5" name="scalar_bar_vertical_height" />
+ <parameter value="0.05" name="scalar_bar_vertical_width" />
<parameter value="0.01" name="scalar_bar_vertical_x" />
- <parameter value="0.1" name="scalar_bar_vertical_y" />
+ <parameter value="0.01" name="scalar_bar_vertical_y" />
<parameter value="true" name="DisplayMode" />
<parameter value="true" name="auto_update" />
<parameter value="1" name="display_mode" />
</section>
<section name="VISU" >
<parameter value="false" name="full_med_loading" />
- <parameter value="0.12" name="scalar_bar_horizontal_height" />
- <parameter value="0.6" name="scalar_bar_horizontal_width" />
- <parameter value="0.2" name="scalar_bar_horizontal_x" />
+ <parameter value="false" name="represent_shading" />
+ <parameter value="0.05" name="scalar_bar_horizontal_height" />
+ <parameter value="0.5" name="scalar_bar_horizontal_width" />
+ <parameter value="0.01" name="scalar_bar_horizontal_x" />
<parameter value="0.01" name="scalar_bar_horizontal_y" />
<parameter value="255, 255, 255" name="scalar_bar_label_color" />
<parameter value="Arial,Bold,Italic,Underline,12" name="scalar_bar_label_font" />
<parameter value="0" name="scalar_bar_orientation" />
<parameter value="255, 255, 255" name="scalar_bar_title_color" />
<parameter value="Arial,Bold,Italic,Underline,12" name="scalar_bar_title_font" />
- <parameter value="0.8" name="scalar_bar_vertical_height" />
- <parameter value="0.1" name="scalar_bar_vertical_width" />
+ <parameter value="0.5" name="scalar_bar_vertical_height" />
+ <parameter value="0.05" name="scalar_bar_vertical_width" />
<parameter value="0.01" name="scalar_bar_vertical_x" />
- <parameter value="0.1" name="scalar_bar_vertical_y" />
+ <parameter value="0.01" name="scalar_bar_vertical_y" />
<parameter value="0" name="scalar_range_max" />
<parameter value="0" name="scalar_range_min" />
<parameter value="0" name="scalar_range_type" />
msgstr "Dump study"
msgid "SalomeApp_Application::MEN_DESK_FILE_DUMP_STUDY"
-msgstr "Dump study..."
+msgstr "&Dump study..."
msgid "SalomeApp_Application::PRP_DESK_FILE_DUMP_STUDY"
msgstr "Dumps study to the python script"
msgstr "Load python script"
msgid "SalomeApp_Application::MEN_DESK_FILE_LOAD_SCRIPT"
-msgstr "Load script..."
+msgstr "Load scrip&t..."
msgid "SalomeApp_Application::PRP_DESK_FILE_LOAD_SCRIPT"
msgstr "Loads python script from file"
msgstr "Preferences"
msgid "SalomeApp_Application::MEN_DESK_TOOLS"
-msgstr "Tools"
+msgstr "&Tools"
msgid "SalomeApp_Application::TOT_DESK_CATALOG_GENERATOR"
msgstr "Catalog generator"
msgid "SalomeApp_Application::MEN_DESK_CATALOG_GENERATOR"
-msgstr "Catalog generator"
+msgstr "Catalog &generator"
msgid "SalomeApp_Application::PRP_DESK_CATALOG_GENERATOR"
msgstr "Generates XML catalog of a component's interface"
msgstr "Registry display"
msgid "SalomeApp_Application::MEN_DESK_REGISTRY_DISPLAY"
-msgstr "Registry display"
+msgstr "Registry &display"
msgid "SalomeApp_Application::PRP_DESK_REGISTRY_DISPLAY"
msgstr "Displays content of the Registry CORBA server"
msgstr "Study properties"
msgid "SalomeApp_Application::MEN_DESK_PROPERTIES"
-msgstr "Properties..."
+msgstr "Pro&perties..."
msgid "SalomeApp_Application::PRP_DESK_PROPERTIES"
msgstr "Edits study properties"
msgid "SalomeApp_Application::MEN_OPENWITH"
msgstr "Activate Module"
-msgid "SalomeApp_Application::MEN_DELETE_REFERENCE"
-msgstr "Delete Reference"
+msgid "SalomeApp_Application::MEN_DELETE_INVALID_REFERENCE"
+msgstr "Delete Invalid Reference"
//=======================================================================================
msgid "SalomeApp_Application::PREF_OBJ_BROWSER_SETTINGS"
msgstr "Settings"
-msgid "SalomeApp_Application::PREF_AUTO_SIZE"
-msgstr "Auto size columns"
-
//=======================================================================================
msgid "SalomeApp_Application::OBJ_BROWSER_NAME"
{
INFOS( "salome_shared_modules_module == NULL" );
PyErr_Print();
- PyErr_Clear();
}
PyEval_ReleaseThread( KERNEL_PYTHON::_gtstate );
SUIT_Application* aGUIApp = aGUISession->startApplication( "SalomeApp", 0, 0 );
if ( aGUIApp )
{
- _qappl.setHandler( aGUISession->handler() ); // after loading SalomeApp application
- // aGUISession contains SalomeApp_ExceptionHandler
+ if ( !isFound( "noexcepthandler", argc, argv ) )
+ _qappl.setHandler( aGUISession->handler() ); // after loading SalomeApp application
+ // aGUISession contains SalomeApp_ExceptionHandler
// Run GUI loop
MESSAGE( "run(): starting the main event loop" );
result = _qappl.exec();
{
NamingService_WaitForServerReadiness(_NS,"/myStudyManager");
ActivateEngine(_argc, _argv);
+ break;
}
case 6: // Container Manager
{