# common directories to put headerfiles
inc_builddir=$(top_builddir)/include/salome
+MODULE_NAME=@MODULE_NAME@
+
GUI_DISABLE_CORBA=@GUI_DISABLE_CORBA@
DISABLE_GLVIEWER=@DISABLE_GLVIEWER@
DISABLE_PYCONSOLE=@DISABLE_PYCONSOLE@
resources: resources-po resources-cp
-resources-po: $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/%.qm)
+resources-po: $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm)
-resources-cp: $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/%)
+resources-cp: $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%)
-$(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/%): $(top_builddir)/share/salome/resources/% : %
+$(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%): $(top_builddir)/share/salome/resources/$(MODULE_NAME)/% : %
cp -fr $< $@;
# Make installation directories if they don't exist.
# generic rule to install .qm files :
install-qm: resources
- $(INSTALL) -d $(datadir)/resources
- @for f in X $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/%.qm); do \
+ $(INSTALL) -d $(datadir)/resources/$(MODULE_NAME)
+ @for f in X $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm); do \
if test $$f != X; then \
- ($(INSTALL_DATA) $$f $(datadir)/resources/. || exit 1); \
+ ($(INSTALL_DATA) $$f $(datadir)/resources/$(MODULE_NAME)/. || exit 1); \
fi; \
done
# generic rule to install resources files (png, ini ...):
install-res: resources
- $(INSTALL) -d $(datadir)/resources
- @for f in X $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/%); do \
+ $(INSTALL) -d $(datadir)/resources/$(MODULE_NAME)
+ @for f in X $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%); do \
if test $$f != X; then \
- ($(INSTALL_DATA) $$f $(datadir)/resources/. || exit 1); \
+ ($(INSTALL_DATA) $$f $(datadir)/resources/$(MODULE_NAME)/. || exit 1); \
fi; \
done
# Uninstall qm files
@for f in X $(PO_FILES:%.po=%.qm); do \
if test $$f != X; then \
- $(LT_UNINSTALL) $(datadir)/resources/$$f ; \
+ $(LT_UNINSTALL) $(datadir)/resources/$(MODULE_NAME)/$$f ; \
fi; \
done
#
distclean: clean
#remove qm file !
- -$(RM) $(PO_FILES:%.po=%.qm) $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/%.qm)
+ -$(RM) $(PO_FILES:%.po=%.qm) $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm)
#remove include files
-$(RM) $(DEST_HEADERS)
-$(RM) $(DISTCLEAN) *.bak *.old *.new .dep*
%_wrap.cxx : %.i
$(SWIG) $(SWIG_FLAGS) -o $@ $<
-$(top_builddir)/share/salome/resources/%.qm: %.po
+$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm: %.po
$(MSG2QM) $< $@ ; \
#------------------------------------------------------------------------------
#!/bin/csh -f
-if ( ! $?SUITRoot ) setenv SUITRoot ${GUI_ROOT_DIR}/share/salome
-
# this variable necessary for loading .ini or .xml file
-if ( ! $?LightAppConfig ) setenv LightAppConfig ${GUI_ROOT_DIR}/share/salome/resources
-if ( ! $?LightAppResources ) setenv LightAppResources ${GUI_ROOT_DIR}/share/salome/resources
+if ( ! $?LightAppConfig ) setenv LightAppConfig ${GUI_ROOT_DIR}/share/salome/resources/gui
+if ( ! $?LightAppResources ) setenv LightAppResources ${GUI_ROOT_DIR}/share/salome/resources/gui
SUITApp LightApp -style salome $* &
#
#!/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
+ export LightAppConfig=${GUI_ROOT_DIR}/share/salome/resources/gui
fi
if [ -z "$LightAppResources" ] ; then
- export LightAppResources=${GUI_ROOT_DIR}/share/salome/resources
+ export LightAppResources=${GUI_ROOT_DIR}/share/salome/resources/gui
fi
SUITApp LightApp -style salome $* &
PACKAGE=salome
AC_SUBST(PACKAGE)
-VERSION=3.2.0
-XVERSION=0x030200
+VERSION=3.2.2
+XVERSION=0x030202
AC_SUBST(VERSION)
AC_SUBST(XVERSION)
+# set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
+MODULE_NAME=gui
+AC_SUBST(MODULE_NAME)
+
########################################################################
# Check --disable-corba-gen and other --disable-* options
# make other build directories
if test "$GUI_DISABLE_CORBA" == "yes"; then
- dir_variables="salome_adm adm_local doc bin/salome include/salome lib${LIB_LOCATION_SUFFIX}/salome share/salome/resources idl"
+ dir_variables="salome_adm adm_local doc bin/salome include/salome lib${LIB_LOCATION_SUFFIX}/salome share/salome/resources/${MODULE_NAME} idl"
else
- dir_variables="salome_adm adm_local doc bin/salome include/salome lib${LIB_LOCATION_SUFFIX}/salome share/salome/resources"
+ dir_variables="salome_adm adm_local doc bin/salome include/salome lib${LIB_LOCATION_SUFFIX}/salome share/salome/resources/${MODULE_NAME}"
fi
for rep in $dir_variables
<style type="text/css">\r
<!--\r
p.whs1 { font-family:'Times New Roman' , serif; margin-left:40px; }\r
-img_whs2 { border:none; border-style:none; width:752px; height:646px; float:none; }\r
+img_whs2 { border:none; width:752px; height:588px; float:none; border-style:none; }\r
ul.whs3 { list-style:disc; }\r
-p.whs4 { margin-left:40px; }\r
-p.whs5 { margin-left:40px; font-weight:bold; }\r
+p.whs4 { margin-left:40px; font-weight:bold; }\r
+p.whs5 { margin-left:40px; }\r
-->\r
</style><script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">\r
<!--\r
\r
<p> </p>\r
\r
-<p class="whs1"><img src="pics/pref15.png" x-maintain-ratio="TRUE" width="752px" height="646px" border="0" class="img_whs2"></p>\r
+<p class="whs1"><img src="pics/pref15.png" x-maintain-ratio="TRUE" width="752px" height="588px" border="0" class="img_whs2"></p>\r
+\r
+<p class="whs1"> </p>\r
+\r
+<p class="whs1">For \r
+ all color definitions click on the respective line to access to the <span \r
+ style="font-weight: bold;"><B><a href="select_color_and_font.htm">Select \r
+ Color</a></B></span> dialog box. </p>\r
\r
<p> </p>\r
\r
<ul type="disc" class="whs3">\r
\r
- <li class=kadov-p><p class="whs4"><span style="font-weight: bold;"><B>Default \r
- Shading Color</B></span> - allows to select default shading color. Click on \r
- the colored line to access to the <span style="font-weight: bold;"><B><a href="select_color_and_font.htm">Select Color</a></B></span> dialog box. </p></li>\r
+ <li class=kadov-p><p class="whs4">Default \r
+ Display Mode - <span style="font-weight: normal;">allows to choose between</span> \r
+ <span style="font-weight: normal;">wireframe or shading.</span></p></li>\r
+ \r
+ <li class=kadov-p><p class="whs5"><span style="font-weight: bold;"><B>Default \r
+ Shading Color</B></span> - allows to select default shading color. </p></li>\r
+ \r
+ <li class=kadov-p><p class="whs5"><span style="font-weight: bold;"><B>Default \r
+ Wireframe Color</B></span> - allows to select default wireframe color (to \r
+ be applied to any lines not being free boundaries or isolated lines).</p></li>\r
+ \r
+ <li class=kadov-p><p class="whs5"><span style="font-weight: bold;"><B>Color \r
+ of free boundaries</B></span> - allows to select default color for free boundaries. \r
+ </p></li>\r
\r
- <li class=kadov-p><p class="whs5">Step \r
+ <li class=kadov-p><p class="whs4">Color \r
+ of edges, vectors and wires - <span style="font-weight: normal;">allows \r
+ to select default color for edges, vectors and wires (isolated lines).</span></p></li>\r
+ \r
+ <li class=kadov-p><p class="whs4">Color \r
+ of points - <span style="font-weight: normal;">allows to select default \r
+ color for vertices.</span></p></li>\r
+ \r
+ <li class=kadov-p><p class="whs4">Color \r
+ of isolines - <span style="font-weight: normal;">allows to select default \r
+ color for isolines.</span></p></li>\r
+ \r
+ <li class=kadov-p><p class="whs4">Step \r
Value for Spin Boxes - <span style="font-weight: normal;">allows to define \r
the increment of values set in spin boxes. </span> </p></li>\r
- \r
- <li class=kadov-p><p class="whs5">Default \r
- Display Mode - <span style="font-weight: normal;">allows to choose between</span> \r
- <span style="font-weight: normal;">wireframe or shading.</span></p></li>\r
</ul>\r
\r
<p> </p>\r
\r
<p> </p>\r
\r
-<p><img src="pics/import.png" x-maintain-ratio="TRUE" width="541px" height="309px" border="0" class="img_whs1"></p>\r
+<p><img src="pics/import.png" x-maintain-ratio="TRUE" width="538px" height="374px" border="0" class="img_whs1"></p>\r
\r
<p> </p>\r
\r
font-size: smaller
}
-BODY {
- background: url(sources/bg_salome.gif)
+BODY { background: #FFFFFF
}
+/* BODY {
+ background: url(sources/bg_salome.gif)
+} */
+
div.tabs {
text-align: justify;
font-weight: bold;
#include <TDF_Delta.hxx>
#include <TDF_ListIteratorOfDeltaList.hxx>
+#include <Standard_Failure.hxx>
#include <Standard_ErrorHandler.hxx>
/*!
if ( app && !app->stdApp().IsNull() )
{
try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+ OCC_CATCH_SIGNALS;
+#endif
TColStd_SequenceOfExtendedString formats;
- app->stdApp()->Formats( formats );
+ app->stdApp()->Formats( formats );
if ( !formats.IsEmpty() )
app->stdApp()->NewDocument( formats.First(), myStdDoc );
}
bool status = false;
try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+ OCC_CATCH_SIGNALS;
+#endif
status = app->Open( CAF_Tools::toExtString( fname ), myStdDoc ) == CDF_RS_OK;
}
catch ( Standard_Failure ) {
bool status = false;
try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+ OCC_CATCH_SIGNALS;
+#endif
if ( save )
status = app->Save( stdDoc() ) == CDF_SS_OK;
else
bool res = true;
try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+ OCC_CATCH_SIGNALS;
+#endif
if ( myStdDoc->HasOpenCommand() )
myStdDoc->AbortCommand();
bool res = true;
try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+ OCC_CATCH_SIGNALS;
+#endif
myStdDoc->AbortCommand();
- update();
+ update();
}
catch ( Standard_Failure ) {
res = false;
bool res = true;
try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+ OCC_CATCH_SIGNALS;
+#endif
myStdDoc->CommitCommand();
if ( canUndo() )
{
Handle(TDF_Delta) d = myStdDoc->GetUndos().Last();
- if ( !d.IsNull() )
+ if ( !d.IsNull() )
d->SetName( CAF_Tools::toExtString( name ) );
}
}
*/
bool CAF_Study::undo()
{
- if ( myStdDoc.IsNull() )
+ if ( myStdDoc.IsNull() )
return false;
try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+ OCC_CATCH_SIGNALS;
+#endif
myStdDoc->Undo();
undoModified(); /* decrement modification counter */
}
catch ( Standard_Failure ) {
- SUIT_MessageBox::error1( application()->desktop(), tr( "ERR_ERROR" ),
- tr( "ERR_DOC_UNDO" ), tr ( "BUT_OK" ) );
- return false;
- }
+ SUIT_MessageBox::error1(application()->desktop(), tr( "ERR_ERROR" ),
+ tr( "ERR_DOC_UNDO" ), tr ( "BUT_OK" ));
+ return false;
+ }
return true;
}
*/
bool CAF_Study::redo()
{
- if ( myStdDoc.IsNull() )
+ if ( myStdDoc.IsNull() )
return false;
try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+ OCC_CATCH_SIGNALS;
+#endif
myStdDoc->Redo();
doModified(); /* increment modification counter */
}
QString modTitle = resMgr->stringValue( *it, QString( "name" ), QString::null );
if ( modTitle.isEmpty() )
- continue;
+ {
+ printf( "****************************************************************\n" );
+ printf( "* Warning: %s not found in resources.\n", (*it).latin1() );
+ printf( "* Module will not be available\n" );
+ printf( "****************************************************************\n" );
+ continue;
+ }
QString modLibrary = resMgr->stringValue( *it, QString( "library" ), QString::null ).stripWhiteSpace();
if ( !modLibrary.isEmpty() )
if ( desktop() && desktop()->isShown() )
SUIT_MessageBox::warn1( desktop(), tr( "Warning" ), tr( "Modules list is empty" ), tr( "&OK" ) );
else
- qWarning( tr( "Modules list is empty" ).latin1() );
+ {
+ printf( "****************************************************************\n" );
+ printf( "* Warning: modules list is empty.\n" );
+ printf( "****************************************************************\n" );
+ }
}
}
if ( theUnits && *theUnits && strcmp( theUnits, "%" ) )
{
try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+ OCC_CATCH_SIGNALS;
+#endif
aRetValue = UnitsAPI::AnyToSI( theValue, theUnits );
}
catch( Standard_Failure ) {
if ( theUnits && *theUnits && strcmp( theUnits, "%" ) )
{
try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+ OCC_CATCH_SIGNALS;
+#endif
aRetValue = UnitsAPI::AnyFromSI( theValue, theUnits );
}
catch( Standard_Failure ) {
aCurPos += aGLText.size();
aPointer = (char*)&myOwner;
- for( i = 0; i < sizeof( GLViewer_Owner* ); i++, aPointer++ )
+ for( i = 0; i < sizeof( SUIT_DataOwner* ); i++, aPointer++ )
aResult[ aCurPos + i ] = *aPointer;
return aResult;
class GLViewer_Group;
class GLViewer_CoordSystem;
class GLViewer_Text;
-class GLViewer_Owner;
+//class GLViewer_Owner;
/*!
* Class GLViewer_Object
#include "LightApp_OBFilter.h"
+#include "LightApp_EventFilter.h"
+
#include "LightApp_OBSelector.h"
#include "LightApp_SelectionMgr.h"
myAccel->setActionKey( SUIT_Accel::RotateUp, ALT+Key_Up, VTKViewer_Viewer::Type() );
myAccel->setActionKey( SUIT_Accel::RotateDown, ALT+Key_Down, VTKViewer_Viewer::Type() );
#endif
+#ifndef DISABLE_PLOT2DVIEWER
+ myAccel->setActionKey( SUIT_Accel::PanLeft, CTRL+Key_Left, Plot2d_Viewer::Type() );
+ myAccel->setActionKey( SUIT_Accel::PanRight, CTRL+Key_Right, Plot2d_Viewer::Type() );
+ myAccel->setActionKey( SUIT_Accel::PanUp, CTRL+Key_Up, Plot2d_Viewer::Type() );
+ myAccel->setActionKey( SUIT_Accel::PanDown, CTRL+Key_Down, Plot2d_Viewer::Type() );
+ myAccel->setActionKey( SUIT_Accel::ZoomIn, CTRL+Key_Plus, Plot2d_Viewer::Type() );
+ myAccel->setActionKey( SUIT_Accel::ZoomOut, CTRL+Key_Minus, Plot2d_Viewer::Type() );
+ myAccel->setActionKey( SUIT_Accel::ZoomFit, CTRL+Key_Asterisk, Plot2d_Viewer::Type() );
+#endif
connect( mySelMgr, SIGNAL( selectionChanged() ), this, SLOT( onSelection() ) );
putInfo( "" );
desktop()->statusBar()->message( "" );
+
+ LightApp_EventFilter::Init();
}
/*!Gets application name.*/
if ( modIcon.isNull() )
modIcon = QPixmap( imageEmptyIcon );
- QToolBar* modTBar = new QtxToolBar( true, desk );
- modTBar->setLabel( tr( "INF_TOOLBAR_MODULES" ) );
+ QStringList modList;
+ modules( modList, false );
- QActionGroup* modGroup = new QActionGroup( this );
- modGroup->setExclusive( true );
- modGroup->setUsesDropDown( true );
+ if( modList.count()>1 )
+ {
+ QToolBar* modTBar = new QtxToolBar( true, desk );
+ modTBar->setLabel( tr( "INF_TOOLBAR_MODULES" ) );
- a = createAction( -1, tr( "APP_NAME" ), defIcon, tr( "APP_NAME" ),
- tr( "PRP_APP_MODULE" ), 0, desk, true );
- modGroup->add( a );
- myActions.insert( QString(), a );
+ QActionGroup* modGroup = new QActionGroup( this );
+ modGroup->setExclusive( true );
+ modGroup->setUsesDropDown( true );
- QMap<QString, QString> iconMap;
- moduleIconNames( iconMap );
+ a = createAction( -1, tr( "APP_NAME" ), defIcon, tr( "APP_NAME" ),
+ tr( "PRP_APP_MODULE" ), 0, desk, true );
+ modGroup->add( a );
+ myActions.insert( QString(), a );
- modGroup->addTo( modTBar );
- QObjectList *l = modTBar->queryList( "QComboBox" );
- if ( l )
- {
- for ( QObjectListIt oit( *l ); oit.current(); ++oit )
- {
- QComboBox* cb = ::qt_cast<QComboBox*>( oit.current() );
- if ( !cb )
- continue;
- cb->setFocusPolicy( QWidget::NoFocus );
- cb->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Expanding ) );
+ QMap<QString, QString> iconMap;
+ moduleIconNames( iconMap );
+
+ const int iconSize = 20;
+
+ modGroup->addTo( modTBar );
+ QObjectList *l = modTBar->queryList( "QComboBox" );
+ QObjectListIt oit( *l );
+ while ( QObject* obj = oit.current() ) {
+ QComboBox* cb = (QComboBox*)obj;
+ if ( cb ) cb->setFocusPolicy( QWidget::NoFocus );
+ ++oit;
}
- }
- delete l;
+ delete l;
- modTBar->addSeparator();
-
- QStringList modList;
- modules( modList, false );
+ modTBar->addSeparator();
- const int iconSize = 16;
- for ( it = modList.begin(); it != modList.end(); ++it )
- {
- if ( !isLibExists( *it ) )
+ for ( it = modList.begin(); it != modList.end(); ++it )
{
- qDebug( QString( "Library '%1' cannot be found" ).arg( *it ) );
- continue;
- }
+ if ( !isLibExists( *it ) )
+ continue;
+
+ QString iconName;
+ if ( iconMap.contains( *it ) )
+ iconName = iconMap[*it];
- QString iconName;
- if ( iconMap.contains( *it ) )
- iconName = iconMap[*it];
+ QString modName = moduleName( *it );
- QString modName = moduleName( *it );
+ QPixmap icon = resMgr->loadPixmap( modName, iconName, false );
+ if ( icon.isNull() )
+ {
+ icon = modIcon;
+ printf( "****************************************************************\n" );
+ printf( "* Icon for %s not found. Using the default one.\n", (*it).latin1() );
+ printf( "****************************************************************\n" );
+ }
- QPixmap icon = resMgr->loadPixmap( modName, iconName, false );
- if ( icon.isNull() )
- icon = modIcon;
+ icon.convertFromImage( icon.convertToImage().smoothScale( iconSize, iconSize, QImage::ScaleMin ) );
- icon.convertFromImage( icon.convertToImage().smoothScale( iconSize, iconSize, QImage::ScaleMin ) );
- QPixmap blank = SUIT_Tools::transparentPixmap( 20, 20 );
- icon = SUIT_Tools::composite( icon, ( blank.width() - icon.width() ) / 2,
- ( blank.height() - icon.height() ) / 2, blank );
+ QAction* a = createAction( -1, *it, icon, *it, tr( "PRP_MODULE" ).arg( *it ), 0, desk, true );
+ a->addTo( modTBar );
+ modGroup->add( a );
- QAction* a = createAction( -1, *it, icon, *it, tr( "PRP_MODULE" ).arg( *it ), 0, desk, true );
- a->addTo( modTBar );
- modGroup->add( a );
+ myActions.insert( *it, a );
+ }
- myActions.insert( *it, a );
+ SUIT_Tools::simplifySeparators( modTBar );
+ connect( modGroup, SIGNAL( selected( QAction* ) ), this, SLOT( onModuleActivation( QAction* ) ) );
}
- SUIT_Tools::simplifySeparators( modTBar );
-
// New window
int windowMenu = createMenu( tr( "MEN_DESK_WINDOW" ), -1, MenuWindowId, 100 );
int newWinMenu = createMenu( tr( "MEN_DESK_NEWWINDOW" ), windowMenu, -1, 0 );
SHIFT+Key_R, desk, false, this, SLOT( onRenameWindow() ) );
createMenu( RenameId, windowMenu, -1 );
- connect( modGroup, SIGNAL( selected( QAction* ) ), this, SLOT( onModuleActivation( QAction* ) ) );
-
int fileMenu = createMenu( tr( "MEN_DESK_FILE" ), -1 );
createMenu( PreferencesId, fileMenu, 15, -1 );
createMenu( separator(), fileMenu, -1, 15, -1 );
QString aParams = resMgr->stringValue("ExternalBrowser", "parameters");
if (!anApp.isEmpty()) {
- RunBrowser* rs = new RunBrowser( this, anApp, aParams, helpFile );
+ RunBrowser* rs = new RunBrowser( this, anApp, aParams, helpFile );
rs->start();
}
else {
vm = new OCCViewer_Viewer();
#endif
vm->setBackgroundColor( resMgr->colorValue( "OCCViewer", "background", vm->backgroundColor() ) );
- vm->setTrihedronSize( resMgr->integerValue( "OCCViewer", "trihedron_size", vm->trihedronSize() ) );
+ vm->setTrihedronSize( resMgr->doubleValue( "OCCViewer", "trihedron_size", vm->trihedronSize() ) );
int u( 1 ), v( 1 );
vm->isos( u, v );
u = resMgr->integerValue( "OCCViewer", "iso_number_u", u );
if( vm )
{
vm->setBackgroundColor( resMgr->colorValue( "VTKViewer", "background", vm->backgroundColor() ) );
- vm->setTrihedronSize( resMgr->integerValue( "VTKViewer", "trihedron_size", vm->trihedronSize() ),
+ vm->setTrihedronSize( resMgr->doubleValue( "VTKViewer", "trihedron_size", vm->trihedronSize() ),
resMgr->booleanValue( "VTKViewer", "relative_size", vm->trihedronRelative() ) );
new LightApp_VTKSelector( vm, mySelMgr );
}
}
/*!Protected SLOT. On study closed.*/
-void LightApp_Application::onStudyClosed( SUIT_Study* )
+void LightApp_Application::onStudyClosed( SUIT_Study* s )
{
// Bug 10396: clear selection
mySelMgr->clearSelected();
activateModule( "" );
- saveWindowsGeometry();
+ for ( WindowMap::ConstIterator itr = myWindows.begin(); s && itr != myWindows.end(); ++itr )
+ removeWindow( itr.key(), s->id() );
}
/*!Protected SLOT.On desktop activated.*/
void LightApp_Application::beforeCloseDoc( SUIT_Study* s )
{
CAM_Application::beforeCloseDoc( s );
-
- for ( WindowMap::ConstIterator itr = myWindows.begin(); s && itr != myWindows.end(); ++itr )
- removeWindow( itr.key(), s->id() );
}
/*!Update actions.*/
{
OB_Browser* ob = new OB_Browser( desktop() );
ob->setAutoUpdate( true );
- //QA regression automatic tests
- //ob->setAutoOpenLevel( 1 );
+ //ob->setAutoOpenLevel( 1 ); // commented by ASV as a fix to bug IPAL10107
ob->setCaption( tr( "OBJECT_BROWSER" ) );
OB_ListView* ob_list = dynamic_cast<OB_ListView*>( const_cast<QListView*>( ob->listView() ) );
pref->setItemProperty( plot2dGroup, "columns", 1 );
int occTS = pref->addPreference( tr( "PREF_TRIHEDRON_SIZE" ), occGroup,
- LightApp_Preferences::IntSpin, "OCCViewer", "trihedron_size" );
+ LightApp_Preferences::DblSpin, "OCCViewer", "trihedron_size" );
pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), occGroup,
LightApp_Preferences::Color, "OCCViewer", "background" );
- pref->setItemProperty( occTS, "min", 1 );
+ pref->setItemProperty( occTS, "min", 1.0E-06 );
pref->setItemProperty( occTS, "max", 1000 );
int isoU = pref->addPreference( tr( "PREF_ISOS_U" ), occGroup,
pref->setItemProperty( isoV, "max", 100000 );
int vtkTS = pref->addPreference( tr( "PREF_TRIHEDRON_SIZE" ), vtkGroup,
- LightApp_Preferences::IntSpin, "VTKViewer", "trihedron_size" );
+ LightApp_Preferences::DblSpin, "VTKViewer", "trihedron_size" );
pref->addPreference( tr( "PREF_RELATIVE_SIZE" ), vtkGroup, LightApp_Preferences::Bool, "VTKViewer", "relative_size" );
pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), vtkGroup,
LightApp_Preferences::Color, "VTKViewer", "background" );
- pref->setItemProperty( vtkTS, "min", 1 );
+ pref->setItemProperty( vtkTS, "min", 1.0E-06 );
pref->setItemProperty( vtkTS, "max", 150 );
pref->addPreference( tr( "PREF_SHOW_LEGEND" ), plot2dGroup,
#ifndef DISABLE_OCCVIEWER
if ( sec == QString( "OCCViewer" ) && param == QString( "trihedron_size" ) )
{
- int sz = resMgr->integerValue( sec, param, -1 );
+ double sz = resMgr->doubleValue( sec, param, -1 );
QPtrList<SUIT_ViewManager> lst;
viewManagers( OCCViewer_Viewer::Type(), lst );
for ( QPtrListIterator<SUIT_ViewManager> it( lst ); it.current() && sz >= 0; ++it )
#ifndef DISABLE_VTKVIEWER
if ( sec == QString( "VTKViewer" ) && (param == QString( "trihedron_size" ) || param == QString( "relative_size" )) )
{
- int sz = resMgr->integerValue( "VTKViewer", "trihedron_size", -1 );
+ double sz = resMgr->doubleValue( "VTKViewer", "trihedron_size", -1 );
bool isRelative = resMgr->booleanValue( "VTKViewer", "relative_size", true );
QPtrList<SUIT_ViewManager> lst;
#ifndef DISABLE_SALOMEOBJECT
return false;
QString lib = moduleLibrary( moduleTitle );
+
+ //abd: changed libSalomePyQtGUI to SalomePyQtGUI for WIN32
+ bool isPythonModule = lib.contains("SalomePyQtGUI");
+
QStringList paths;
#ifdef WIN32
paths = QStringList::split( ";", ::getenv( "PATH" ) );
paths = QStringList::split( ":", ::getenv( "LD_LIBRARY_PATH" ) );
#endif
+ bool isLibFound = false;
QStringList::const_iterator anIt = paths.begin(), aLast = paths.end();
for( ; anIt!=aLast; anIt++ )
{
QFileInfo inf( Qtx::addSlash( *anIt ) + lib );
+
if( inf.exists() )
+ {
+ isLibFound = true;
+ break;
+ }
+ }
+
+ if ( !isLibFound )
+ {
+ printf( "****************************************************************\n" );
+ printf( "* Warning: library %s cannot be found\n", moduleTitle.latin1() );
+ printf( "* Module will not be available\n" );
+ printf( "****************************************************************\n" );
+ }
+ else if ( !isPythonModule )
+ return true;
+
+ if ( isPythonModule )
+ {
+ QString pylib = moduleName( moduleTitle ) + QString(".py");
+ QString pylibgui = moduleName( moduleTitle ) + QString("GUI.py");
+
+ // Check the python library
+#ifdef WIN32
+ paths = QStringList::split( ";", ::getenv( "PATH" ) );
+#else
+ paths = QStringList::split( ":", ::getenv( "PYTHONPATH" ) );
+#endif
+ bool isPyLib = false, isPyGuiLib = false;
+ QStringList::const_iterator anIt = paths.begin(), aLast = paths.end();
+ for( ; anIt!=aLast; anIt++ )
+ {
+ QFileInfo inf( Qtx::addSlash( *anIt ) + pylib );
+ QFileInfo infgui( Qtx::addSlash( *anIt ) + pylibgui );
+
+ if( !isPyLib && inf.exists() )
+ isPyLib = true;
+
+ if( !isPyGuiLib && infgui.exists() )
+ isPyGuiLib = true;
+
+ if ( isPyLib && isPyGuiLib && isLibFound)
+ return true;
+ }
+
+ printf( "****************************************************************\n" );
+ printf( "* Warning: python library for %s cannot be found:\n", moduleTitle.latin1() );
+ if (!isPyLib)
+ printf( "* No module named %s\n", moduleName( moduleTitle ).latin1() );
+ if (!isPyGuiLib)
+ printf( "* No module named %s\n", (moduleName( moduleTitle ) + QString("GUI")).latin1() );
+ printf( "****************************************************************\n" );
return true;
}
return false;
#define LIGHTAPP_DATAOWNER_H
#include "LightApp.h"
-#include <SUIT_DataOwner.h>
+#include "SUIT_DataOwner.h"
#ifndef DISABLE_SALOMEOBJECT
#include "SALOME_InteractiveObject.hxx"
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "LightApp_EventFilter.h"
+
+#include <SUIT_Desktop.h>
+
+#include <qapplication.h>
+
+LightApp_EventFilter* LightApp_EventFilter::myFilter = NULL;
+
+/*!Constructor.*/
+LightApp_EventFilter::LightApp_EventFilter()
+: QObject()
+{
+ qApp->installEventFilter( this );
+}
+
+/*!Destructor.*/
+LightApp_EventFilter::~LightApp_EventFilter()
+{
+ qApp->removeEventFilter( this );
+}
+
+/*!
+ Custom event filter
+*/
+bool LightApp_EventFilter::eventFilter( QObject* o, QEvent* e )
+{
+ if ( e->type() == QEvent::WindowActivate && o->inherits("QDialog") )
+ {
+ QWidget* parent = ((QWidget*)o)->parentWidget();
+
+ SUIT_Desktop* aDesktop = 0;
+
+ while( parent )
+ {
+ if ( aDesktop = dynamic_cast<SUIT_Desktop*>(parent) )
+ break;
+ parent = parent->parentWidget();
+ }
+
+ if ( aDesktop )
+ aDesktop->emitActivated();
+ }
+
+ return QObject::eventFilter( o, e );
+}
+
+/*!Create new instance of LightApp_EventFilter*/
+void LightApp_EventFilter::Init()
+{
+ if( myFilter==NULL )
+ myFilter = new LightApp_EventFilter();
+}
+
+/*!Destroy filter.*/
+void LightApp_EventFilter::Destroy()
+{
+ if( myFilter )
+ {
+ delete myFilter;
+ myFilter = NULL;
+ }
+}
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef LIGHTAPP_EVENTFILTER_H
+#define LIGHTAPP_EVENTFILTER_H
+
+#include "LightApp.h"
+
+#include <qobject.h>
+
+#if defined WNT
+#pragma warning( disable: 4251 )
+#endif
+
+/*!
+ Class provide event filter.
+*/
+class LIGHTAPP_EXPORT LightApp_EventFilter: public QObject
+{
+public:
+ static void Init();
+ static void Destroy();
+
+protected:
+ LightApp_EventFilter();
+ virtual ~LightApp_EventFilter();
+
+private:
+ /*! global event filter for qapplication */
+ virtual bool eventFilter( QObject* o, QEvent* e );
+
+private:
+ static LightApp_EventFilter* myFilter;
+};
+
+#if defined WNT
+#pragma warning( default: 4251 )
+#endif
+
+#endif
QMap<QString,int> entryMap;
- QString entry;
+ QString entry, checkEntry;
for ( SUIT_DataOwnerPtrList::const_iterator itr = aList.begin(); itr != aList.end(); ++itr )
{
const LightApp_DataOwner* owner = dynamic_cast<const LightApp_DataOwner*>( (*itr).operator->() );
return;
entry = owner->entry();
+ // Entry to check object uniqueness.
+ // It is selected owner entry in the case, when we do not convert references,
+ // and entry of a real object, when we convert references.
+ checkEntry = entry;
if ( convertReferences ) {
QString refEntry = study->referencedToEntry( entry );
- if( !entryMap.contains( entry ) ) {
+ checkEntry = refEntry;
+ if ( !entryMap.contains( checkEntry ) ) {
if ( refEntry != entry ) {
QString component = study->componentDataType( refEntry );
theList.Append( new SALOME_InteractiveObject( refEntry, component, ""/*refobj->Name().c_str()*/ ) );
theList.Append( owner->IO() );
}
- entryMap.insert(owner->entry(), 1);
+ entryMap.insert(checkEntry, 1);
}
}
-// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#include "LightApp_VTKSelector.h"
-#include "LightApp_DataOwner.h"
-
-#ifndef DISABLE_VTKVIEWER
- #include "SVTK_ViewModelBase.h"
- #include "SVTK_ViewManager.h"
- #include "SVTK_Selector.h"
- #include "SVTK_ViewWindow.h"
- #include "SVTK_Functor.h"
- #include "VTKViewer_Algorithm.h"
- #include <vtkRenderer.h>
-#endif
-
-#ifndef DISABLE_SALOMEOBJECT
- #include "SALOME_Actor.h"
- #include "SALOME_ListIteratorOfListIO.hxx"
-#endif
-
-
-
-#ifndef DISABLE_VTKVIEWER
-#ifndef DISABLE_SALOMEOBJECT
-/*!
- Constructor.
-*/
-LightApp_SVTKDataOwner::LightApp_SVTKDataOwner( const Handle(SALOME_InteractiveObject)& theIO,
- SUIT_Desktop* theDesktop )
-: LightApp_DataOwner( theIO ),
-myDesktop( theDesktop )
-{
-}
-#else
-LightApp_SVTKDataOwner::LightApp_SVTKDataOwner( const QString& theEntry )
-: LightApp_DataOwner( theEntry )
-{
-}
-#endif
-
-/*!
- \return active SVTK view window
-*/
-SVTK_ViewWindow*
-LightApp_SVTKDataOwner
-::GetActiveViewWindow() const
-{
- if(SUIT_ViewWindow* aViewWindow = myDesktop->activeWindow())
- return dynamic_cast<SVTK_ViewWindow*>(aViewWindow);
-
- return NULL;
-}
-
-/*!
- Gets dataowners ids list.
-*/
-const TColStd_IndexedMapOfInteger&
-LightApp_SVTKDataOwner
-::GetIds() const
-{
- if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow()){
- if(SVTK_Selector* aSelector = aViewWindow->GetSelector()){
- aSelector->GetIndex(IO(),myIds);
- }
- }
-
- return myIds;
-}
-
-/*!
- Gets selection mode.
-*/
-Selection_Mode
-LightApp_SVTKDataOwner
-::GetMode() const
-{
- if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow()){
- if(SVTK_Selector* aSelector = aViewWindow->GetSelector()){
- return aSelector->SelectionMode();
- }
- }
-
- return -1;
-}
-
-/*!
- Gets actor pointer.
-*/
-SALOME_Actor*
-LightApp_SVTKDataOwner
-::GetActor() const
-{
- if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow()){
- using namespace SVTK;
- return Find<SALOME_Actor>(aViewWindow->getRenderer()->GetActors(),TIsSameIObject<SALOME_Actor>(IO()));
- }
-
- return NULL;
-}
-
-#endif
-
-/*!
- Destuctor.
-*/
-/*
-LightApp_SVTKDataOwner::~LightApp_SVTKDataOwner()
-{
-}
-*/
-
-#ifndef DISABLE_VTKVIEWER
-/*!
- Constructor.
-*/
-LightApp_VTKSelector
-::LightApp_VTKSelector( SVTK_ViewModelBase* viewer,
- SUIT_SelectionMgr* mgr ):
- SUIT_Selector( mgr, viewer ),
- myViewer( viewer )
-{
- if ( myViewer )
- connect( myViewer, SIGNAL( selectionChanged() ), this, SLOT( onSelectionChanged() ) );
-}
-
-/*!
- Gets viewer.
-*/
-SVTK_ViewModelBase*
-LightApp_VTKSelector
-::viewer() const
-{
- return myViewer;
-}
-
-/*!
- Gets type of salome vtk viewer.
-*/
-QString
-LightApp_VTKSelector
-::type() const
-{
- return myViewer->getType();
-}
-
-#endif
-/*!
- On selection changed.
-*/
-void
-LightApp_VTKSelector
-::onSelectionChanged()
-{
- selectionChanged();
-}
-
-#ifndef DISABLE_VTKVIEWER
-
-/*!
- Gets list of selected data owners.(output \a aList).
-*/
-void
-LightApp_VTKSelector
-::getSelection( SUIT_DataOwnerPtrList& aList ) const
-{
- if(myViewer){
- if(SUIT_ViewManager* aViewManager = myViewer->getViewManager()){
- if(SVTK_ViewManager* aViewMgr = dynamic_cast<SVTK_ViewManager*>(aViewManager)){
- if(SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(aViewMgr->getActiveView())){
- if(SVTK_Selector* aSelector = aView->GetSelector()){
- const SALOME_ListIO& aListIO = aSelector->StoredIObjects();
- SALOME_ListIteratorOfListIO anIter(aListIO);
- for(; anIter.More(); anIter.Next()){
- Handle(SALOME_InteractiveObject) anIO = anIter.Value();
- if(anIO->hasEntry())
- aList.append(new LightApp_SVTKDataOwner(anIO,aViewMgr->getDesktop()));
- }
- }
- }
- }
- }
- }
-}
-
-/*!
- Sets selection to selector from data owner list \a theList.
-*/
-void
-LightApp_VTKSelector
-::setSelection( const SUIT_DataOwnerPtrList& theList )
-{
- if(myViewer){
- if(SUIT_ViewManager* aViewMgr = myViewer->getViewManager()){
- if(SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(aViewMgr->getActiveView())){
- if(SVTK_Selector* aSelector = aView->GetSelector()){
- SALOME_ListIO anAppendList;
- const SALOME_ListIO& aStoredList = aSelector->StoredIObjects();
- SUIT_DataOwnerPtrList::const_iterator anIter = theList.begin();
- for(; anIter != theList.end(); ++anIter){
- const SUIT_DataOwner* aDataOwner = (*anIter).get();
- if(const LightApp_SVTKDataOwner* anOwner = dynamic_cast<const LightApp_SVTKDataOwner*>(aDataOwner)){
- aSelector->SetSelectionMode(anOwner->GetMode());
- Handle(SALOME_InteractiveObject) anIO = anOwner->IO();
-
- aSelector->AddIObject(anIO);
-
- anAppendList.Append(anIO);
- aSelector->AddOrRemoveIndex(anIO,anOwner->GetIds(),false);
- }else if(const LightApp_DataOwner* anOwner = dynamic_cast<const LightApp_DataOwner*>(aDataOwner)){
- Handle(SALOME_InteractiveObject) anIO =
- new SALOME_InteractiveObject(anOwner->entry().latin1(),"");
- aSelector->AddIObject(anIO);
- anAppendList.Append(anIO);
- }
- }
- // To remove IOs, which is not selected.
- QMap< QString, Handle( SALOME_InteractiveObject )> toRemove;
- SALOME_ListIteratorOfListIO anIt( aStoredList );
- for( ; anIt.More(); anIt.Next() )
- if( !anIt.Value().IsNull() )
- toRemove[ anIt.Value()->getEntry() ] = anIt.Value();
-
- anIt = SALOME_ListIteratorOfListIO(anAppendList);
- for( ; anIt.More(); anIt.Next() )
- toRemove.remove( anIt.Value()->getEntry() );
-
- QMap< QString, Handle( SALOME_InteractiveObject )>::const_iterator RIt = toRemove.begin(),
- REnd = toRemove.end();
- for( ; RIt!=REnd; RIt++ )
- aSelector->RemoveIObject( RIt.data() );
-
- aView->onSelectionChanged();
- }
- }
- }
- }
-}
-
-#endif
+// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D\r
+// \r
+// This library is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU Lesser General Public\r
+// License as published by the Free Software Foundation; either \r
+// version 2.1 of the License.\r
+// \r
+// This library is distributed in the hope that it will be useful \r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of \r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU \r
+// Lesser General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU Lesser General Public \r
+// License along with this library; if not, write to the Free Software \r
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+//\r
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com\r
+//\r
+#include "LightApp_VTKSelector.h"\r
+#include "LightApp_DataOwner.h"\r
+\r
+#ifndef DISABLE_VTKVIEWER\r
+ #include "SVTK_ViewModelBase.h"\r
+ #include "SVTK_ViewManager.h"\r
+ #include "SVTK_Selector.h"\r
+ #include "SVTK_ViewWindow.h"\r
+ #include "SVTK_Functor.h"\r
+ #include "VTKViewer_Algorithm.h"\r
+ #include <vtkRenderer.h>\r
+#endif\r
+\r
+#ifndef DISABLE_SALOMEOBJECT\r
+ #include "SALOME_Actor.h"\r
+ #include "SALOME_ListIteratorOfListIO.hxx"\r
+#endif\r
+\r
+\r
+\r
+#ifndef DISABLE_VTKVIEWER\r
+#ifndef DISABLE_SALOMEOBJECT\r
+/*!\r
+ Constructor.\r
+*/\r
+LightApp_SVTKDataOwner::LightApp_SVTKDataOwner( const Handle(SALOME_InteractiveObject)& theIO,\r
+ SUIT_Desktop* theDesktop )\r
+: LightApp_DataOwner( theIO ),\r
+myDesktop( theDesktop )\r
+{\r
+}\r
+#else\r
+LightApp_SVTKDataOwner::LightApp_SVTKDataOwner( const QString& theEntry )\r
+: LightApp_DataOwner( theEntry )\r
+{\r
+}\r
+#endif\r
+\r
+/*!\r
+ \return active SVTK view window\r
+*/\r
+SVTK_ViewWindow* \r
+LightApp_SVTKDataOwner\r
+::GetActiveViewWindow() const\r
+{\r
+ if(SUIT_ViewWindow* aViewWindow = myDesktop->activeWindow())\r
+ return dynamic_cast<SVTK_ViewWindow*>(aViewWindow);\r
+\r
+ return NULL;\r
+}\r
+\r
+/*!\r
+ Gets dataowners ids list.\r
+*/\r
+const TColStd_IndexedMapOfInteger& \r
+LightApp_SVTKDataOwner\r
+::GetIds() const\r
+{\r
+ if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow()){\r
+ if(SVTK_Selector* aSelector = aViewWindow->GetSelector()){\r
+ aSelector->GetIndex(IO(),myIds);\r
+ }\r
+ }\r
+\r
+ return myIds;\r
+}\r
+\r
+/*!\r
+ Gets selection mode.\r
+*/\r
+Selection_Mode\r
+LightApp_SVTKDataOwner\r
+::GetMode() const\r
+{\r
+ if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow()){\r
+ if(SVTK_Selector* aSelector = aViewWindow->GetSelector()){\r
+ return aSelector->SelectionMode();\r
+ }\r
+ }\r
+ \r
+ return -1;\r
+}\r
+\r
+/*!\r
+ Gets actor pointer.\r
+*/\r
+SALOME_Actor* \r
+LightApp_SVTKDataOwner\r
+::GetActor() const\r
+{\r
+ if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow()){\r
+ using namespace SVTK;\r
+ return Find<SALOME_Actor>(aViewWindow->getRenderer()->GetActors(),TIsSameIObject<SALOME_Actor>(IO()));\r
+ }\r
+\r
+ return NULL;\r
+}\r
+\r
+#endif\r
+\r
+/*!\r
+ Destuctor.\r
+*/\r
+/*\r
+LightApp_SVTKDataOwner::~LightApp_SVTKDataOwner()\r
+{\r
+}\r
+*/\r
+\r
+#ifndef DISABLE_VTKVIEWER\r
+/*!\r
+ Constructor.\r
+*/\r
+LightApp_VTKSelector\r
+::LightApp_VTKSelector( SVTK_ViewModelBase* viewer, \r
+ SUIT_SelectionMgr* mgr ): \r
+ SUIT_Selector( mgr, viewer ),\r
+ myViewer( viewer )\r
+{\r
+ if ( myViewer )\r
+ connect( myViewer, SIGNAL( selectionChanged() ), this, SLOT( onSelectionChanged() ) );\r
+}\r
+\r
+/*!\r
+ Gets viewer.\r
+*/\r
+SVTK_ViewModelBase* \r
+LightApp_VTKSelector\r
+::viewer() const\r
+{\r
+ return myViewer;\r
+}\r
+\r
+/*!\r
+ Gets type of salome vtk viewer.\r
+*/\r
+QString\r
+LightApp_VTKSelector\r
+::type() const\r
+{ \r
+ return myViewer->getType(); \r
+}\r
+\r
+#endif\r
+/*!\r
+ On selection changed.\r
+*/\r
+void\r
+LightApp_VTKSelector\r
+::onSelectionChanged()\r
+{\r
+ selectionChanged();\r
+}\r
+\r
+#ifndef DISABLE_VTKVIEWER\r
+\r
+/*!\r
+ Gets list of selected data owners.(output \a aList).\r
+*/\r
+void\r
+LightApp_VTKSelector\r
+::getSelection( SUIT_DataOwnerPtrList& aList ) const\r
+{\r
+ if(myViewer){\r
+ if(SUIT_ViewManager* aViewManager = myViewer->getViewManager()){\r
+ if(SVTK_ViewManager* aViewMgr = dynamic_cast<SVTK_ViewManager*>(aViewManager)){\r
+ if(SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(aViewMgr->getActiveView())){\r
+ if(SVTK_Selector* aSelector = aView->GetSelector()){\r
+ const SALOME_ListIO& aListIO = aSelector->StoredIObjects();\r
+ SALOME_ListIteratorOfListIO anIter(aListIO);\r
+ for(; anIter.More(); anIter.Next()){\r
+ Handle(SALOME_InteractiveObject) anIO = anIter.Value();\r
+ if(anIO->hasEntry())\r
+ aList.append(new LightApp_SVTKDataOwner(anIO,aViewMgr->getDesktop()));\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+}\r
+\r
+/*!\r
+ Sets selection to selector from data owner list \a theList.\r
+*/\r
+void \r
+LightApp_VTKSelector\r
+::setSelection( const SUIT_DataOwnerPtrList& theList )\r
+{\r
+ if(myViewer){\r
+ if(SUIT_ViewManager* aViewMgr = myViewer->getViewManager()){\r
+ if(SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(aViewMgr->getActiveView())){\r
+ if(SVTK_Selector* aSelector = aView->GetSelector()){\r
+ SALOME_ListIO anAppendList;\r
+ const SALOME_ListIO& aStoredList = aSelector->StoredIObjects();\r
+ SUIT_DataOwnerPtrList::const_iterator anIter = theList.begin();\r
+ for(; anIter != theList.end(); ++anIter){\r
+ const SUIT_DataOwner* aDataOwner = (*anIter).get();\r
+ if(const LightApp_SVTKDataOwner* anOwner = dynamic_cast<const LightApp_SVTKDataOwner*>(aDataOwner)){\r
+ aSelector->SetSelectionMode(anOwner->GetMode());\r
+ Handle(SALOME_InteractiveObject) anIO = anOwner->IO();\r
+\r
+ aSelector->AddIObject(anIO);\r
+\r
+ anAppendList.Append(anIO);\r
+ aSelector->AddOrRemoveIndex(anIO,anOwner->GetIds(),false);\r
+ }else if(const LightApp_DataOwner* anOwner = dynamic_cast<const LightApp_DataOwner*>(aDataOwner)){\r
+ Handle(SALOME_InteractiveObject) anIO = \r
+ new SALOME_InteractiveObject(anOwner->entry().latin1(),"");\r
+ aSelector->AddIObject(anIO);\r
+ anAppendList.Append(anIO);\r
+ }\r
+ }\r
+ // To remove IOs, which is not selected.\r
+ QMap< QString, Handle( SALOME_InteractiveObject )> toRemove;\r
+ SALOME_ListIteratorOfListIO anIt( aStoredList );\r
+ for( ; anIt.More(); anIt.Next() )\r
+ if( !anIt.Value().IsNull() )\r
+ toRemove[ anIt.Value()->getEntry() ] = anIt.Value();\r
+\r
+ anIt = SALOME_ListIteratorOfListIO(anAppendList);\r
+ for( ; anIt.More(); anIt.Next() )\r
+ toRemove.remove( anIt.Value()->getEntry() );\r
+\r
+ QMap< QString, Handle( SALOME_InteractiveObject )>::const_iterator RIt = toRemove.begin(),\r
+ REnd = toRemove.end();\r
+ for( ; RIt!=REnd; RIt++ )\r
+ aSelector->RemoveIObject( RIt.data() );\r
+ \r
+ aView->onSelectionChanged();\r
+ }\r
+ }\r
+ }\r
+ }\r
+}\r
+\r
+#endif\r
-// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef LIGHTAPP_VTKSELECTOR_H
-#define LIGHTAPP_VTKSELECTOR_H
-
-#include "SUIT_Selector.h"
-#include "LightApp.h"
-#include "LightApp_DataOwner.h"
-
-class SUIT_Desktop;
-
-#ifndef DISABLE_VTKVIEWER
- #include <vtkSmartPointer.h>
- #include <TColStd_IndexedMapOfInteger.hxx>
- #include "SVTK_Selection.h"
-#ifndef DISABLE_SALOMEOBJECT
- #include "SALOME_InteractiveObject.hxx"
-#endif
- class SALOME_Actor;
- class SVTK_ViewWindow;
- class SVTK_ViewModelBase;
-#endif
-
-/*!
- Provide salome vtk data owner list.
-*/
-class LIGHTAPP_EXPORT LightApp_SVTKDataOwner : public LightApp_DataOwner
-{
- public:
- virtual ~LightApp_SVTKDataOwner() {};
-#ifndef DISABLE_VTKVIEWER
- #ifndef DISABLE_SALOMEOBJECT
- LightApp_SVTKDataOwner( const Handle(SALOME_InteractiveObject)&, SUIT_Desktop* );
- #else
- LightApp_SVTKDataOwner( const QString& );
- #endif
-
- /*!Gets dataowners ids list.*/
- const TColStd_IndexedMapOfInteger& GetIds() const;
-
- /*!Gets selection mode.*/
- Selection_Mode GetMode() const;
-
- /*!Finds corresponding actor in the active viewer.*/
- SALOME_Actor* GetActor() const;
-
- protected:
- mutable TColStd_IndexedMapOfInteger myIds;
-
- SVTK_ViewWindow* GetActiveViewWindow() const;
- SUIT_Desktop* myDesktop;
-#endif
-};
-
-
-/*!
- \class LightApp_VTKSelector
- Custom selector to get/set selection from object browser
-*/
-class LIGHTAPP_EXPORT LightApp_VTKSelector : public SUIT_Selector
-{
- Q_OBJECT;
-
-public:
- virtual ~LightApp_VTKSelector() {};
-#ifndef DISABLE_VTKVIEWER
- LightApp_VTKSelector( SVTK_ViewModelBase*, SUIT_SelectionMgr* );
-
- SVTK_ViewModelBase* viewer() const;
-
- virtual QString type() const;
-#else
- LightApp_VTKSelector( SUIT_SelectionMgr* );
-#endif
-
-private slots:
- void onSelectionChanged();
-
-#ifndef DISABLE_VTKVIEWER
-protected:
- virtual void getSelection( SUIT_DataOwnerPtrList& ) const;
- virtual void setSelection( const SUIT_DataOwnerPtrList& );
-
-private:
- SVTK_ViewModelBase* myViewer;
-
-#endif
-};
-
-#endif
+// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D\r
+// \r
+// This library is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU Lesser General Public\r
+// License as published by the Free Software Foundation; either \r
+// version 2.1 of the License.\r
+// \r
+// This library is distributed in the hope that it will be useful \r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of \r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU \r
+// Lesser General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU Lesser General Public \r
+// License along with this library; if not, write to the Free Software \r
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+//\r
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com\r
+//\r
+#ifndef LIGHTAPP_VTKSELECTOR_H\r
+#define LIGHTAPP_VTKSELECTOR_H\r
+\r
+#include "SUIT_Selector.h"\r
+#include "LightApp.h"\r
+#include "LightApp_DataOwner.h"\r
+\r
+class SUIT_Desktop;\r
+\r
+#ifndef DISABLE_VTKVIEWER\r
+ #include <vtkSmartPointer.h>\r
+ #include <TColStd_IndexedMapOfInteger.hxx>\r
+ #include "SVTK_Selection.h"\r
+#ifndef DISABLE_SALOMEOBJECT\r
+ #include "SALOME_InteractiveObject.hxx"\r
+#endif\r
+ class SALOME_Actor;\r
+ class SVTK_ViewWindow;\r
+ class SVTK_ViewModelBase;\r
+#endif\r
+\r
+/*!\r
+ Provide salome vtk data owner list.\r
+*/\r
+class LIGHTAPP_EXPORT LightApp_SVTKDataOwner : public LightApp_DataOwner\r
+{\r
+ public:\r
+ virtual ~LightApp_SVTKDataOwner() {};\r
+#ifndef DISABLE_VTKVIEWER\r
+ #ifndef DISABLE_SALOMEOBJECT\r
+ LightApp_SVTKDataOwner( const Handle(SALOME_InteractiveObject)&, SUIT_Desktop* );\r
+ #else\r
+ LightApp_SVTKDataOwner( const QString& );\r
+ #endif\r
+\r
+ /*!Gets dataowners ids list.*/\r
+ const TColStd_IndexedMapOfInteger& GetIds() const;\r
+\r
+ /*!Gets selection mode.*/\r
+ Selection_Mode GetMode() const;\r
+\r
+ /*!Finds corresponding actor in the active viewer.*/\r
+ SALOME_Actor* GetActor() const;\r
+\r
+ protected:\r
+ mutable TColStd_IndexedMapOfInteger myIds;\r
+\r
+ SVTK_ViewWindow* GetActiveViewWindow() const;\r
+ SUIT_Desktop* myDesktop;\r
+#endif\r
+};\r
+\r
+\r
+/*!\r
+ \class LightApp_VTKSelector\r
+ Custom selector to get/set selection from object browser\r
+*/\r
+class LIGHTAPP_EXPORT LightApp_VTKSelector : public SUIT_Selector\r
+{\r
+ Q_OBJECT;\r
+\r
+public:\r
+ virtual ~LightApp_VTKSelector() {};\r
+#ifndef DISABLE_VTKVIEWER\r
+ LightApp_VTKSelector( SVTK_ViewModelBase*, SUIT_SelectionMgr* );\r
+\r
+ SVTK_ViewModelBase* viewer() const;\r
+\r
+ virtual QString type() const;\r
+#else\r
+ LightApp_VTKSelector( SUIT_SelectionMgr* );\r
+#endif\r
+\r
+private slots:\r
+ void onSelectionChanged();\r
+\r
+#ifndef DISABLE_VTKVIEWER\r
+protected:\r
+ virtual void getSelection( SUIT_DataOwnerPtrList& ) const;\r
+ virtual void setSelection( const SUIT_DataOwnerPtrList& );\r
+\r
+private:\r
+ SVTK_ViewModelBase* myViewer;\r
+\r
+#endif\r
+};\r
+\r
+#endif\r
LightApp_Dialog.h \
LightApp_Displayer.h \
LightApp_Driver.h \
+ LightApp_EventFilter.h \
LightApp_HDFDriver.h \
LightApp_Module.h \
LightApp_ModuleDlg.h \
LightApp_Dialog.cxx \
LightApp_Displayer.cxx \
LightApp_Driver.cxx \
+ LightApp_EventFilter.cxx \
LightApp_HDFDriver.cxx \
LightApp_Module.cxx \
LightApp_ModuleDlg.cxx \
modules = LIGHT
[resources]
-SUIT = $(SUITRoot)/resources
-STD = $(SUITRoot)/resources
-LightApp = $(SUITRoot)/resources
-Plot2d = $(SUITRoot)/resources
-GLViewer = $(SUITRoot)/resources
-OCCViewer = $(SUITRoot)/resources
-VTKViewer = $(SUITRoot)/resources
-LIGHT = $(LIGHT_ROOT_DIR)/share/salome/resources
+SUIT = $(GUI_ROOT_DIR)/share/salome/resources/gui
+STD = $(GUI_ROOT_DIR)/share/salome/resources/gui
+LightApp = $(GUI_ROOT_DIR)/share/salome/resources/gui
+Plot2d = $(GUI_ROOT_DIR)/share/salome/resources/gui
+GLViewer = $(GUI_ROOT_DIR)/share/salome/resources/gui
+OCCViewer = $(GUI_ROOT_DIR)/share/salome/resources/gui
+VTKViewer = $(GUI_ROOT_DIR)/share/salome/resources/gui
+LIGHT = $(LIGHT_ROOT_DIR)/share/salome/resources/light
[LIGHT]
name = Light
</section>
<section name="splash" >
<!-- Splash screen settings -->
- <parameter name="image" value="${SUITRoot}/resources/icon_about.png" />
+ <parameter name="image" value="${GUI_ROOT_DIR}/share/salome/resources/gui/icon_about.png" />
<parameter name="info" value="%A : %V" />
<parameter name="text_colors" value="#543AA9|#FFFFFF" />
</section>
<section name="resources">
<!-- Resource directories (resource manager)-->
- <parameter name="SUIT" value="${SUITRoot}/resources"/>
- <parameter name="STD" value="${SUITRoot}/resources"/>
- <parameter name="Plot2d" value="${SUITRoot}/resources"/>
- <parameter name="SPlot2d" value="${SUITRoot}/resources"/>
- <parameter name="GLViewer" value="${SUITRoot}/resources"/>
- <parameter name="OCCViewer" value="${SUITRoot}/resources"/>
- <parameter name="VTKViewer" value="${SUITRoot}/resources"/>
- <parameter name="SalomeApp" value="${SUITRoot}/resources"/>
- <parameter name="OB" value="${SUITRoot}/resources"/>
- <parameter name="CAM" value="${SUITRoot}/resources"/>
- <parameter name="LightApp" value="${SUITRoot}/resources"/>
- <parameter name="SVTK" value="${SUITRoot}/resources"/>
- <parameter name="ToolsGUI" value="${SUITRoot}/resources"/>
- <parameter name="LIGHT" value="${LIGHT_ROOT_DIR}/share/salome/resources"/>
+ <parameter name="SUIT" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+ <parameter name="STD" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+ <parameter name="Plot2d" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+ <parameter name="SPlot2d" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+ <parameter name="GLViewer" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+ <parameter name="OCCViewer" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+ <parameter name="VTKViewer" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+ <parameter name="SalomeApp" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+ <parameter name="OB" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+ <parameter name="CAM" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+ <parameter name="LightApp" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+ <parameter name="SVTK" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+ <parameter name="ToolsGUI" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+ <parameter name="LIGHT" value="${LIGHT_ROOT_DIR}/share/salome/resources/light"/>
</section>
<section name="desktop" >
<!-- Default GUI desktop state, position, size -->
@COMMENCE@
-SUBDIRS = Qtx DDS QDS SUIT STD CAF CAM SUITApp LogWindow ObjBrowser Prs
+SUBDIRS = Qtx Style DDS QDS SUIT STD CAF CAM SUITApp LogWindow ObjBrowser Prs
ifneq ($(DISABLE_SALOMEOBJECT),yes)
SUBDIRS += OBJECT
ifneq ($(DISABLE_SUPERVGRAPHVIEWER),yes)
SUBDIRS += SUPERVGraph
endif
-SUBDIRS += LightApp Style ResExporter
+SUBDIRS += LightApp ResExporter
ifneq ($(GUI_DISABLE_CORBA),yes)
SUBDIRS += RegistryDisplay TOOLSGUI \
GroupPointLayout->setMargin( 11 );
// Controls
- const double min = -1e+06;
- const double max = 1e+06;
+ const double min = -1e+16;
+ const double max = 1e+16;
const double step = 5;
+ const int precision = -6; // PAL12789. Minus is for using 'g' double->string conversion specifier,
+ // see QtxDblSpinBox::mapValueToText( double v )
TextLabelX = new QLabel( GroupPoint, "TextLabelX" );
TextLabelX->setText( tr("X:") );
GroupPointLayout->addWidget( TextLabelX, 0, 0 );
SpinBox_X = new QtxDblSpinBox( min, max, step, GroupPoint, "SpinBox_X" );
+ SpinBox_X->setPrecision( precision );
GroupPointLayout->addWidget( SpinBox_X, 0, 1 );
TextLabelY = new QLabel( GroupPoint, "TextLabelY" );
GroupPointLayout->addWidget( TextLabelY, 0, 2 );
SpinBox_Y = new QtxDblSpinBox( min, max, step, GroupPoint, "SpinBox_Y" );
+ SpinBox_Y->setPrecision( precision );
GroupPointLayout->addWidget( SpinBox_Y, 0, 3 );
TextLabelZ = new QLabel( GroupPoint, "TextLabelZ" );
GroupPointLayout->addWidget( TextLabelZ, 0, 4 );
SpinBox_Z = new QtxDblSpinBox( min, max, step, GroupPoint, "SpinBox_Z" );
+ SpinBox_Z->setPrecision( precision );
GroupPointLayout->addWidget( SpinBox_Z, 0, 5 );
resetButton = new QPushButton( GroupPoint, "resetButton" );
GroupDirectionLayout->addWidget( TextLabelDx, 0, 0 );
SpinBox_Dx = new QtxDblSpinBox( min, max, step, GroupDirection, "SpinBox_Dx" );
+ SpinBox_Dx->setPrecision( precision );
GroupDirectionLayout->addWidget( SpinBox_Dx, 0, 1 );
TextLabelDy = new QLabel( GroupDirection, "TextLabelDy" );
GroupDirectionLayout->addWidget( TextLabelDy, 0, 2 );
SpinBox_Dy = new QtxDblSpinBox( min, max, step, GroupDirection, "SpinBox_Dy" );
+ SpinBox_Dy->setPrecision( precision );
GroupDirectionLayout->addWidget( SpinBox_Dy, 0, 3 );
TextLabelDz = new QLabel( GroupDirection, "TextLabelDz" );
GroupDirectionLayout->addWidget( TextLabelDz, 0, 4 );
SpinBox_Dz = new QtxDblSpinBox( min, max, step, GroupDirection, "SpinBox_Dz" );
+ SpinBox_Dz->setPrecision( precision );
GroupDirectionLayout->addWidget( SpinBox_Dz, 0, 5 );
invertButton = new QPushButton( GroupDirection, "invertButton" );
{
AIS_ListIteratorOfListOfInteractive aIt;
for (aIt.Initialize(theList); aIt.More(); aIt.Next())
- myAISContext->SetSelected(aIt.Value(), false);
+ myAISContext->AddOrRemoveSelected(aIt.Value(), false);
myAISContext->UpdateCurrentViewer();
}
void OCCViewer_Viewer::switchRepresentation( const Handle(AIS_InteractiveObject)& obj,
int mode, bool update )
{
- myAISContext->SetDisplayMode( obj, (Standard_Integer)mode, true );
+ myAISContext->SetDisplayMode( obj, (Standard_Integer)mode, update );
if( update )
myV3dViewer->Update();
}
/*!
\return trihedron size
*/
-int OCCViewer_Viewer::trihedronSize() const
+double OCCViewer_Viewer::trihedronSize() const
{
- int sz = 0;
+ double sz = 0;
if ( !myTrihedron.IsNull() )
- sz = (int)myTrihedron->Size();
+ sz = myTrihedron->Size();
return sz;
}
Changes trihedron size
\param sz - new size
*/
-void OCCViewer_Viewer::setTrihedronSize( const int sz )
+void OCCViewer_Viewer::setTrihedronSize( const double sz )
{
if ( !myTrihedron.IsNull() )
myTrihedron->SetSize( sz );
bool isTrihedronVisible() const;
virtual void setTrihedronShown( const bool );
- int trihedronSize() const;
- virtual void setTrihedronSize( const int );
+ double trihedronSize() const;
+ virtual void setTrihedronSize( const double );
public slots:
void onClearViewAspects();
if ( listView() && !listView()->allColumnsShowFocus() )
W = width( p->fontMetrics(), listView(), c );
- QListViewItem::paintCell( p, col_group, c, min( W, w ), align );
+ QListViewItem::paintCell( p, col_group, c, min( W, w ), align );
}
/*!
Plot2d_ViewManager.h \
Plot2d_ViewModel.h \
Plot2d_ViewWindow.h \
- Plot2d_SetupCurveDlg.h
+ Plot2d_SetupCurveDlg.h \
+ Plot2d_ToolTip.h
# .po files to transform in .qm
PO_FILES = Plot2d_images.po \
Plot2d_ViewManager.cxx \
Plot2d_ViewModel.cxx \
Plot2d_ViewWindow.cxx \
- Plot2d_SetupCurveDlg.cxx
+ Plot2d_SetupCurveDlg.cxx \
+ Plot2d_ToolTip.cxx
LIB_MOC = \
Plot2d_FitDataDlg.h \
Plot2d_ViewManager.h \
Plot2d_ViewModel.h \
Plot2d_ViewWindow.h \
- Plot2d_SetupCurveDlg.h
+ Plot2d_SetupCurveDlg.h \
+ Plot2d_ToolTip.h
RESOURCES_FILES = \
plot2d_clone.png \
/*!
Adds one point for curve.
*/
-void Plot2d_Curve::addPoint(double theX, double theY)
+void Plot2d_Curve::addPoint(double theX, double theY, const QString& txt )
{
Plot2d_Point aPoint;
aPoint.x = theX;
aPoint.y = theY;
+ aPoint.text = txt;
myPoints.append(aPoint);
}
/*!
Insert one point for curve on some position.
*/
-void Plot2d_Curve::insertPoint(int thePos, double theX, double theY)
+void Plot2d_Curve::insertPoint(int thePos, double theX, double theY, const QString& txt)
{
Plot2d_Point aPoint;
aPoint.x = theX;
aPoint.y = theY;
+ aPoint.text = txt;
QValueList<Plot2d_Point>::iterator aIt;
int aCurrent = 0;
/*!
Sets curve's data.
*/
-void Plot2d_Curve::setData( const double* hData, const double* vData, long size )
+void Plot2d_Curve::setData( const double* hData, const double* vData, long size, const QStringList& lst )
{
clearAllPoints();
- for(long i = 0; i < size; i++) addPoint(hData[i], vData[i]);
+ QStringList::const_iterator anIt = lst.begin(), aLast = lst.end();
+ for( long i = 0; i < size; i++, anIt++ )
+ addPoint( hData[i], vData[i], anIt==aLast ? QString::null : *anIt );
}
/*!
{
QValueList<Plot2d_Point>::const_iterator aIt;
double aMinX = 1e150;
- int aCurrent = 0;
+ //int aCurrent = 0;
for(aIt = myPoints.begin(); aIt != myPoints.end(); ++aIt) {
if ( (*aIt).x < aMinX )
aMinX = (*aIt).x;
{
QValueList<Plot2d_Point>::const_iterator aIt;
double aMinY = 1e150;
- int aCurrent = 0;
+ //int aCurrent = 0;
for(aIt = myPoints.begin(); aIt != myPoints.end(); ++aIt) {
if ( (*aIt).y < aMinY )
aMinY = (*aIt).y;
}
return aMinY;
}
+
+/*!
+ Changes text assigned to point of curve
+ \param ind -- index of point
+ \param txt -- new text
+*/
+void Plot2d_Curve::setText( const int ind, const QString& txt )
+{
+ if( ind<0 || ind>=myPoints.count() )
+ return;
+
+ myPoints[ind].text = txt;
+}
+
+/*!
+ \return text assigned to point
+ \param ind -- index of point
+*/
+QString Plot2d_Curve::text( const int ind ) const
+{
+ if( ind<0 || ind>=myPoints.count() )
+ return QString::null;
+ else
+ return myPoints[ind].text;
+}
{
double x;
double y;
+ QString text;
} Plot2d_Point;
typedef QValueList<Plot2d_Point> pointList;
QString getHorUnits() const;
void setVerUnits( const QString& units );
QString getVerUnits() const;
- void addPoint(double theX, double theY);
- void insertPoint(int thePos, double theX, double theY);
+ void addPoint(double theX, double theY, const QString& = QString::null );
+ void insertPoint(int thePos, double theX, double theY, const QString& = QString::null );
void deletePoint(int thePos);
void clearAllPoints();
pointList getPointList() const;
- void setData( const double* hData, const double* vData, long size );
+ void setData( const double* hData, const double* vData, long size, const QStringList& = QStringList() );
double* horData() const;
double* verData() const;
+ void setText( const int, const QString& );
+ QString text( const int ) const;
+
int nbPoints() const;
bool isEmpty() const;
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File: Plot2d_ToolTip.cxx
+// Author: Alexandre SOLOVYOV
+
+#include <Plot2d_ToolTip.h>
+#include <Plot2d_ViewFrame.h>
+#include <Plot2d_Curve.h>
+
+#include <qfontmetrics.h>
+
+#include <qwt_plot.h>
+#include <qwt_plot_canvas.h>
+
+const int maxDist = 3, tip_margin = 10;
+
+
+Plot2d_ToolTip::Plot2d_ToolTip( Plot2d_ViewFrame* frame, Plot2d_Plot2d* plot )
+: QtxToolTip( plot->canvas() ),
+ myFrame( frame ),
+ myPlot( plot )
+{
+ connect( this, SIGNAL( maybeTip( QPoint, QString&, QFont&, QRect&, QRect& ) ),
+ this, SLOT( onToolTip( QPoint, QString&, QFont&, QRect&, QRect& ) ) );
+}
+
+Plot2d_ToolTip::~Plot2d_ToolTip()
+{
+}
+
+void Plot2d_ToolTip::onToolTip( QPoint p, QString& str, QFont& f, QRect& txtRect, QRect& rect )
+{
+ int curInd, pInd, dist;
+ double x, y;
+ curInd = myPlot->closestCurve( p.x(), p.y(), dist, x, y, pInd );
+
+ if( dist>maxDist )
+ return;
+
+ Plot2d_Curve* c = myFrame->getCurves().find( curInd );
+ if( !c )
+ return;
+
+ str = c->text( pInd );
+ if( !str )
+ return;
+
+ QFontMetrics m( f );
+ QStringList lst = QStringList::split( "\n", str );
+ QStringList::const_iterator anIt = lst.begin(), aLast = lst.end();
+ int w = 0, h = 0;
+ for( ; anIt!=aLast; anIt++ )
+ {
+ if( h>0 )
+ h+= m.lineSpacing();
+
+ QRect r = m.boundingRect( *anIt );
+ if( r.width()>w )
+ w = r.width();
+ h+=r.height();
+ }
+
+ txtRect = QRect( p.x(), p.y(), w, h );
+ rect = txtRect;
+}
+
+bool Plot2d_ToolTip::eventFilter( QObject* o, QEvent* e )
+{
+ bool res = QtxToolTip::eventFilter( o, e );
+ if( e && e->type() == QEvent::MouseMove )
+ {
+ QMouseEvent* me = ( QMouseEvent* )e;
+ if( me->state()==0 )
+ return true;
+ }
+ return res;
+}
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File: Plot2d_ToolTip.h
+// Author: Alexandre SOLOVYOV
+
+#ifndef PLOT2D_TOOLTIP_H
+#define PLOT2D_TOOLTIP_H
+
+#include <Plot2d.h>
+#include <QtxToolTip.h>
+
+class Plot2d_ViewFrame;
+class Plot2d_Plot2d;
+
+class PLOT2D_EXPORT Plot2d_ToolTip : public QtxToolTip
+{
+ Q_OBJECT
+
+public:
+ Plot2d_ToolTip( Plot2d_ViewFrame*, Plot2d_Plot2d* );
+ virtual ~Plot2d_ToolTip();
+
+public slots:
+ void onToolTip( QPoint, QString&, QFont&, QRect&, QRect& );
+
+protected:
+ virtual bool eventFilter( QObject*, QEvent* );
+
+private:
+ Plot2d_ViewFrame* myFrame;
+ Plot2d_Plot2d* myPlot;
+};
+
+#endif
#include "Plot2d_FitDataDlg.h"
#include "Plot2d_ViewWindow.h"
#include "Plot2d_SetupViewDlg.h"
+#include "Plot2d_ToolTip.h"
#include "SUIT_Tools.h"
#include "SUIT_Session.h"
/* Plot 2d View */
QVBoxLayout* aLayout = new QVBoxLayout( this );
myPlot = new Plot2d_Plot2d( this );
+ new Plot2d_ToolTip( this, myPlot );
+
aLayout->addWidget( myPlot );
// createActions();
parent()->eventFilter(this, aEvent);
}
}
+ setFocus();
}
/*!
Slot, called when user moves mouse
if ( myOperation != NoOpId) {
if ( myOperation == ZoomId ) {
- QwtDiMap xMap = myPlot->canvasMap( QwtPlot::xBottom );
- QwtDiMap yMap = myPlot->canvasMap( QwtPlot::yLeft );
-
- myPlot->setAxisScale( QwtPlot::yLeft,
- myPlot->invTransform( QwtPlot::yLeft, yMap.i1() ),
- myPlot->invTransform( QwtPlot::yLeft, yMap.i2() + dy ) );
- myPlot->setAxisScale( QwtPlot::xBottom,
- myPlot->invTransform( QwtPlot::xBottom, xMap.i1() ),
- myPlot->invTransform( QwtPlot::xBottom, xMap.i2() - dx ) );
- if (mySecondY) {
- QwtDiMap y2Map = myPlot->canvasMap( QwtPlot::yRight );
- myPlot->setAxisScale( QwtPlot::yRight,
- myPlot->invTransform( QwtPlot::yRight, y2Map.i1() ),
- myPlot->invTransform( QwtPlot::yRight, y2Map.i2() + dy ) );
- }
- myPlot->replot();
+ this->incrementalZoom( dx, dy );
myPnt = me.pos();
}
else if ( myOperation == PanId ) {
- QwtDiMap xMap = myPlot->canvasMap( QwtPlot::xBottom );
- QwtDiMap yMap = myPlot->canvasMap( QwtPlot::yLeft );
-
- myPlot->setAxisScale( QwtPlot::yLeft,
- myPlot->invTransform( QwtPlot::yLeft, yMap.i1()-dy ),
- myPlot->invTransform( QwtPlot::yLeft, yMap.i2()-dy ) );
- myPlot->setAxisScale( QwtPlot::xBottom,
- myPlot->invTransform( QwtPlot::xBottom, xMap.i1()-dx ),
- myPlot->invTransform( QwtPlot::xBottom, xMap.i2()-dx ) );
- if (mySecondY) {
- QwtDiMap y2Map = myPlot->canvasMap( QwtPlot::yRight );
- myPlot->setAxisScale( QwtPlot::yRight,
- myPlot->invTransform( QwtPlot::yRight, y2Map.i1()-dy ),
- myPlot->invTransform( QwtPlot::yRight, y2Map.i2()-dy ) );
- }
- myPlot->replot();
+ this->incrementalPan( dx, dy );
myPnt = me.pos();
}
}
fitData( 0, xmin, xmax, ymin, ymax, y2min, y2max );
}
}
+
+/*!
+ Incremental zooming operation
+*/
+void Plot2d_ViewFrame::incrementalPan( const int incrX, const int incrY ) {
+ QwtDiMap xMap = myPlot->canvasMap( QwtPlot::xBottom );
+ QwtDiMap yMap = myPlot->canvasMap( QwtPlot::yLeft );
+
+ myPlot->setAxisScale( QwtPlot::yLeft,
+ myPlot->invTransform( QwtPlot::yLeft, yMap.i1()-incrY ),
+ myPlot->invTransform( QwtPlot::yLeft, yMap.i2()-incrY ) );
+ myPlot->setAxisScale( QwtPlot::xBottom,
+ myPlot->invTransform( QwtPlot::xBottom, xMap.i1()-incrX ),
+ myPlot->invTransform( QwtPlot::xBottom, xMap.i2()-incrX ) );
+ if (mySecondY) {
+ QwtDiMap y2Map = myPlot->canvasMap( QwtPlot::yRight );
+ myPlot->setAxisScale( QwtPlot::yRight,
+ myPlot->invTransform( QwtPlot::yRight, y2Map.i1()-incrY ),
+ myPlot->invTransform( QwtPlot::yRight, y2Map.i2()-incrY ) );
+ }
+ myPlot->replot();
+}
+
+/*!
+ Incremental panning operation
+*/
+void Plot2d_ViewFrame::incrementalZoom( const int incrX, const int incrY ) {
+ QwtDiMap xMap = myPlot->canvasMap( QwtPlot::xBottom );
+ QwtDiMap yMap = myPlot->canvasMap( QwtPlot::yLeft );
+
+ myPlot->setAxisScale( QwtPlot::yLeft,
+ myPlot->invTransform( QwtPlot::yLeft, yMap.i1() ),
+ myPlot->invTransform( QwtPlot::yLeft, yMap.i2() + incrY ) );
+ myPlot->setAxisScale( QwtPlot::xBottom,
+ myPlot->invTransform( QwtPlot::xBottom, xMap.i1() ),
+ myPlot->invTransform( QwtPlot::xBottom, xMap.i2() - incrX ) );
+ if (mySecondY) {
+ QwtDiMap y2Map = myPlot->canvasMap( QwtPlot::yRight );
+ myPlot->setAxisScale( QwtPlot::yRight,
+ myPlot->invTransform( QwtPlot::yRight, y2Map.i1() ),
+ myPlot->invTransform( QwtPlot::yRight, y2Map.i2() + incrY ) );
+ }
+ myPlot->replot();
+}
+
+#define INCREMENT_FOR_OP 10
+
+/*!
+ Performs incremental panning to the left
+*/
+void Plot2d_ViewFrame::onPanLeft()
+{
+ this->incrementalPan( -INCREMENT_FOR_OP, 0 );
+}
+
+/*!
+ Performs incremental panning to the right
+*/
+void Plot2d_ViewFrame::onPanRight()
+{
+ this->incrementalPan( INCREMENT_FOR_OP, 0 );
+}
+
+/*!
+ Performs incremental panning to the top
+*/
+void Plot2d_ViewFrame::onPanUp()
+{
+ this->incrementalPan( 0, -INCREMENT_FOR_OP );
+}
+
+/*!
+ Performs incremental panning to the bottom
+*/
+void Plot2d_ViewFrame::onPanDown()
+{
+ this->incrementalPan( 0, INCREMENT_FOR_OP );
+}
+
+/*!
+ Performs incremental zooming in
+*/
+void Plot2d_ViewFrame::onZoomIn()
+{
+ this->incrementalZoom( INCREMENT_FOR_OP, INCREMENT_FOR_OP );
+}
+
+/*!
+ Performs incremental zooming out
+*/
+void Plot2d_ViewFrame::onZoomOut()
+{
+ this->incrementalZoom( -INCREMENT_FOR_OP, -INCREMENT_FOR_OP );
+}
QString getVisualParameters();
void setVisualParameters( const QString& parameters );
+ void incrementalPan ( const int incrX, const int incrY );
+ void incrementalZoom( const int incrX, const int incrY );
+
protected:
int testOperation( const QMouseEvent& );
void readPreferences();
void onFitData();
void onChangeBackground();
+ void onPanLeft();
+ void onPanRight();
+ void onPanUp();
+ void onPanDown();
+ void onZoomIn();
+ void onZoomOut();
+
protected slots:
void plotMousePressed( const QMouseEvent& );
void plotMouseMoved( const QMouseEvent& );
if (thePopup->count() > 0) thePopup->insertSeparator();
thePopup->insertItem("Show toolbar", this, SLOT(onShowToolbar()));
}
+ aView->RefreshDumpImage();
}
}
#include <qlayout.h>
#include <qapplication.h>
#include <qpopupmenu.h>
-#include <qimage.h>
/*!
Constructor
{
myModel = theModel;
+ myDumpImage = QImage();
+
myViewFrame = new Plot2d_ViewFrame(this, "plotView");
setCentralWidget(myViewFrame);
*/
QImage Plot2d_ViewWindow::dumpView()
{
- QPixmap px = QPixmap::grabWindow( myViewFrame->winId() );
- return px.convertToImage();
+ if ( getToolBar()->hasMouse() || myDumpImage.isNull() )
+ {
+ QPixmap px = QPixmap::grabWindow( myViewFrame->winId() );
+ return px.convertToImage();
+ }
+
+ return myDumpImage;
}
/*!
{
myViewFrame->setVisualParameters( parameters );
}
+
+/*!
+ \refresh QImage, containing all scene rendering in window
+*/
+void Plot2d_ViewWindow::RefreshDumpImage()
+{
+ QPixmap px = QPixmap::grabWindow( myViewFrame->winId() );
+ myDumpImage = px.convertToImage();
+}
#include "Plot2d.h"
#include <SUIT_ViewWindow.h>
+#include <qimage.h>
+
#ifdef WIN32
#pragma warning( disable:4251 )
#endif
virtual QString getVisualParameters();
virtual void setVisualParameters( const QString& parameters );
+
+ virtual void RefreshDumpImage();
protected:
virtual QImage dumpView();
QToolBar* myToolBar;
SUIT_ToolButton* myCurveBtn;
+
+ QImage myDumpImage;
};
#ifdef WIN32
#include <PyInterp_Dispatcher.h>
#include <SUIT_Tools.h>
+#include <SUIT_Session.h>
#include <qmap.h>
#include <qclipboard.h>
virtual void execute(){
if(myCommand != ""){
// if(MYDEBUG) MESSAGE("*** ExecCommand::execute() started");
+ SUIT_Session::SetPythonExecuted(true); // disable GUI user actions
int ret = getInterp()->run( myCommand.latin1() );
+ SUIT_Session::SetPythonExecuted(false); // enable GUI user actions
// if(MYDEBUG) MESSAGE("ExecCommand::execute() - myInterp = "<<getInterp()<<"; myCommand = '"<<myCommand.latin1()<<"' - "<<ret);
if(ret < 0)
myState = PyInterp_Event::ERROR;
int endLine = paragraphs() -1;
col = charAt( event->pos(), &par );
if ( col >= 0 && par >= 0 ) {
- if ( par != endLine || col < PROMPT_SIZE )
- setCursorPosition( endLine, paragraphLength( endLine ) );
+ // PAL12896 -->
+ if ( par != endLine || col < PROMPT_SIZE ) {
+ QPoint aPos = paragraphRect(endLine).bottomRight();
+ QMouseEvent* e = new QMouseEvent(event->type(),aPos,event->button(),event->state());
+ QTextEdit::contentsMouseReleaseEvent(e);
+ }
else
- setCursorPosition( par, col );
- QApplication::clipboard()->setSelectionMode(TRUE);
- paste();
- QApplication::clipboard()->setSelectionMode(FALSE);
+ QTextEdit::contentsMouseReleaseEvent(event);
+ // PAL12896 <--
}
}
}
* It is the caller responsability to release the lock if needed
*/
PyEval_AcquireLock();
+#ifdef WNT
_tstate = PyGILState_GetThisThreadState();
// if no thread state defined
if ( _tstate )
PyThreadState_Swap(_tstate);
else
+#endif
{
_tstate = Py_NewInterpreter(); // create an interpreter and save current state
PySys_SetArgv(PyInterp_base::_argc,PyInterp_base::_argv); // initialize sys.argv
* If builtinmodule has been initialized all the sub interpreters
* will have the same __builtin__ module
*/
- if(builtinmodule){
+
+ if(builtinmodule)
+ {
PyObject *m = PyImport_GetModuleDict();
PyDict_SetItemString(m, "__builtin__", builtinmodule);
// SCRUTE(builtinmodule->ob_refcnt); // builtinmodule reference counter
mySizes->setInsertionPolicy( QComboBox::NoInsertion );
myBold = new QCheckBox( tr( "Bold" ), this );
myItalic = new QCheckBox( tr( "Italic" ), this );
- myUnderline = new QCheckBox( tr( "Underline" ), this );
+ myUnderline = new QCheckBox( tr( "Shadow" ), this );
myPreview = new QToolButton( this );
myPreview->setText( "..." );
{
public:
Format( const QString& );
- ~Format();
+ virtual ~Format();
QString format() const;
}
}
info += ')';
- printf( QString( info + '\n' ).latin1() );
}
{
nOpen++;
if ( nOpen == 1 )
- start = i;
+ start = i;
}
else if ( str[i] == ')' )
{
nOpen--;
if ( nOpen == 0 )
- lst.append( str.mid( start, i-start+1 ) );
+ lst.append( str.mid( start, i-start+1 ) );
}
i++;
}
*/
void QtxWorkstack::setSplitter( QSplitter* splitter, const QString& parameters, QMap< QSplitter*, QValueList<int> >& sMap )
{
- printf( QString(parameters+'\n').latin1() );
if ( !::checkFormat( parameters ) ) {
printf( "\nInvalid format of workstack parameters. Positions of viewers can not be restored.\n" );
return;
// for ( QStringList::Iterator tit = children.begin(); tit != children.end(); ++tit )
// printf (" |-> child = [%s]\n", (*tit).latin1() );
- for ( it = children.begin(); it != children.end(); ++it ) {
+ for ( QStringList::Iterator it = children.begin(); it != children.end(); ++it ) {
if ( (*it).startsWith( "(splitter" ) ) {
QSplitter* newSplitter = new QSplitter( splitter );
setSplitter( newSplitter, *it, sMap );
else if ( (*it).startsWith( "(views" ) ) {
QtxWorkstackArea* newArea = createArea( splitter );
QString activeViewName = ::getValue( *it, "active" );
- QWidget* activeView = 0;
+ QWidget* activeView( 0 );
activeViewName = activeViewName.mid( 1, activeViewName.length()-2 ); // chop off ' symbols
int i = 0;
QString viewName = ::getViewName( *it, i );
dir = addSlash(dir) ;
dir = dir + "resources" ;
dir = addSlash(dir) ;
+ dir = dir + "kernel" ;
+ dir = addSlash(dir) ;
QFileInfo fileInfo( dir + filename );
if ( fileInfo.isFile() && fileInfo.exists() )
return fileInfo.filePath();
};
extern "C" PyObject *libSalomePy_getRenderer(PyObject *self, PyObject *args)
{
- return ProcessEvent( new TGetRendererEvent() );
+ //return ProcessEvent( new TGetRendererEvent() );
+ PyObject * aResult;
+ Py_BEGIN_ALLOW_THREADS // PAL12755
+ aResult = ProcessEvent( new TGetRendererEvent() );
+ Py_END_ALLOW_THREADS // PAL12755
+ return aResult;
}
/*!
};
extern "C" PyObject *libSalomePy_getRenderWindow(PyObject *self, PyObject *args)
{
- return ProcessEvent( new TGetRenderWindowEvent() );
+ //return ProcessEvent( new TGetRenderWindowEvent() );
+ PyObject * aResult;
+ Py_BEGIN_ALLOW_THREADS // PAL12755
+ aResult = ProcessEvent( new TGetRenderWindowEvent() );
+ Py_END_ALLOW_THREADS // PAL12755
+ return aResult;
}
/*!
};
extern "C" PyObject *libSalomePy_getRenderWindowInteractor(PyObject *self, PyObject *args)
{
- return ProcessEvent( new TGetRenderWindowInteractorEvent() );
+ //return ProcessEvent( new TGetRenderWindowInteractorEvent() );
+ PyObject * aResult;
+ Py_BEGIN_ALLOW_THREADS // PAL12755
+ aResult = ProcessEvent( new TGetRenderWindowInteractorEvent() );
+ Py_END_ALLOW_THREADS // PAL12755
+ return aResult;
}
/*!
QT_VERS = Qt_3_3_0
endif
+ifeq ($(QT_VERS),Qt_3_3_6)
+QT_VERS = Qt_3_3_0
+endif
+
# Sip flags
SIP_FLAGS = -t WS_X11 -t $(QT_VERS) $(PYQT_SIPFLAGS) -s ".cc" -c . -I $(PYQT_SIPS)
{
QString anIOR = QString::null;
if ( !CORBA::is_nil( getEngine() ) )
- {
- CORBA::String_var objStr = getApp()->orb()->object_to_string( getEngine() );
- anIOR = QString( objStr.in() );
- }
- return anIOR;
+ return QString( getApp()->orb()->object_to_string( getEngine() ) );
+ return QString( "" );
}
/*!
ifeq ($(QT_VERS),Qt_3_3_4)
QT_VERS = Qt_3_3_0
endif
+ifeq ($(QT_VERS),Qt_3_3_6)
+QT_VERS = Qt_3_3_0
+endif
# Sip flags
SIP_FLAGS = -t WS_X11 -t $(QT_VERS) $(PYQT_SIPFLAGS) -s ".cc" -c . -I $(PYQT_SIPS)
%End
public:
- void Clear();
- void ClearIObjects();
- void ClearFilters();
+ void Clear() /ReleaseGIL/ ;
+ void ClearIObjects() /ReleaseGIL/ ;
+ void ClearFilters() /ReleaseGIL/ ;
private:
SALOME_Selection( QObject* /TransferThis/ );
%End
public:
- static QWidget* getDesktop();
- static QWidget* getMainFrame();
- static QMenuBar* getMainMenuBar();
- static QPopupMenu* getPopupMenu( const MenuName );
- static SALOME_Selection* getSelection() /Factory/;
- static int getStudyId();
- static void putInfo( const QString&, const int = 0 );
- static const QString getActiveComponent();
- static void updateObjBrowser( const int = 0, bool = true );
+ static QWidget* getDesktop() /ReleaseGIL/ ;
+ static QWidget* getMainFrame() /ReleaseGIL/ ;
+ static QMenuBar* getMainMenuBar() /ReleaseGIL/ ;
+ static QPopupMenu* getPopupMenu( const MenuName ) /ReleaseGIL/ ;
+ static SALOME_Selection* getSelection() /Factory,ReleaseGIL/ ;
+ static int getStudyId() /ReleaseGIL/ ;
+ static void putInfo( const QString&, const int = 0 ) /ReleaseGIL/ ;
+ static const QString getActiveComponent() /ReleaseGIL/ ;
+ static void updateObjBrowser( const int = 0, bool = true ) /ReleaseGIL/ ;
static QString getFileName ( QWidget*, const QString&, const QStringList&, const QString&, bool ) /ReleaseGIL/ ;
static QStringList getOpenFileNames ( QWidget*, const QString&, const QStringList&, const QString& ) /ReleaseGIL/ ;
static QString getExistingDirectory( QWidget*, const QString&, const QString& ) /ReleaseGIL/ ;
- static void helpContext( const QString&, const QString& );
+ static void helpContext( const QString&, const QString& ) /ReleaseGIL/ ;
- static bool dumpView( const QString& );
+ static bool dumpView( const QString& ) /ReleaseGIL/ ;
- static int defaultMenuGroup();
+ static int defaultMenuGroup() /ReleaseGIL/ ;
- static int createTool( const QString& );
- static int createTool( const int, const int, const int = -1 );
- static int createTool( const int, const QString&, const int = -1 );
- static int createTool( QtxAction*, const int, const int = -1, const int = -1 );
- static int createTool( QtxAction*, const QString&, const int = -1, const int = -1 );
+ static int createTool( const QString& ) /ReleaseGIL/ ;
+ static int createTool( const int, const int, const int = -1 ) /ReleaseGIL/ ;
+ static int createTool( const int, const QString&, const int = -1 ) /ReleaseGIL/ ;
+ static int createTool( QtxAction*, const int, const int = -1, const int = -1 ) /ReleaseGIL/ ;
+ static int createTool( QtxAction*, const QString&, const int = -1, const int = -1 ) /ReleaseGIL/ ;
static int createMenu( const QString&, const int,
- const int = -1, const int = -1, const int = -1 );
+ const int = -1, const int = -1, const int = -1 ) /ReleaseGIL/ ;
static int createMenu( const QString&, const QString&,
- const int = -1, const int = -1, const int = -1 );
+ const int = -1, const int = -1, const int = -1 ) /ReleaseGIL/ ;
static int createMenu( const int, const int,
- const int = -1, const int = -1 );
+ const int = -1, const int = -1 ) /ReleaseGIL/ ;
static int createMenu( const int, const QString&,
- const int = -1, const int = -1 );
+ const int = -1, const int = -1 ) /ReleaseGIL/ ;
static int createMenu( QtxAction*, const int, const int = -1,
- const int = -1, const int = -1 );
+ const int = -1, const int = -1 ) /ReleaseGIL/ ;
static int createMenu( QtxAction*, const QString&, const int = -1,
- const int = -1, const int = -1 );
- static QtxAction* createSeparator();
+ const int = -1, const int = -1 ) /ReleaseGIL/ ;
+ static QtxAction* createSeparator() /ReleaseGIL/ ;
static QtxAction* createAction( const int, const QString&,
const QString& = QString::null, const QString& = QString::null,
- const QString& = QString::null, const int = 0, const bool = false );
+ const QString& = QString::null, const int = 0, const bool = false ) /ReleaseGIL/ ;
- static QtxAction* action( const int );
- static int actionId( const QtxAction* );
+ static QtxAction* action( const int ) /ReleaseGIL/ ;
+ static int actionId( const QtxAction* ) /ReleaseGIL/ ;
static bool clearMenu( const int = 0, const int = 0,
- const bool = true );
-
- static void addSetting ( const QString&, const QString&, const double );
- static void addSetting ( const QString&, const QString&, const int /Constrained/ );
- static void addSetting ( const QString&, const QString&, const QString& );
- static void addSetting ( const QString&, const QString&, const QColor& );
- static int integerSetting( const QString&, const QString&, const int = 0 );
- static double doubleSetting ( const QString&, const QString&, const int = 0 );
- static bool boolSetting ( const QString&, const QString&, const bool = false );
- static QString stringSetting ( const QString&, const QString&, const QString& = QString("") );
- static QColor colorSetting ( const QString&, const QString&, const QColor& = QColor() );
- static void removeSetting ( const QString&, const QString& );
+ const bool = true ) /ReleaseGIL/ ;
+
+ static void addSetting ( const QString&, const QString&, const double ) /ReleaseGIL/ ;
+ static void addSetting ( const QString&, const QString&, const int /Constrained/ ) /ReleaseGIL/ ;
+ static void addSetting ( const QString&, const QString&, const QString& ) /ReleaseGIL/ ;
+ static void addSetting ( const QString&, const QString&, const QColor& ) /ReleaseGIL/ ;
+ static int integerSetting( const QString&, const QString&, const int = 0 ) /ReleaseGIL/ ;
+ static double doubleSetting ( const QString&, const QString&, const int = 0 ) /ReleaseGIL/ ;
+ static bool boolSetting ( const QString&, const QString&, const bool = false ) /ReleaseGIL/ ;
+ static QString stringSetting ( const QString&, const QString&, const QString& = QString("") ) /ReleaseGIL/ ;
+ static QColor colorSetting ( const QString&, const QString&, const QColor& = QColor() ) /ReleaseGIL/ ;
+ static void removeSetting ( const QString&, const QString& ) /ReleaseGIL/ ;
// obsolete
- static void addStringSetting( const QString&, const QString&, bool = true );
- static void addIntSetting ( const QString&, const int, bool = true );
- static void addDoubleSetting( const QString&, const double, bool = true );
- static void removeSettings ( const QString& );
- static QString getSetting ( const QString& );
+ static void addStringSetting( const QString&, const QString&, bool = true ) /ReleaseGIL/ ;
+ static void addIntSetting ( const QString&, const int, bool = true ) /ReleaseGIL/ ;
+ static void addDoubleSetting( const QString&, const double, bool = true ) /ReleaseGIL/ ;
+ static void removeSettings ( const QString& ) /ReleaseGIL/ ;
+ static QString getSetting ( const QString& ) /ReleaseGIL/ ;
};
SALOME_View* view = dynamic_cast<SALOME_View*>( window->getViewManager()->getViewModel() );
if ( view ) {
SALOME_Prs* aPrs = view->CreatePrs( myEntry );
- myResult = aPrs->IsNull();
+ myResult = !aPrs->IsNull();
}
}
}
%include "pointer.i"
+/* Exception handler for all functions */
+%exception {
+ class PyAllowThreadsGuard {
+ public:
+ // Py_BEGIN_ALLOW_THREADS
+ PyAllowThreadsGuard() { _save = PyEval_SaveThread(); }
+ // Py_END_ALLOW_THREADS
+ ~PyAllowThreadsGuard() { PyEval_RestoreThread(_save); }
+ private:
+ PyThreadState *_save;
+ };
+
+ PyAllowThreadsGuard guard;
+
+ $action
+}
+
class SALOMEGUI_Swig
{
public:
# load this object with Nodes, Links and Datas stored in GraphEssai.xml
# (GraphEssai.xml was created with python in SuperVisionTest and GraphEssai.py)
-myGraph = Graph("@ROOT_BUILDDIR@/share/salome/resources/GraphEssai.xml")
+myGraph = Graph("@ROOT_BUILDDIR@/share/salome/resources/superv/GraphEssai.xml")
-#myGraph = Graph("/home/data/jr_HEAD/build/share/salome/resources/GraphEssai.xml")
+#myGraph = Graph("/home/data/jr_HEAD/build/share/salome/resources/superv/GraphEssai.xml")
# This DataFlow is "valid" : no loop, correct links between Nodes etc...
print myGraph.IsValid()
print " to see input and output values of nodes"
# Export will create newsupervisionexample.xml and the corresponding .py file
-print myGraph.Export("@ROOT_BUILDDIR@/share/salome/resources/newsupervisionexample.xml")
+print myGraph.Export("@ROOT_BUILDDIR@/share/salome/resources/superv/newsupervisionexample.xml")
print " "
-print "See file @ROOT_BUILDDIR@/share/salome/resources/newsupervisionexample.xml"
-print "See file @ROOT_BUILDDIR@/share/salome/resources/newsupervisionexample.py"
+print "See file @ROOT_BUILDDIR@/share/salome/resources/superv/newsupervisionexample.xml"
+print "See file @ROOT_BUILDDIR@/share/salome/resources/superv/newsupervisionexample.py"
# load this object with Nodes, Links and Datas stored in GraphEssai.xml
# (GraphEssai.xml was created with python in SuperVisionTest and GraphEssai.py)
-myGraph = Graph("@ROOT_BUILDDIR@/share/salome/resources/GraphEssai.xml")
+myGraph = Graph("@ROOT_BUILDDIR@/share/salome/resources/superv/GraphEssai.xml")
-#myGraph = Graph("/home/data/jr_HEAD/build/share/salome/resources/GraphEssai.xml")
+#myGraph = Graph("/home/data/jr_HEAD/build/share/salome/resources/superv/GraphEssai.xml")
# This DataFlow is "valid" : no loop, correct links between Nodes etc...
print myGraph.IsValid()
print " to see input and output values of nodes"
# Export will create newsupervisionexample.xml and the corresponding .py file
-print myGraph.Export("@ROOT_BUILDDIR@/share/salome/resources/newsupervisionexample.xml")
+print myGraph.Export("@ROOT_BUILDDIR@/share/salome/resources/superv/newsupervisionexample.xml")
print " "
-print "See file @ROOT_BUILDDIR@/share/salome/resources/newsupervisionexample.xml"
-print "See file @ROOT_BUILDDIR@/share/salome/resources/newsupervisionexample.py"
+print "See file @ROOT_BUILDDIR@/share/salome/resources/superv/newsupervisionexample.xml"
+print "See file @ROOT_BUILDDIR@/share/salome/resources/superv/newsupervisionexample.py"
SPlot2d.h \
SPlot2d_Curve.h \
SPlot2d_Prs.h \
- SPlot2d_ViewModel.h
+ SPlot2d_ViewModel.h \
+ SPlot2d_ViewWindow.h
# .po files to transform in .qm
PO_FILES = SPlot2d_msg_en.po
LIB_SRC = \
SPlot2d_Curve.cxx \
SPlot2d_Prs.cxx \
- SPlot2d_ViewModel.cxx
+ SPlot2d_ViewModel.cxx \
+ SPlot2d_ViewWindow.cxx
LIB_MOC = \
- SPlot2d_ViewModel.h
+ SPlot2d_ViewModel.h \
+ SPlot2d_ViewWindow.h
CPPFLAGS+=$(QT_INCLUDES) $(OCC_INCLUDES) $(QWT_INCLUDES) $(BOOST_CPPFLAGS)
LDFLAGS+=$(QT_MT_LIBS) $(QWT_LIBS) -lsuit -lPlot2d -lSalomePrs
#include "SPlot2d_ViewModel.h"
+#include "SPlot2d_ViewWindow.h"
+
#include "SPlot2d_Prs.h"
#include "SUIT_Session.h"
#include "SUIT_Application.h"
newVF->displayCurve( *anIt, false );
newVF->Repaint();
}
+
+/*!
+ create SPlot2d_ViewWindow
+*/
+SUIT_ViewWindow* SPlot2d_Viewer::createView( SUIT_Desktop* theDesktop )
+{
+ SPlot2d_ViewWindow* aPlot2dView = new SPlot2d_ViewWindow(theDesktop, this);
+ if (getPrs())
+ aPlot2dView->getViewFrame()->Display(getPrs());
+ return aPlot2dView;
+}
void rename( const Handle(SALOME_InteractiveObject)&, const QString&, Plot2d_ViewFrame* = 0 );
void renameAll( const Handle(SALOME_InteractiveObject)&, const QString& );
bool isInViewer( const Handle(SALOME_InteractiveObject)& IObject );
+
+ virtual SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
/* display */
void Display( const Handle(SALOME_InteractiveObject)& IObject, bool update = true );
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#include "SPlot2d_ViewWindow.h"
+
+#include "Plot2d_ViewFrame.h"
+
+#include "SUIT_Accel.h"
+
+/*!
+ Constructor
+*/
+SPlot2d_ViewWindow
+::SPlot2d_ViewWindow( SUIT_Desktop* theDesktop,
+ Plot2d_Viewer* theModel)
+ : Plot2d_ViewWindow( theDesktop, theModel )
+{
+}
+
+/*!
+ Destructor
+*/
+SPlot2d_ViewWindow
+::~SPlot2d_ViewWindow()
+{
+}
+
+/*!
+ Performs action
+ \param theAction - type of action
+*/
+bool
+SPlot2d_ViewWindow
+::action( const int theAction )
+{
+ switch ( theAction ) {
+ case SUIT_Accel::PanLeft:
+ getViewFrame()->onPanLeft();
+ break;
+ case SUIT_Accel::PanRight:
+ getViewFrame()->onPanRight();
+ break;
+ case SUIT_Accel::PanUp:
+ getViewFrame()->onPanUp();
+ break;
+ case SUIT_Accel::PanDown:
+ getViewFrame()->onPanDown();
+ break;
+ case SUIT_Accel::ZoomIn:
+ getViewFrame()->onZoomIn();
+ break;
+ case SUIT_Accel::ZoomOut:
+ getViewFrame()->onZoomOut();
+ break;
+ case SUIT_Accel::ZoomFit:
+ getViewFrame()->fitAll();
+ break;
+ }
+ return true;
+}
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#ifndef SPLOT2D_VIEWWINDOW_H
+#define SPLOT2D_VIEWWINDOW_H
+
+#ifdef WIN32
+#pragma warning( disable:4251 )
+#endif
+
+#include "SPlot2d.h"
+#include "Plot2d_ViewWindow.h"
+
+class SPLOT2D_EXPORT SPlot2d_ViewWindow : public Plot2d_ViewWindow
+{
+ Q_OBJECT;
+
+public:
+ SPlot2d_ViewWindow( SUIT_Desktop*, Plot2d_Viewer* );
+ virtual ~SPlot2d_ViewWindow();
+
+protected:
+ virtual bool action( const int );
+
+};
+
+#ifdef WIN32
+#pragma warning( default:4251 )
+#endif
+
+#endif
tr( "MEN_DESK_HELP_ABOUT" ), tr( "PRP_DESK_HELP_ABOUT" ),
SHIFT+Key_A, desk, false, this, SLOT( onHelpAbout() ) );
- //SRN: BugID IPAL9021, add an action "Load"
- createAction( FileLoadId, tr( "TOT_DESK_FILE_LOAD" ),
- resMgr->loadPixmap( "STD", tr( "ICON_FILE_OPEN" ) ),
- tr( "MEN_DESK_FILE_LOAD" ), tr( "PRP_DESK_FILE_LOAD" ),
- CTRL+Key_L, desk, false, this, SLOT( onLoadDoc() ) );
- //SRN: BugID IPAL9021: End
-
QtxDockAction* da = new QtxDockAction( tr( "TOT_DOCK_WINDOWS" ), tr( "MEN_DOCK_WINDOWS" ), desk );
registerAction( ViewWindowsId, da );
da->setAutoPlace( false );
createMenu( FileNewId, fileMenu, 0 );
createMenu( FileOpenId, fileMenu, 0 );
- createMenu( FileLoadId, fileMenu, 0 ); //SRN: BugID IPAL9021, add a menu item "Load"
createMenu( FileCloseId, fileMenu, 0 );
createMenu( separator(), fileMenu, -1, 0 );
createMenu( FileSaveId, fileMenu, 0 );
return res;
}
-/*! called on loading the existent study */
-void STD_Application::onLoadDoc()
-{
-}
-
/*! \retval true, if document was loaded successful, else false.*/
bool STD_Application::onLoadDoc( const QString& aName )
{
virtual void onOpenDoc();
virtual bool onOpenDoc( const QString& );
- virtual void onLoadDoc();
virtual bool onLoadDoc( const QString& );
virtual void onExit();
MenuHelpId = 7
};
- enum { FileNewId, FileOpenId, FileLoadId, FileCloseId,
+ enum { FileNewId, FileOpenId, FileCloseId,
FileSaveId, FileSaveAsId, FileExitId,
ViewStatusBarId, ViewWindowsId, NewWindowId,
EditCutId, EditCopyId, EditPasteId,
{
public:
SUIT_DataObjectKey();
- ~SUIT_DataObjectKey();
+ virtual ~SUIT_DataObjectKey();
virtual bool isLess( const SUIT_DataObjectKey* ) const = 0;
virtual bool isEqual( const SUIT_DataObjectKey* ) const = 0;
myLogoMgr->clear();
}
-
+/*!
+ Emits activated signal
+*/
+void SUIT_Desktop::emitActivated()
+{
+ emit activated();
+}
void logoRemove( const QString& );
void logoInsert( const QString&, const QPixmap&, const int = -1 );
+ void emitActivated();
+
signals:
void activated();
void deactivated();
class Signal;
SUIT_PopupClient();
- ~SUIT_PopupClient();
+ virtual ~SUIT_PopupClient();
bool connectPopupRequest( QObject* reciever, const char* slot );
bool disconnectPopupRequest( QObject* reciever, const char* slot );
if( id<0 )
continue;
- if( abs( id-id0 ) < abs( appr-id0 ) )
+ if( appr < 0 || abs( id-id0 ) < abs( appr-id0 ) )
{
appr = id;
appr_file = d.absFilePath( *anIt );
{
public:
SUIT_SelectionFilter();
- ~SUIT_SelectionFilter();
+ virtual ~SUIT_SelectionFilter();
virtual bool isOk( const SUIT_DataOwner* ) const = 0;
};
#include <dlfcn.h>
#endif
+static bool SUIT_Session_IsPythonExecuted = false;
+static QMutex SUIT_Session_PythonMutex;
+
SUIT_Session* SUIT_Session::mySession = 0;
/*! Constructor.*/
{
myActiveApp = app;
}
+
+/*!
+ \retval Return TRUE, if a command is currently executed in Python Console,
+ FALSE otherwise.
+*/
+bool SUIT_Session::IsPythonExecuted()
+{
+ bool ret;
+ SUIT_Session_PythonMutex.lock();
+ ret = SUIT_Session_IsPythonExecuted;
+ SUIT_Session_PythonMutex.unlock();
+ return ret;
+}
+
+/*!
+ Set value of boolean flag, being returned by method \a IsPythonExecuted().
+ It is supposed to set the flag to TRUE when any python command starts
+ and reset it to FALSE when the command finishes.
+*/
+void SUIT_Session::SetPythonExecuted(bool isPythonExecuted)
+{
+ SUIT_Session_PythonMutex.lock();
+ SUIT_Session_IsPythonExecuted = isPythonExecuted;
+ SUIT_Session_PythonMutex.unlock();
+}
#include "SUIT_Application.h"
#include "SUIT_ResourceMgr.h"
+#include <qmutex.h>
#include <qobject.h>
#include <qptrlist.h>
#include <qptrvector.h>
SUIT_ExceptionHandler* handler() const;
+ // To lock GUI user actions during python command execution (PAL12651)
+ static bool IsPythonExecuted();
+ static void SetPythonExecuted(bool isPythonExecuted);
+
signals:
void applicationClosed( SUIT_Application* );
LDFLAGS+=$(QT_MT_LIBS)
+ifneq ($(DISABLE_PYCONSOLE),yes)
LIBS+= -Xlinker -export-dynamic $(PYTHON_LIBS)
+endif
LIBS+= -lsuit -lqtx
LIBSFORBIN+= -lsuit -lqtx
+PLUGINDIR = $(top_builddir)/bin/salome/styles
+MYPLUGINDIR = styles
+
+$(MYPLUGINDIR): $(PLUGINDIR)
+ -$(RM) $@
+ ln -sf $< $@
+
+$(PLUGINDIR):
+ mkdir -p $@
+
+bin: $(MYPLUGINDIR)
+
@CONCLUDE@
//
#include "SUITApp_Application.h"
+#include "SUIT_Session.h"
#include "SUIT_MessageBox.h"
#include "SUIT_ExceptionHandler.h"
*/
bool SUITApp_Application::notify( QObject* receiver, QEvent* e )
{
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) < 0x060101
+ // Disable GUI user actions while python command is executed
+ if (SUIT_Session::IsPythonExecuted()) {
+ // Disable mouse and keyboard events
+ QEvent::Type aType = e->type();
+ if (aType == QEvent::MouseButtonPress || aType == QEvent::MouseButtonRelease ||
+ aType == QEvent::MouseButtonDblClick || aType == QEvent::MouseMove ||
+ aType == QEvent::Wheel || aType == QEvent::ContextMenu ||
+ aType == QEvent::KeyPress || aType == QEvent::KeyRelease ||
+ aType == QEvent::Accel || aType == QEvent::AccelOverride)
+ return false;
+ }
+#endif
+
return myExceptHandler ? myExceptHandler->handle( receiver, e ) :
QApplication::notify( receiver, e );
}
myUnstructuredGrid(vtkUnstructuredGrid::New())
{
myIsShaded = true;
+ myIsResolveCoincidentTopology = false;
Visibility = Pickable = false;
myProperty = vtkProperty::New();
myRepresentation = SVTK::Representation::Surface;
- myIsResolveCoincidentTopology = false;
+ myIsResolveCoincidentTopology = true;
vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor,
myPolygonOffsetUnits);
/*!
Redirect the request to SVTK_Renderer::GetTrihedronSize
*/
-int
+vtkFloatingPointType
SVTK_MainWindow
::GetTrihedronSize()
{
*/
void
SVTK_MainWindow
-::SetTrihedronSize( const int theSize, const bool theRelative )
+::SetTrihedronSize( const vtkFloatingPointType theSize, const bool theRelative )
{
GetRenderer()->SetTrihedronSize(theSize, theRelative);
Repaint();
bool theIsUpdate = false);
//! Redirect the request to #SVTK_Renderer::GetTrihedronSize
- int
+ vtkFloatingPointType
GetTrihedronSize();
//! Redirect the request to #SVTK_Renderer::SetTrihedronSize
void
- SetTrihedronSize(const int theSize, const bool theRelative = true);
+ SetTrihedronSize(const vtkFloatingPointType theSize, const bool theRelative = true);
//! Redirect the request to #SVTK_Renderer::AdjustActors
void
*/
void
SVTK_Renderer
-::SetTrihedronSize(int theSize, const bool theRelative)
+::SetTrihedronSize(vtkFloatingPointType theSize, const bool theRelative)
{
if(myTrihedronSize != theSize || myIsTrihedronRelative != theRelative){
myTrihedronSize = theSize;
/*!
\return size of the trihedron in percents from bounding box of the scene
*/
-int
+vtkFloatingPointType
SVTK_Renderer
::GetTrihedronSize() const
{
//! Set size of the trihedron in percents from bounding box of the scene
void
- SetTrihedronSize(int theSize, const bool theRelative = true);
+ SetTrihedronSize(vtkFloatingPointType theSize, const bool theRelative = true);
//! Get size of the trihedron in percents from bounding box of the scene
- int
+ vtkFloatingPointType
GetTrihedronSize() const;
//! Shows if the size of the trihedron is relative
//----------------------------------------------------------------------------
vtkSmartPointer<SVTK_CubeAxesActor2D> myCubeAxes;
vtkSmartPointer<VTKViewer_Trihedron> myTrihedron;
- int myTrihedronSize;
+ vtkFloatingPointType myTrihedronSize;
bool myIsTrihedronRelative;
vtkFloatingPointType myBndBox[6];
};
/*!
\return trihedron size
*/
-int SVTK_Viewer::trihedronSize() const
+vtkFloatingPointType SVTK_Viewer::trihedronSize() const
{
return myTrihedronSize;
}
\param theSize - new size
\param theRelative - new relativeness
*/
-void SVTK_Viewer::setTrihedronSize( const int theSize, const bool theRelative )
+void SVTK_Viewer::setTrihedronSize( const vtkFloatingPointType theSize, const bool theRelative )
{
myTrihedronSize = theSize;
myTrihedronRelative = theRelative;
if ( !aView->getMainWindow()->getToolBar()->isVisible() ){
thePopup->insertItem( VTKViewer_Viewer::tr( "MEN_SHOW_TOOLBAR" ), this, SLOT( onShowToolbar() ) );
}
+ aView->RefreshDumpImage();
}
}
void setBackgroundColor( const QColor& );
//! Get size of trihedron of the viewer (see #SVTK_Renderer::SetTrihedronSize)
- int trihedronSize() const;
+ vtkFloatingPointType trihedronSize() const;
//! Shows if the size of trihedron relative (see #SVTK_Renderer::SetTrihedronSize)
bool trihedronRelative() const;
//! Set size of trihedron of the viewer (see #SVTK_Renderer::SetTrihedronSize)
- void setTrihedronSize( const int, const bool = true );
+ void setTrihedronSize( const vtkFloatingPointType, const bool = true );
public:
void enableSelection(bool isEnabled);
private:
QColor myBgColor;
- int myTrihedronSize;
+ vtkFloatingPointType myTrihedronSize;
bool myTrihedronRelative;
bool mySelectionEnabled;
bool myMultiSelectionEnabled;
#include "VTKViewer_Algorithm.h"
#include "SVTK_Functor.h"
+
+namespace SVTK
+{
+ int convertAction( const int accelAction )
+ {
+ switch ( accelAction ) {
+ case SUIT_Accel::PanLeft : return SVTK::PanLeftEvent;
+ case SUIT_Accel::PanRight : return SVTK::PanRightEvent;
+ case SUIT_Accel::PanUp : return SVTK::PanUpEvent;
+ case SUIT_Accel::PanDown : return SVTK::PanDownEvent;
+ case SUIT_Accel::ZoomIn : return SVTK::ZoomInEvent;
+ case SUIT_Accel::ZoomOut : return SVTK::ZoomOutEvent;
+ case SUIT_Accel::RotateLeft : return SVTK::RotateLeftEvent;
+ case SUIT_Accel::RotateRight : return SVTK::RotateRightEvent;
+ case SUIT_Accel::RotateUp : return SVTK::RotateUpEvent;
+ case SUIT_Accel::RotateDown : return SVTK::RotateDownEvent;
+ }
+ return accelAction;
+ }
+}
+
+
+
+
+
/*!
Constructor
*/
::SVTK_ViewWindow(SUIT_Desktop* theDesktop):
SUIT_ViewWindow(theDesktop),
myMainWindow(NULL),
- myView(NULL)
+ myView(NULL),
+ myDumpImage(QImage())
{}
/*!
::setBackgroundColor( const QColor& color )
{
myMainWindow->SetBackgroundColor( color );
+ SUIT_ViewWindow::setBackgroundColor( color );
}
/*!
/*!
\return trihedron size
*/
-int
+vtkFloatingPointType
SVTK_ViewWindow
::GetTrihedronSize() const
{
*/
void
SVTK_ViewWindow
-::SetTrihedronSize(const int theSize, const bool theRelative)
+::SetTrihedronSize(const vtkFloatingPointType theSize, const bool theRelative)
{
myMainWindow->SetTrihedronSize(theSize, theRelative);
}
QImage
SVTK_ViewWindow
::dumpView()
+{
+ if ( myMainWindow->getToolBar()->hasMouse() || myDumpImage.isNull() )
+ return myMainWindow->dumpView();
+
+ return myDumpImage;
+}
+
+/*!
+ \refresh QImage, containing all scene rendering in window
+*/
+void SVTK_ViewWindow::RefreshDumpImage()
{
- return myMainWindow->dumpView();
+ myDumpImage = myMainWindow->dumpView();
}
/*!
myView->SetSelectionTolerance(theTolNodes,theTolItems);
}
-int convertAction( const int accelAction )
-{
- switch ( accelAction ) {
- case SUIT_Accel::PanLeft : return SVTK::PanLeftEvent;
- case SUIT_Accel::PanRight : return SVTK::PanRightEvent;
- case SUIT_Accel::PanUp : return SVTK::PanUpEvent;
- case SUIT_Accel::PanDown : return SVTK::PanDownEvent;
- case SUIT_Accel::ZoomIn : return SVTK::ZoomInEvent;
- case SUIT_Accel::ZoomOut : return SVTK::ZoomOutEvent;
- case SUIT_Accel::RotateLeft : return SVTK::RotateLeftEvent;
- case SUIT_Accel::RotateRight : return SVTK::RotateRightEvent;
- case SUIT_Accel::RotateUp : return SVTK::RotateUpEvent;
- case SUIT_Accel::RotateDown : return SVTK::RotateDownEvent;
- }
- return accelAction;
-}
-
/*!
Performs action
\param accelAction - action
if ( accelAction == SUIT_Accel::ZoomFit )
onFitAll();
else {
- int anEvent = convertAction( accelAction );
+ int anEvent = SVTK::convertAction( accelAction );
myMainWindow->InvokeEvent( anEvent, 0 );
}
return true;
#include "SUIT_ViewWindow.h"
#include "SALOME_InteractiveObject.hxx"
+#include <qimage.h>
+
class SUIT_Desktop;
class VTKViewer_Actor;
class vtkRenderWindow;
class vtkRenderWindowInteractor;
+namespace SVTK
+{
+ SVTK_EXPORT
+ int convertAction( const int );
+}
+
//! Define a container for SALOME VTK view window
class SVTK_EXPORT SVTK_ViewWindow : public SUIT_ViewWindow
{
GetCubeAxes();
//! Redirect the request to #SVTK_Renderer::GetTrihedronSize
- int
+ vtkFloatingPointType
GetTrihedronSize() const;
//! Redirect the request to #SVTK_Renderer::SetTrihedronSize
virtual
void
- SetTrihedronSize( const int, const bool = true );
+ SetTrihedronSize( const vtkFloatingPointType, const bool = true );
//! Redirect the request to #SVTK_Renderer::SetSelectionProp
virtual
virtual
bool
eventFilter( QObject*, QEvent* );
+
+ virtual
+ void RefreshDumpImage();
public slots:
virtual
QImage dumpView();
virtual bool action( const int );
-
+
SVTK_View* myView;
SVTK_MainWindow* myMainWindow;
SVTK_ViewModelBase* myModel;
QString myVisualParams; // used for delayed setting of view parameters
-};
-extern "C"
-{
-SVTK_EXPORT
- int convertAction( const int accelAction );
+private:
+ QImage myDumpImage;
};
#ifdef WIN32
#include <SALOME_ModuleCatalog_impl.hxx>
#include <SALOME_LifeCycleCORBA.hxx>
-#include <qmap.h>
#include <qaction.h>
#include <qcombobox.h>
#include <qlistbox.h>
#include <SALOMEDSClient_ClientFactory.hxx>
+#include <vector>
+
/*!Create new instance of SalomeApp_Application.*/
extern "C" SALOMEAPP_EXPORT SUIT_Application* createApplication()
{
/*!Constructor.*/
SalomeApp_Application::SalomeApp_Application()
: LightApp_Application()
-{
-}
+{}
/*!Destructor.
*\li Destroy event filter.
tr( "MEN_DESK_REGISTRY_DISPLAY" ), tr( "PRP_DESK_REGISTRY_DISPLAY" ),
/*SHIFT+Key_D*/0, desk, false, this, SLOT( onRegDisplay() ) );
+ //SRN: BugID IPAL9021, add an action "Load"
+ createAction( FileLoadId, tr( "TOT_DESK_FILE_LOAD" ),
+ resourceMgr()->loadPixmap( "STD", tr( "ICON_FILE_OPEN" ) ),
+ tr( "MEN_DESK_FILE_LOAD" ), tr( "PRP_DESK_FILE_LOAD" ),
+ CTRL+Key_L, desk, false, this, SLOT( onLoadDoc() ) );
+ //SRN: BugID IPAL9021: End
+
+
int fileMenu = createMenu( tr( "MEN_DESK_FILE" ), -1 );
// "Save GUI State" command is renamed to "Save VISU State" and
// creation of menu item is moved to VISU
// createMenu( SaveGUIStateId, fileMenu, 10, -1 );
+ createMenu( FileLoadId, fileMenu, 0 ); //SRN: BugID IPAL9021, add a menu item "Load"
+
createMenu( DumpStudyId, fileMenu, 10, -1 );
createMenu( separator(), fileMenu, -1, 15, -1 );
createMenu( LoadScriptId, fileMenu, 10, -1 );
}
}
+/*! Check if the study is locked */
+void SalomeApp_Application::onCloseDoc( bool ask )
+{
+ SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>(activeStudy());
+
+ if (study != NULL) {
+ _PTR(Study) stdDS = study->studyDS();
+ if(stdDS && stdDS->IsStudyLocked()) {
+ if ( SUIT_MessageBox::warn2( desktop(),
+ QObject::tr( "WRN_WARNING" ),
+ QObject::tr( "CLOSE_LOCKED_STUDY" ),
+ QObject::tr( "BUT_YES" ),
+ QObject::tr( "BUT_NO" ),
+ SUIT_YES,
+ SUIT_NO,
+ SUIT_NO ) == SUIT_NO ) return;
+
+ }
+ }
+
+ LightApp_Application::onCloseDoc( ask );
+}
+
/*!Sets enable or disable some actions on selection changed.*/
void SalomeApp_Application::onSelectionChanged()
{
#include "SalomeApp.h"
#include <LightApp_Application.h>
-#include <omniORB4/CORBA.h>
+#include <qmap.h>
+
+#include <CORBA.h>
#include <SALOMEconfig.h>
//#include CORBA_CLIENT_HEADER(SALOMEDS)
public:
enum { MenuToolsId = 5 };
enum { DumpStudyId = LightApp_Application::UserID, LoadScriptId, PropertiesId,
- CatalogGenId, RegDisplayId, SaveGUIStateId, UserID };
+ CatalogGenId, RegDisplayId, SaveGUIStateId, FileLoadId, UserID };
public:
SalomeApp_Application();
virtual void onCopy();
virtual void onPaste();
void onSaveGUIState();// called from VISU
+ virtual void onCloseDoc( bool ask = true);
protected slots:
void onStudySaved( SUIT_Study* );
void onCatalogGen();
void onRegDisplay();
void onOpenWith();
+
};
#ifdef WIN32
#include <qstring.h>
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+ #include <Standard_ErrorHandler.hxx>
+ #include <Standard_Failure.hxx>
+#else
+ #include "CASCatch.hxx"
+#endif
+
/*!Constructor. Initialize by \a floatSignal.*/
SalomeApp_ExceptionHandler::SalomeApp_ExceptionHandler( const bool floatSignal )
: SUIT_ExceptionHandler()
{
- OSD::SetSignal( floatSignal );
+ // JFA 2006-09-28: PAL10867: suppress signal catching,
+ // if environment variable DISABLE_SIGNALS_CATCHING is set to 1.
+ // Commonly this is used with "noexcepthandler" option.
+ char* envNoCatchSignals = getenv("NOT_INTERCEPT_SIGNALS");
+ if (!envNoCatchSignals || !atoi(envNoCatchSignals))
+ {
+ OSD::SetSignal( floatSignal );
+ }
}
/*!Try to call SUIT_ExceptionHandler::internalHandle(o, e), catch if failure.*/
bool SalomeApp_ExceptionHandler::handleSignals( QObject* o, QEvent* e )
{
- CASCatch_TRY {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+ try {
+ OCC_CATCH_SIGNALS;
+#else
+ CASCatch_TRY {
+#endif
SUIT_ExceptionHandler::internalHandle( o, e );
}
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+ catch(Standard_Failure) {
+#else
CASCatch_CATCH(Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+#endif
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
throw Standard_Failure( aFail->GetMessageString() );
}
-
+
return true;
}
#else
raiseFPE = false;
#endif
+
return new SalomeApp_ExceptionHandler( raiseFPE );
}
#include <qdict.h>
#include "utilities.h"
-
#include <iostream>
#include <string>
#include <vector>
#include <SUIT_Session.h>
-#include <string>
-#include <vector>
-
#include "SALOMEDS_Tool.hxx"
#include "SALOMEDSClient_ClientFactory.hxx"
_PTR(Study) studyPtr = studyDS();
if ( studyPtr )
{
- if(permanently) SalomeApp_Application::studyMgr()->Close( studyPtr );
+ if(permanently) {
+ SalomeApp_Application::studyMgr()->Close( studyPtr );
+ }
SALOMEDSClient_Study* aStudy = 0;
setStudyDS( _PTR(Study)(aStudy) );
}
modules = GEOM,SMESH,VISU
[resources]
-SUIT = $(SUITRoot)/resources
-STD = $(SUITRoot)/resources
-Plot2d = $(SUITRoot)/resources
-GLViewer = $(SUITRoot)/resources
-OCCViewer = $(SUITRoot)/resources
-VTKViewer = $(SUITRoot)/resources
-SVTK = $(SUITRoot)/resources
-LightApp = $(SUITRoot)/resources
-SalomeApp = $(SUITRoot)/resources
-GEOM = $(GEOM_ROOT_DIR)/share/salome/resources
-SMESH = $(SMESH_ROOT_DIR)/share/salome/resources
-VISU = $(VISU_ROOT_DIR)/share/salome/resources
+SUIT = $(GUI_ROOT_DIR)/share/salome/resources/gui
+STD = $(GUI_ROOT_DIR)/share/salome/resources/gui
+Plot2d = $(GUI_ROOT_DIR)/share/salome/resources/gui
+GLViewer = $(GUI_ROOT_DIR)/share/salome/resources/gui
+OCCViewer = $(GUI_ROOT_DIR)/share/salome/resources/gui
+VTKViewer = $(GUI_ROOT_DIR)/share/salome/resources/gui
+SVTK = $(GUI_ROOT_DIR)/share/salome/resources/gui
+LightApp = $(GUI_ROOT_DIR)/share/salome/resources/gui
+SalomeApp = $(GUI_ROOT_DIR)/share/salome/resources/gui
+GEOM = $(GEOM_ROOT_DIR)/share/salome/resources/geom
+SMESH = $(SMESH_ROOT_DIR)/share/salome/resources/smesh
+VISU = $(VISU_ROOT_DIR)/share/salome/resources/visu
[GEOM]
name = Geometry
</section>
<section name="splash" >
<!-- Splash screen settings -->
- <parameter name="image" value="${SUITRoot}/resources/icon_about.png" />
+ <parameter name="image" value="${GUI_ROOT_DIR}/share/salome/resources/gui/icon_about.png" />
<parameter name="info" value="%V" />
<parameter name="text_colors" value="#543AA9|#FFFFFF" />
<parameter name="progress_colors" value="#0A4E5F|#B2EFED|1" />
</section>
<section name="resources">
<!-- Resource directories (resource manager)-->
- <parameter name="SUIT" value="${SUITRoot}/resources"/>
- <parameter name="STD" value="${SUITRoot}/resources"/>
- <parameter name="Plot2d" value="${SUITRoot}/resources"/>
- <parameter name="SPlot2d" value="${SUITRoot}/resources"/>
- <parameter name="GLViewer" value="${SUITRoot}/resources"/>
- <parameter name="OCCViewer" value="${SUITRoot}/resources"/>
- <parameter name="VTKViewer" value="${SUITRoot}/resources"/>
- <parameter name="SVTK" value="${SUITRoot}/resources"/>
- <parameter name="LightApp" value="${SUITRoot}/resources"/>
- <parameter name="SalomeApp" value="${SUITRoot}/resources"/>
- <parameter name="OB" value="${SUITRoot}/resources"/>
- <parameter name="CAM" value="${SUITRoot}/resources"/>
- <parameter name="SUPERVGraph" value="${SUITRoot}/resources"/>
- <parameter name="ToolsGUI" value="${SUITRoot}/resources"/>
- <parameter name="NETGENPlugin" value="${NETGENPLUGIN_ROOT_DIR}/share/salome/resources"/>
- <parameter name="GHS3DPlugin" value="${GHS3DPLUGIN_ROOT_DIR}/share/salome/resources"/>
+ <parameter name="SUIT" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+ <parameter name="STD" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+ <parameter name="Plot2d" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+ <parameter name="SPlot2d" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+ <parameter name="GLViewer" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+ <parameter name="OCCViewer" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+ <parameter name="VTKViewer" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+ <parameter name="SVTK" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+ <parameter name="LightApp" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+ <parameter name="SalomeApp" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+ <parameter name="OB" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+ <parameter name="CAM" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+ <parameter name="SUPERVGraph" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+ <parameter name="ToolsGUI" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+ <!-- NETGENPlugin and GHS3DPlugin -->
+ <!-- Here the environment variables are used in upper case, -->
+ <!-- In SMESH/resources/SalomeApp.xml case-sensitive notation is used. -->
+ <!-- As a result, both variants are acceptable. -->
+ <parameter name="NETGENPlugin" value="${NETGENPLUGIN_ROOT_DIR}/share/salome/resources/netgenplugin"/>
+ <parameter name="GHS3DPlugin" value="${GHS3DPLUGIN_ROOT_DIR}/share/salome/resources/ghs3dplugin"/>
</section>
<section name="SMESH">
<!-- Default SMESH module plugins -->
msgid "SAVE_POINT_ROOT_NAME"
msgstr "GUI states"
+msgid "CLOSE_LOCKED_STUDY"
+msgstr "Close locked study?"
+
//=======================================================================================
msgid "SalomeApp_Application::MEN_RESTORE_VS"
BIN_SERVER_IDL =
BIN_CLIENT_IDL = SALOMEDS.idl SALOMEDS_Attributes.idl SALOME_Component.idl SALOME_Registry.idl SALOME_ModuleCatalog.idl SALOME_Exception.idl SALOME_GenericObj.idl
-CPPFLAGS += $(QT_MT_INCLUDES) $(PYTHON_INCLUDES) $(HDF5_INCLUDES) $(BOOST_CPPFLAGS) $(KERNEL_CXXFLAGS) -I$(OCC_INCLUDES)
+CPPFLAGS += $(QT_MT_INCLUDES) $(PYTHON_INCLUDES) $(HDF5_INCLUDES) $(BOOST_CPPFLAGS) $(KERNEL_CXXFLAGS) $(OCC_INCLUDES)
CXXFLAGS += $(OCC_CXXFLAGS) $(BOOST_CPPFLAGS)
LDFLAGS += $(QT_MT_LIBS) $(KERNEL_LDFLAGS) -lSalomeNS -lsuit -lSalomeLifeCycleCORBA -lOpUtil -lSALOMELocalTrace -lwith_loggerTraceCollector -lEvent -lSalomeCatalog -lSalomeDSClient $(CAS_KERNEL)
LDFLAGSFORBIN= $(LDFLAGS) $(OMNIORB_LIBS) $(HDF5_LIBS) -lqtx -lSalomeContainer -lSalomeResourcesManager -lTOOLSDS -lSalomeHDFPersist -lSalomeDSImpl -lSalomeGenericObj -lRegistry -lSalomeNotification -lSALOMEBasics
+PLUGINDIR = $(top_builddir)/bin/salome/styles
+MYPLUGINDIR = styles
+
+$(MYPLUGINDIR): $(PLUGINDIR)
+ -$(RM) $@
+ ln -sf $< $@
+
+$(PLUGINDIR):
+ mkdir -p $@
+
+bin: $(MYPLUGINDIR)
+
@CONCLUDE@
int dev = dev1*100+dev2, id = major;
id*=100; id+=minor;
id*=100; id+=release;
- id*=10000; id+=dev;
+ id*=10000;
+ if ( dev > 0 ) id+=dev-10000;
return id;
}
virtual bool notify( QObject* receiver, QEvent* e )
{
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) < 0x060101
+ // Disable GUI user actions while python command is executed
+ if (SUIT_Session::IsPythonExecuted()) {
+ // Disable mouse and keyboard events
+ QEvent::Type aType = e->type();
+ if (aType == QEvent::MouseButtonPress || aType == QEvent::MouseButtonRelease ||
+ aType == QEvent::MouseButtonDblClick || aType == QEvent::MouseMove ||
+ aType == QEvent::Wheel || aType == QEvent::ContextMenu ||
+ aType == QEvent::KeyPress || aType == QEvent::KeyRelease ||
+ aType == QEvent::Accel || aType == QEvent::AccelOverride)
+ return false;
+ }
+#endif
+
return myHandler ? myHandler->handle( receiver, e ) :
QApplication::notify( receiver, e );
}
const int __DEFAULT__ATTEMPTS__ = 300; // number of checks attemtps
// can be overrided by CSF_RepeatServerRequest
// environment variable
-const int __DEFAULT__DELAY__ = 100000; // delay between attempts (microseconds)
+const int __DEFAULT__DELAY__ = 50000; // delay between attempts (microseconds)
// can be overrided by CSF_DelayServerRequest
// environment variable
bOk = false;
for ( i = 0; i < myAttempts ; i++ ) {
QtxSplash::setStatus( info.arg( "Waiting for naming service..." ), current * myAttempts + i );
- QThread::usleep( i == 0 ? 500000 : myDelay );
+ QThread::usleep( i == 0 ? 50000 : myDelay );
try {
CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
CORBA::Object_var obj = orb->resolve_initial_references( "NameService" );
return;
}
QtxSplash::setStatus( info.arg( "Waiting for naming service...OK" ), ++current * myAttempts );
- QThread::usleep( 300000 );
+ QThread::usleep( 30000 );
// 2. Check registry server
bOk = false;
for ( i = 0; i < myAttempts ; i++ ) {
QtxSplash::setStatus( info.arg( "Waiting for registry server..." ), current * myAttempts + i );
- QThread::usleep( i == 0 ? 500000 : myDelay );
+ QThread::usleep( i == 0 ? 50000 : myDelay );
try {
CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance();
return;
}
QtxSplash::setStatus( info.arg( "Waiting for registry server...OK" ), ++current * myAttempts );
- QThread::usleep( 300000 );
+ QThread::usleep( 30000 );
// 3. Check data server
bOk = false;
for ( i = 0; i < myAttempts ; i++ ) {
QtxSplash::setStatus( info.arg( "Waiting for study server..." ), current * myAttempts + i );
- QThread::usleep( i == 0 ? 500000 : myDelay );
+ QThread::usleep( i == 0 ? 50000 : myDelay );
try {
CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance();
return;
}
QtxSplash::setStatus( info.arg( "Waiting for study server...OK" ), ++current * myAttempts );
- QThread::usleep( 300000 );
+ QThread::usleep( 30000 );
// 4. Check module catalogue server
bOk = false;
for ( i = 0; i < myAttempts ; i++ ) {
QtxSplash::setStatus( info.arg( "Waiting for module catalogue server..." ), current * myAttempts + i );
- QThread::usleep( i == 0 ? 500000 : myDelay );
+ QThread::usleep( i == 0 ? 50000 : myDelay );
try {
CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance();
return;
}
QtxSplash::setStatus( info.arg( "Waiting for module catalogue server...OK" ), ++current * myAttempts );
- QThread::usleep( 300000 );
+ QThread::usleep( 30000 );
// 5. Check data server
bOk = false;
for ( i = 0; i < myAttempts ; i++ ) {
QtxSplash::setStatus( info.arg( "Waiting for session server..." ), current * myAttempts + i );
- QThread::usleep( i == 0 ? 500000 : myDelay );
+ QThread::usleep( i == 0 ? 50000 : myDelay );
try {
CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance();
return;
}
QtxSplash::setStatus( info.arg( "Waiting for session server...OK" ), ++current * myAttempts );
- QThread::usleep( 300000 );
+ QThread::usleep( 30000 );
// 6. Check C++ container
if ( myCheckCppContainer ) {
bOk = false;
for ( i = 0; i < myAttempts ; i++ ) {
QtxSplash::setStatus( info.arg( "Waiting for C++ container..." ), current * myAttempts + i );
- QThread::usleep( i == 0 ? 500000 : myDelay );
+ QThread::usleep( i == 0 ? 50000 : myDelay );
try {
CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance();
return;
}
QtxSplash::setStatus( info.arg( "Waiting for C++ container...OK" ), ++current * myAttempts );
- QThread::usleep( 300000 );
+ QThread::usleep( 30000 );
}
// 7. Check Python container
bOk = false;
for ( i = 0; i < myAttempts ; i++ ) {
QtxSplash::setStatus( info.arg( "Waiting for Python container..." ), current * myAttempts + i );
- QThread::usleep( i == 0 ? 500000 : myDelay );
+ QThread::usleep( i == 0 ? 50000 : myDelay );
try {
CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance();
return;
}
QtxSplash::setStatus( info.arg( "Waiting for Python container...OK" ), ++current * myAttempts );
- QThread::usleep( 300000 );
+ QThread::usleep( 30000 );
}
// 8. Check supervision container
bOk = false;
for ( i = 0; i < myAttempts ; i++ ) {
QtxSplash::setStatus( info.arg( "Waiting for Supervision container..." ), current * myAttempts + i );
- QThread::usleep( i == 0 ? 500000 : myDelay );
+ QThread::usleep( i == 0 ? 50000 : myDelay );
try {
CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance();
return;
}
QtxSplash::setStatus( info.arg( "Waiting for Supervision container...OK" ), ++current * myAttempts );
- QThread::usleep( 300000 );
+ QThread::usleep( 30000 );
}
// clear splash status
splash->setProgress( 0, 0 );
LDFLAGS+=$(QT_MT_LIBS)
LIBS+=
-# create $(top_builddir)/src/Session/styles directory and copy libSalomeStyle.so there
-LIB_PLUGINDIR = $(top_builddir)/src/Session/styles
-LIB_PLUGINLIB = $(patsubst %.la, $(LIB_PLUGINDIR)/%.so, $(filter %.la, $(LIB)))
+# create $(top_builddir)/bin/salome/styles directory and
+# make link to the libSalomeStyle.so there
+PLUGINDIR = $(top_builddir)/bin/salome/styles
+PLUGIN_LIB_LA = $(patsubst %.la, $(PLUGINDIR)/%.so, $(filter %.la, $(LIB)))
+PLUGIN_LIB_SO = $(patsubst %.so, $(PLUGINDIR)/%.so, $(filter %.so, $(LIB)))
-lib: $(LIB) $(LIB_PLUGINDIR) $(LIB_PLUGINLIB)
+lib: $(LIB) $(PLUGINDIR) $(PLUGIN_LIB_LA) $(PLUGIN_LIB_SO)
-$(LIB_PLUGINDIR):
+$(PLUGINDIR):
mkdir -p $@
-$(LIB_PLUGINLIB): $(LIB_PLUGINDIR)/%.so: .libs/%.so
+$(PLUGIN_LIB_LA): $(PLUGINDIR)/%.so: %.la
+ -$(RM) $@
+ ln -sf $(patsubst %.la, %.so, $(CURDIR)/.libs/$<) $@ || true
+ ln -sf $(patsubst %.la, %.so, $(CURDIR)/.libs/$<).0 $@.0 || true
+
+$(PLUGIN_LIB_SO): $(PLUGINDIR)/%.so: %.so
-$(RM) $@
ln -sf $(CURDIR)/$< $@ || true
int textW = flags & Style_Horizontal ? rt.height() : rt.width();
int textH = flags & Style_Horizontal ? rt.width() : rt.height();
- QString title = titleText( wnd->caption(), textW, p->fontMetrics() );
-
- if ( wnd )
+ QFont old_font = p->font(), f = old_font;
+
+ QString title = titleText( wnd->caption(), textW, textH, f );
+ p->setFont( f );
+ if ( wnd )
{
- QColorGroup cgroup = wnd->isActiveWindow() ? wnd->palette().active() : wnd->palette().inactive();
- p->setPen( cgroup.highlightedText() );
+ QColorGroup cgroup = wnd->isActiveWindow() ? wnd->palette().active() : wnd->palette().inactive();
+ p->setPen( cgroup.highlightedText() );
- if ( flags & Style_Horizontal )
+ if ( flags & Style_Horizontal )
{
- p->rotate( 270.0 );
- p->translate( -(rt.height()+rt.y()), (rt.width()-rt.x()) );
- p->drawText( 0, 0, title );
- }
+ p->rotate( 270.0 );
+ p->translate( -(rt.height()+rt.y()), (rt.width()-rt.x()) );
+ p->drawText( 0, 0, title );
+ }
else
- p->drawText( 2, 2, textW, textH, AlignLeft, title );
- }
+ p->drawText( 2, 2, textW, textH, AlignLeft, title );
+ }
+ p->setFont( old_font );
}
break;
}
\param w - possible width
\param fm - font metrics
*/
-QString SalomeStyle::titleText( const QString& txt, const int W, const QFontMetrics& fm ) const
+QString SalomeStyle::titleText( const QString& txt, const int W, const int H, QFont& f ) const
{
QString res = txt.stripWhiteSpace();
+ QFontMetrics fm( f );
+ while( fm.height() > H )
+ {
+ f.setPointSize( f.pointSize()-1 );
+ fm = QFontMetrics( f );
+ }
+
if ( fm.width( res ) > W )
{
QString end( "..." );
void drawGradient( QPainter*, const QRect&, const QColor&,
const QColor&, const Direction, gradient_func ) const;
- QString titleText( const QString&, const int, const QFontMetrics& ) const;
+ QString titleText( const QString&, const int, const int, QFont& f ) const;
private:
QWidget* myTitleParent;
dir = addSlash(dir) ;
dir = dir + "resources" ;
dir = addSlash(dir) ;
+ dir = dir + "kernel" ;
+ dir = addSlash(dir) ;
QFileInfo fileInfo( dir + filename );
if ( fileInfo.isFile() && fileInfo.exists() )
return fileInfo.filePath();
LDFLAGSFORBIN=$(LDFLAGS)
-@CONCLUDE@
\ No newline at end of file
+@CONCLUDE@
#include <set>
#include <map>
+
+#ifdef WNT
#include <algorithm>
+#endif
#include <vtkUnstructuredGrid.h>
#include <vtkGeometryFilter.h>
VTKViewer_DelaunayTriangulator
::InitPoints()
{
+ myPoints->Reset();
myUnstructuredGrid->Initialize();
myUnstructuredGrid->Allocate();
myUnstructuredGrid->SetPoints(myPoints);
vtkIdType aNumPts;
myInput->GetCellPoints(myCellId,aNumPts,myPointIds);
+
+ if ( aNumPts < myPoints->GetNumberOfPoints() )
+ myPoints->Reset();
+
{
vtkFloatingPointType aPntCoord[3];
myPoints->SetNumberOfPoints(aNumPts);
}
}
+ myPoints->Modified();
+ myUnstructuredGrid->Modified();
+
myGeometryFilter->Update();
myPolyData = myGeometryFilter->GetOutput();
-
+
return myPoints;
}
//#define USE_ROBUST_TRIANGULATION
-//----------------------------------------------------------------------------
vtkCxxRevisionMacro(VTKViewer_GeometryFilter, "$Revision$");
vtkStandardNewMacro(VTKViewer_GeometryFilter);
-// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
/*=========================================================================
Program: Visualization Toolkit
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the above copyright notice for more information.
+ PURPOSE. See the above copyright notice for more information.*/
-=========================================================================*/
// VTKViewer_VectorText.cxx is a copy of vtkVectorText.cxx file.
// Purpose of copying: to remove linking to libHybrid.so VTK library
-// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
/*=========================================================================
Program: Visualization Toolkit
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the above copyright notice for more information.
+ PURPOSE. See the above copyright notice for more information.*/
-=========================================================================*/
// .NAME vtkVectorText - create polygonal text
// .SECTION Description