From: prascle Date: Mon, 4 Apr 2005 06:22:46 +0000 (+0000) Subject: PR: merge from tag V2_2_2 X-Git-Tag: BR_V220_LifeCycle_20050520~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=71fd48fc86be144012bb19f4329b0e2de7aa9532;p=modules%2Fkernel.git PR: merge from tag V2_2_2 --- diff --git a/INSTALL b/INSTALL index f3e4b6917..b4672cadd 100644 --- a/INSTALL +++ b/INSTALL @@ -1,7 +1,10 @@ -This is the version 2.2.0 of KERNEL +This is the version 2.2.2 of KERNEL Previous versions : - - 2.1.0 + - 2.2.1 + - 2.2.0 + - 2.1.1 + - 2.1.0 - 2.0.0 - 1.4.1 - 1.3.0 diff --git a/bin/VERSION b/bin/VERSION index 9f5dca975..aaa365137 100755 --- a/bin/VERSION +++ b/bin/VERSION @@ -1 +1 @@ -THIS IS SALOME - KERNEL VERSION: 2.2.0 +THIS IS SALOME - KERNEL VERSION: 2.2.2 diff --git a/bin/orbmodule.py b/bin/orbmodule.py index 627a90987..fdc254472 100755 --- a/bin/orbmodule.py +++ b/bin/orbmodule.py @@ -47,7 +47,7 @@ class client: try: self.rootContext = obj._narrow(CosNaming.NamingContext) return - except CORBA.COMM_FAILURE: + except (CORBA.TRANSIENT,CORBA.OBJECT_NOT_EXIST,CORBA.COMM_FAILURE): self.rootContext = None print "Lancement du Naming Service", @@ -62,7 +62,7 @@ class client: obj = self.orb.resolve_initial_references("NameService") self.rootContext = obj._narrow(CosNaming.NamingContext) break - except (CORBA.COMM_FAILURE,CORBA.OBJECT_NOT_EXIST): + except (CORBA.TRANSIENT,CORBA.OBJECT_NOT_EXIST,CORBA.COMM_FAILURE): self.rootContext = None sys.stdout.write('+') sys.stdout.flush() @@ -77,15 +77,16 @@ class client: def showNScontext(self,context,dec=''): bl,bi=context.list(0) - ok,b=bi.next_one() - while(ok): - for s in b.binding_name : - print "%s%s.%s" %(dec,s.id,s.kind) - if s.kind == "dir": - obj=context.resolve([s]) - scontext = obj._narrow(CosNaming.NamingContext) - self.showNScontext(scontext,dec=dec+' ') + if bi is not None: ok,b=bi.next_one() + while(ok): + for s in b.binding_name : + print "%s%s.%s" %(dec,s.id,s.kind) + if s.kind == "dir": + obj=context.resolve([s]) + scontext = obj._narrow(CosNaming.NamingContext) + self.showNScontext(scontext,dec=dec+' ') + ok,b=bi.next_one() # -------------------------------------------------------------------------- @@ -112,7 +113,7 @@ class client: obj = None except CosNaming.NamingContext.CannotProceed, ex: obj = None - except CORBA.COMM_FAILURE, ex: + except (CORBA.TRANSIENT,CORBA.OBJECT_NOT_EXIST,CORBA.COMM_FAILURE): obj = None return obj @@ -155,7 +156,7 @@ class client: obj = None except CosNaming.NamingContext.CannotProceed, ex: obj = None - except CORBA.COMM_FAILURE, ex: + except (CORBA.TRANSIENT,CORBA.OBJECT_NOT_EXIST,CORBA.COMM_FAILURE): obj = None return obj diff --git a/bin/runSalome.py b/bin/runSalome.py index e423d97ba..055268c56 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -222,7 +222,7 @@ def kill_salome(args): # ----------------------------------------------------------------------------- # -# Définition des classes d'objets pour le lancement des Server CORBA +# Definition des classes d'objets pour le lancement des Server CORBA # class Server: @@ -409,6 +409,41 @@ class SessionServer(Server): # --- +class ContainerManagerServer(Server): + def __init__(self,args): + self.args=args + self.initArgs() + self.SCMD1=['SALOME_ContainerManagerServer'] + self.SCMD2=[] + if 'registry' in self.args['embedded']: + self.SCMD1+=['--with','Registry', + '(','--salome_session','theSession',')'] + if 'moduleCatalog' in self.args['embedded']: + self.SCMD1+=['--with','ModuleCatalog','(','-common'] + self.SCMD2+=['-personal', + '${HOME}/Salome/resources/CatalogModulePersonnel.xml',')'] + if 'study' in self.args['embedded']: + self.SCMD2+=['--with','SALOMEDS','(',')'] + if 'cppContainer' in self.args['embedded']: + self.SCMD2+=['--with','Container','(','FactoryServer',')'] + + def setpath(self,modules_list,modules_root_dir): + cata_path=[] + list_modules = modules_list[:] + list_modules.reverse() + for module in ["KERNEL"] + list_modules: + module_root_dir=modules_root_dir[module] + module_cata=module+"Catalog.xml" + print " ", module_cata + cata_path.extend( + glob.glob(os.path.join(module_root_dir,"share", + self.args['appname'],"resources", + module_cata))) + if 'moduleCatalog' in self.args['embedded']: + self.CMD=self.SCMD1 + [string.join(cata_path,':')] + self.SCMD2 + else: + self.CMD=self.SCMD1 + self.SCMD2 + class NotifyServer(Server): def __init__(self,args,modules_root_dir): self.args=args @@ -473,7 +508,7 @@ def startSalome(args, modules_list, modules_root_dir): # # Lancement Registry Server, - # attente de la disponibilité du Registry dans le Naming Service + # attente de la disponibilite du Registry dans le Naming Service # if 'registry' not in args['embedded']: @@ -483,7 +518,7 @@ def startSalome(args, modules_list, modules_root_dir): # # Lancement Catalog Server, - # attente de la disponibilité du Catalog Server dans le Naming Service + # attente de la disponibilite du Catalog Server dans le Naming Service # @@ -496,7 +531,7 @@ def startSalome(args, modules_list, modules_root_dir): # # Lancement SalomeDS Server, - # attente de la disponibilité du SalomeDS dans le Naming Service + # attente de la disponibilite du SalomeDS dans le Naming Service # os.environ["CSF_PluginDefaults"] \ @@ -521,6 +556,14 @@ def startSalome(args, modules_list, modules_root_dir): myServer.run() clt.waitNS("/myStudyManager") + # + # Lancement ContainerManagerServer + # + + myCmServer = ContainerManagerServer(args) + myCmServer.setpath(modules_list,modules_root_dir) + myCmServer.run() + # # Lancement Session Server # @@ -532,7 +575,7 @@ def startSalome(args, modules_list, modules_root_dir): #macomm2=['ddd'] #pid = os.spawnvp(os.P_NOWAIT, macomm2[0], macomm2) # - # Attente de la disponibilité du Session Server dans le Naming Service + # Attente de la disponibilite du Session Server dans le Naming Service # import SALOME @@ -550,7 +593,7 @@ def startSalome(args, modules_list, modules_root_dir): # # Lancement Container C++ local, - # attente de la disponibilité du Container C++ local dans le Naming Service + # attente de la disponibilite du Container C++ local dans le Naming Service # if 'cppContainer' in args['standalone']: @@ -560,7 +603,7 @@ def startSalome(args, modules_list, modules_root_dir): # # Lancement Container Python local, - # attente de la disponibilité du Container Python local + # attente de la disponibilite du Container Python local # dans le Naming Service # @@ -571,7 +614,7 @@ def startSalome(args, modules_list, modules_root_dir): # # Lancement Container Supervision local, - # attente de la disponibilité du Container Supervision local + # attente de la disponibilite du Container Supervision local # dans le Naming Service # diff --git a/bin/salomeConsole.py b/bin/salomeConsole.py index 03c0a5e51..5ce7cec64 100755 --- a/bin/salomeConsole.py +++ b/bin/salomeConsole.py @@ -66,7 +66,7 @@ class client(orbmodule.client): try: self.rootContext = obj._narrow(CosNaming.NamingContext) return - except CORBA.COMM_FAILURE: + except (CORBA.TRANSIENT,CORBA.OBJECT_NOT_EXIST,CORBA.COMM_FAILURE): print "It's not a valid naming service" self.rootContext = None raise diff --git a/doc/salome/gui/KERNEL/cshdat_robohelp.htm b/doc/salome/gui/KERNEL/cshdat_robohelp.htm index af163f8e1..81b659adc 100755 --- a/doc/salome/gui/KERNEL/cshdat_robohelp.htm +++ b/doc/salome/gui/KERNEL/cshdat_robohelp.htm @@ -1,9 +1,9 @@ -SALOME reference manual - +KERNEL + - + + KERNEL + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/doc/salome/gui/KERNEL/kernel.log b/doc/salome/gui/KERNEL/kernel.log new file mode 100755 index 000000000..c766a704d --- /dev/null +++ b/doc/salome/gui/KERNEL/kernel.log @@ -0,0 +1,272 @@ +|SourceProjectName:KERNEL.hpr +|DestinationProjectName:kernel.htm +whhost.js +whmsg.js +whmozemu.js +whproxy.js +whstub.js +whutils.js +whver.js +whform.js +whphost.js +whstart.js +whtopic.js +whframes.js +whlang.js +whskin_info.htm +whskin_blank.htm +whskin_pickup.htm +whskin_homepage.htm +whskin_tw.htm +whnjs.htm +whthost.js +whtdhtml.htm +whihost.js +whibody.htm +whiform.htm +whfhost.js +whfbody.htm +whfform.htm +whghost.js +whgbody.htm +whgdhtml.htm +whgdef.htm +whproj.js +whproj.xml +whproj.htm +whxdata\whtoc.xml +whxdata\whidx.xml +whxdata\whfts.xml +whxdata\whglo.xml +whdata\whtoc.js +whdata\whtoc.htm +whdata\whtdata.js +whdata\whidx.js +whdata\whidx.htm +whdata\whidata.js +whdata\whfts.js +whdata\whfts.htm +whdata\whglo.js +whdata\whglo.htm +whdata\whgdata.js +whdata\whftdata.js +whdata\whfwdata.js +whres.xml +webhelp.jar +webhelp.cab +whgdata\whnvp30.htm +whgdata\whnvp31.htm +whgdata\whnvp32.htm +whgdata\whnvp33.htm +whgdata\whnvt30.htm +whgdata\whnvt31.htm +whgdata\whnvt32.htm +whgdata\whnvt33.htm +whgdata\whnvf30.htm +whgdata\whnvf31.htm +whgdata\whnvf32.htm +whgdata\whnvf33.htm +whgdata\whnvl31.htm +whgdata\whnvl32.htm +whgdata\whnvl33.htm +whgdata\whexpbar.gif +cshdat_webhelp.htm +whcsh_home.htm +whcshdata.htm +cshdat_robohelp.htm +wht_tab0.gif +wht_tab1.gif +wht_tab2.gif +wht_tab3.gif +wht_tab4.gif +wht_tab5.gif +wht_tab6.gif +wht_tab7.gif +wht_tab8.gif +wht_glo_h.gif +wht_glo_n.gif +wht_fts_h.gif +wht_fts_n.gif +wht_idx_h.gif +wht_idx_n.gif +wht_toc_h.gif +wht_toc_n.gif +wht_ws.gif +wht_ws_g.gif +wht_logo1.gif +wht_logo2.gif +wht_abgw.jpg +wht_abgi.jpg +wht_abge.jpg +wht_abtw.jpg +wht_abte.jpg +wht_abti.jpg +wht_spac.gif +wht_next.gif +wht_next_g.gif +wht_prev.gif +wht_prev_g.gif +wht_sync.gif +wht_hide.gif +wht_go.gif +whstart.ico +whestart.ico +whrstart.ico +whidhtml.htm +whfdhtml.htm +whskin_banner.htm +whtbar.js +whskin_pdhtml.htm +whskin_papplet.htm +whskin_plist.htm +whskin_tbars.htm +whskin_mbars.htm +wht_toc4.gif +wht_toc1.gif +wht_toc2.gif +wht_toc3.gif +whskin_frmset010.htm +whst_topics.xml +whskin_frmset01.htm +kernel_hha.hhk +kernel.hhc +kernel.hhk +kernel\about_salome_pro_architecture.htm +kernel\about_salome_pro_help_system.htm +kernel\copyright_notice.htm +kernel\creating_a_new_study.htm +kernel\displaying_hiding_toolbars.htm +kernel\displaying_studies.htm +kernel\editing_studies.htm +kernel\getting_properties_of_the_study.htm +kernel\getting_started2.htm +kernel\introduction.htm +kernel\introduction_to_iapp.htm +kernel\introduction_to_salome_pro.htm +kernel\navigating_topics.htm +kernel\opening_studies.htm +kernel\readme.html +kernel\running_salome_pro.htm +kernel\salome_pro_desktop.htm +kernel\saving_a_study.htm +kernel\setting_preferences.htm +kernel\using_catalog_generator.htm +kernel\using_left-hand_tabs.htm +kernel\using_object_browser.htm +kernel\using_registry.htm +kernel\using_usecase_browser.htm +ehelp.xml +robohhre.lng +texture_horiz_ltbluebubbles.jpg +kernel.glo +default.css +image59.gif +pics\frontv.jpg +pics\fitall.jpg +pics\desktop3.jpg +pics\removeobj.jpg +pics\registy1.jpg +pics\sheme1.jpg +pics\open.jpg +pics\bottomv.jpg +pics\clear.jpg +pics\sheme2.jpg +occ.jpg +pics\globalpanning.jpg +pics\usecasebrsr.jpg +image2.jpg +pics\readmepage.png +tip1.gif +pics\rightv.jpg +pics\objbrowser2.jpg +pics\newobj.jpg +pics\save.jpg +pics\panning.jpg +pics\zoom.jpg +pics\trihedron.jpg +pics\newsticn.jpg +pics\fitrect.jpg +pics\usecasebr.jpg +image60.gif +pics\rotate.jpg +image61.gif +pics\copy-paste.jpg +image4.gif +pics\exemple.gif +pics\setcurrent.jpg +pics\tile.jpg +pics\topv.jpg +pics\close.jpg +pics\application-splash.jpg +i_blue.jpg +image7.gif +pics\productpage.png +pics\cascade.jpg +pics\undo-redo.jpg +note1.gif +pics\progresspage.png +image57.gif +pics\leftv.jpg +pics\backv.jpg +pics\addobj.jpg +image58.gif +pics\choicepage.png +pics\reset.jpg +pics\dump.jpg +kernel.ppf +ehlpdhtm.js +ss_btn_related_topics.gif +default_ns.css +whxdata\whtdata0.xml +whxdata\whftdata0.xml +whxdata\whfwdata0.xml +whxdata\whgdata0.xml +whdata\whtdata0.htm +whdata\whftdata0.htm +whdata\whfwdata0.htm +whdata\whgdata0.htm +whgdata\whlstt0.htm +whgdata\whlstt1.htm +whgdata\whlstt2.htm +whgdata\whlstt3.htm +whgdata\whlstt4.htm +whgdata\whlsti0.htm +whgdata\whlstfl0.htm +whgdata\whlstfl1.htm +whgdata\whlstfl2.htm +whgdata\whlstfl3.htm +whgdata\whlstfl4.htm +whgdata\whlstfl5.htm +whgdata\whlstfl6.htm +whgdata\whlstfl7.htm +whgdata\whlstfl8.htm +whgdata\whlstfl9.htm +whgdata\whlstfl10.htm +whgdata\whlstfl11.htm +whgdata\whlstfl12.htm +whgdata\whlstfl13.htm +whgdata\whlstfl14.htm +whgdata\whlstfl15.htm +whgdata\whlstfl16.htm +whgdata\whlstfl17.htm +whgdata\whlstfl18.htm +whgdata\whlstfl19.htm +whgdata\whlstfl20.htm +whgdata\whlstfl21.htm +whgdata\whlstfl22.htm +whgdata\whlstfl23.htm +whgdata\whlstfl24.htm +whgdata\whlstfl25.htm +whgdata\whlstf0.htm +whgdata\whlstf1.htm +whgdata\whlstf2.htm +whgdata\whlstf3.htm +whgdata\whlstf4.htm +whgdata\whlstf5.htm +whgdata\whlstf6.htm +whgdata\whlstf7.htm +whgdata\whlstf8.htm +whgdata\whlstg0.htm +kernel.htm +kernel_csh.htm +kernel_rhc.htm diff --git a/doc/salome/gui/KERNEL/kernel/about_salome_pro_architecture.htm b/doc/salome/gui/KERNEL/kernel/about_salome_pro_architecture.htm new file mode 100755 index 000000000..c5a349bf9 --- /dev/null +++ b/doc/salome/gui/KERNEL/kernel/about_salome_pro_architecture.htm @@ -0,0 +1,224 @@ + + + + + +About SALOME architecture + + + + + + + + + + + +

About SALOME architecture

+ +

SALOME + architecture + is based on CORBA technology using distributed + system model of applications. This architecture takes the concept of multitier + client/server to its natural conclusion. The distributed system model exposes all functionality + of the application as objects, each of which can use any of the services + provided by other objects in the system, or even objects in other systems. + The architecture can also blur the distinction between "client" + and "server" because the client components can also create objects + that behave in server-like roles. This architecture provides the ultimate + in flexibility.

+ +

The distributed system architecture achieves + its flexibility by encouraging (or enforcing) the definition of specific + component interfaces. The interface of a component specifies to other + components what services are offered by that component and how they are + used. As long as the interface of a component remains constant, that component's + implementation can change dramatically without affecting other components. +

+ +

All + integrated into SALOME platform + software components (VISU, Geom, SMESH...)  implement + predefined interfaces. Each component provides data for the SALOME study in a form of links (stored in the + Study) to the specific data created and stored in the component. All components + represent CORBA servers and + it allows to run them on different host stations.

+ +

Another fundamental piece of the SALOME architecture is the use of the + Interface Definition Language (IDL). IDL, which specifies interfaces between + CORBA components, is instrumental in ensuring CORBA's language independence. + Because interfaces described in IDL can be mapped to any programming language, + CORBA applications and components are thus independent of the language(s) + used to implement them.

+ +

Additional + information about CORBA technology is available at www.omg.org +  

+ +

 

+ +

 In SALOME there + is a possibility to run definite components in the so-called batch mode + without GUI provided by IAPP component. In this case you can work with + these components with the help of Python commands and scripts.  

+ +

 

+ +

The + architecture of this all-inclusive platform for numerical components  responds + to the following objectives:

+ +

 

+ + + +

 

+ + + +

 

+ + + +

 

+ + + +

 

+ +

 

+ +

 

+ +

+Related Topics + + +

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/KERNEL/kernel/about_salome_pro_help_system.htm b/doc/salome/gui/KERNEL/kernel/about_salome_pro_help_system.htm new file mode 100755 index 000000000..351e7dffd --- /dev/null +++ b/doc/salome/gui/KERNEL/kernel/about_salome_pro_help_system.htm @@ -0,0 +1,111 @@ + + + + + +About SALOME help system + + + + + + + + + + + +

About SALOME help system

+ +

Welcome + to SALOME help system. This on-line help has been created in HTML format + with the help of Java applets. It can be launched with the help of any + browser (Internet Explorer, Netscape Navigator and others) and on any + platform (Windows, Macintosh, Linux, and UNIX).

+ +

 

+ +

The SALOME reference + manual contains a set of topics which are divided into different chapters + describing the functionality of different modules of the SALOME platform. + This help system contains a wide variety of navigation + components and search + utilities which will help you to get acquainted with all features + of SALOME.

+ +

 

+ +

  +Related Topics + + +

+ + + + diff --git a/doc/salome/gui/KERNEL/kernel/copyright_notice.htm b/doc/salome/gui/KERNEL/kernel/copyright_notice.htm new file mode 100755 index 000000000..02ed77c88 --- /dev/null +++ b/doc/salome/gui/KERNEL/kernel/copyright_notice.htm @@ -0,0 +1,134 @@ + + + + + +Copyright notice + + + + + + + + + + + +

Copyright notice

+ +

Copyright © 2003, by + Open CASCADE S.A.

+ +

 

+ +

PROPRIETARY + RIGHTS NOTICE: All rights reserved. No part of this material may be reproduced + or transmitted in any form or by any means, electronic, mechanical, or + otherwise, including photocopying and recording or in connection with + any information storage or retrieval system, without the permission in + writing from Open CASCADE S.A.

+ +

 

+ +

The + information contained in this document is subject to change without notice + and should not be construed as a commitment by Open CASCADE S.A. Open + CASCADE S.A. bears no responsibility for any errors that may appear in + this document.

+ +

 

+ +

The + software described in this document is furnished under a license and may + be used or copied only in accordance with the terms of such a license.

+ +

 

+ +

CAS.CADE + and Open CASCADE are registered trademarks of Open CASCADE S.A. Other + brand or product names are trademarks or registered trademarks of their + respective holders.

+ +

 

+ +

 

+ +

+ +

 

+ +

Immeuble Ariane

+ +

Domaine Technologique de Saclay

+ +

4, rue René Razel

+ +

91400 SACLAY - France

+ + + + diff --git a/doc/salome/gui/KERNEL/kernel/creating_a_new_study.htm b/doc/salome/gui/KERNEL/kernel/creating_a_new_study.htm new file mode 100755 index 000000000..2c0d32132 --- /dev/null +++ b/doc/salome/gui/KERNEL/kernel/creating_a_new_study.htm @@ -0,0 +1,176 @@ + + + + + +Creating a new study + + + + + + + + + + + + +

Creating a new study

+ +

To create a new study:

+ +

From + the main menu select File > + New or in the + standard toolbar click icon.

+ +

 

+ +

Your study will be created + with default name Study1#1. In + SALOME you can create several studies.

+ +

 

+ +

In addition to it, you + can create several windows with different activated viewers (VTK, OCC, + Plot2d) for each study.

+ +

 

+ +

To create a new window + for a definite study:

+ +

 

+ +

1.  Make + your study active: maximize it + (if it minimized) or  click + on the top control zone of the study window

+ +

 

+ +

2.  From + the main menu select Window > New + Window and from the submenu choose the viewer, which will be activated + in your new window

+ +

 

+ +

The window for your study + will be created with a default name Study1#2.

+ +

 

+ +

 

+ +

 

+ +

 

+ +

+Related Topics + + +

+ +

 

+ +

 

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/KERNEL/kernel/displaying_hiding_toolbars.htm b/doc/salome/gui/KERNEL/kernel/displaying_hiding_toolbars.htm new file mode 100755 index 000000000..0ae27d5cd --- /dev/null +++ b/doc/salome/gui/KERNEL/kernel/displaying_hiding_toolbars.htm @@ -0,0 +1,137 @@ + + + + + +Displaying/hiding toolbars + + + + + + + + + + + + +

Displaying/hiding toolbars

+ +

All toolbars in the SALOME application are context-sensitive. + Uploading of a definite component (Geom, VISU, SMESH etc.) will automatically + add some additional toolbars specific to this component.

+ +

 

+ +

To display/hide a + definite toolbar:

+ +

 

+ +

In the main menu choose + View > Toolbars, and from this + submenu mark or unmark the toolbar, you would like to display/hide.

+ +

 

+ +

By default all toolbars + are located on the top of the SALOME desktop. But you can relocate toolbars + by dragging with the mouse and dropping it in any place of the window. +

+ +

 

+ +

 

+ +

 

+ +

  +Related Topics + + +

+ + + + diff --git a/doc/salome/gui/KERNEL/kernel/displaying_studies.htm b/doc/salome/gui/KERNEL/kernel/displaying_studies.htm new file mode 100755 index 000000000..babf0b698 --- /dev/null +++ b/doc/salome/gui/KERNEL/kernel/displaying_studies.htm @@ -0,0 +1,187 @@ + + + + + +Displaying studies + + + + + + + + + + + + +

Displaying studies

+ +

In SALOME + there are several options allowing to display in different ways + your study windows in SALOME Desktop.

+ +

 

+ +

To make a cascade representation of several study windows:

+ +

 

+ +

From the main menu select + Window > Cascade.

+ +

 

+ +

It will look like as + follows:

+ +

 

+ +

+ +

 

+ +

Tiling of several + study windows:

+ +

 

+ +

From the main menu select + Window > Tile.

+ +

 

+ +

It will look like as + follows:

+ +

 

+ +

                    

+ +

 

+ +

 

+ +

To switch between + several study windows:

+ +

 

+ +

From the main menu choose + Window and select by  name + a study window for activation. This window will be displayed, maximized + and activated.

+ +

 

+ +

 

+ +

 

+ +

 

+ +

+Related Topics + + +

+ +

 

+ +

 

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/KERNEL/kernel/editing_studies.htm b/doc/salome/gui/KERNEL/kernel/editing_studies.htm new file mode 100755 index 000000000..a9f631cda --- /dev/null +++ b/doc/salome/gui/KERNEL/kernel/editing_studies.htm @@ -0,0 +1,150 @@ + + + + + +Editing studies + + + + + + + + + + + + +

Editing studies

+ +

SALOME + has some additional features allowing to edit your study within + a definite component: Undo/Redo + functionality and Copy/Paste functionality + (currently used in GEOM, VISU).

+ +

 

+ +

To undo/redo an operation:

+ +

 

+ +

In the main toolbar + click one of the icons or from the main menu choose Edit > Undo/Redo option.

+ +

 

+ +

To copy/paste a definite + object:

+ +

 

+ +

In the main toolbar + click one of the icons or from the main menu choose Edit > Copy/Paste option.

+ +

 

+ +

 

+ +

 

+ +

 

+ +

 

+ +

+Related Topics + + +

+ + + + diff --git a/doc/salome/gui/KERNEL/kernel/getting_properties_of_the_study.htm b/doc/salome/gui/KERNEL/kernel/getting_properties_of_the_study.htm new file mode 100755 index 000000000..890631a35 --- /dev/null +++ b/doc/salome/gui/KERNEL/kernel/getting_properties_of_the_study.htm @@ -0,0 +1,185 @@ + + + + + +Getting properties of the study + + + + + + + + + + + + +

Getting and setting study properties

+ +

To view the properties + of the current study:

+ +

 

+ +

From the main menu select + File > Properties option. The + following dialog box will appear:

+ +

 

+ +

+ +

 

+ +

This dialog box gives + complete information about your study.

+ +

 

+ +

To change the name of the study author:

+ +

 

+ +

In this dialog box click + on the Author field and enter + a new name.

+ +

 

+ +

To view the list of changes made with your study:

+ +

 

+ +

In this dialog box click + on the Modifications field and + scroll it down. Each record contains the following information: date and + time of modification of the study, name of the user, who has made these + changes.    

+ +

 

+ +

To lock your study for modifications:

+ +

 

+ +

In the dialog box shown + on the picture above click on the Locked + field and choose Yes item. +

+ +

 

+ +

In this case your study + will be locked for any kind of modifications for all users. Next time + you try to edit it, you will see the following warning message:

+ +

 

+ +

+ +

 

+ +

 

+ +

+Related Topics + + +

+ +

 

+ +

 

+ +

 

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/KERNEL/kernel/getting_started2.htm b/doc/salome/gui/KERNEL/kernel/getting_started2.htm new file mode 100755 index 000000000..5df59302b --- /dev/null +++ b/doc/salome/gui/KERNEL/kernel/getting_started2.htm @@ -0,0 +1,134 @@ + + + + + +Getting started2 + + + + + + + + + + + +

Getting started

+ +

Start the SALOME application, the following + initial desktop window will appear:

+ +

 

+ +

+ +

In general, the SALOME application + is destined for performance of different numerical calculations and  visualization + of the resulting data. For that purpose, in the SALOME environment the + following notion is used  - + Study.

+ +

Study represents a working document in + which you can realize all operations connected with the SALOME functionality. +

+ +

SALOME is a multi-study platform. It means + that simultaneously you can work with several studies.      

+ +

 

+ +

To proceed working in SALOME you should create or open a new + study.  

+ +

 

+ +

 

+ +

 

+ +

+Related Topics + + +

+ +

 

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/KERNEL/kernel/introduction.htm b/doc/salome/gui/KERNEL/kernel/introduction.htm new file mode 100755 index 000000000..298c32659 --- /dev/null +++ b/doc/salome/gui/KERNEL/kernel/introduction.htm @@ -0,0 +1,140 @@ + + + + + +Introduction + + + + + + + + + + + +

+ +

Introduction

+ +

Welcome to SALOME software application! + Modern technological products (cars, structures, electrical or electronic + equipment) are getting with every year more and more complex and must + meet increasingly severe requirements in terms of quality and performance. + For example, for structures and their environment the demands to reduce + risks and optimize costs are extremely high. It requires particularly + refined simulations concerning structural behavior and robustness to ensure + high reliability.

+ +

The + numeric modeling of a physical problem, the development of solutions and + their integration into the design process are often handled in very specific + environments. SALOME represents a generic CAD-based application for digital + simulation with "high reactivity to market evolutions and customer + expectations".

+ +

 

+ +

SALOME:

+ + + + + + diff --git a/doc/salome/gui/KERNEL/kernel/introduction_to_iapp.htm b/doc/salome/gui/KERNEL/kernel/introduction_to_iapp.htm new file mode 100755 index 000000000..e90908b55 --- /dev/null +++ b/doc/salome/gui/KERNEL/kernel/introduction_to_iapp.htm @@ -0,0 +1,185 @@ + + + + + +Introduction to IAPP + + + + + + + + + + + + +

Introduction to IAPP

+ +

IAPP + (Interface Applicative (fr.) = Application Interface (eng.)) component +  represents + a common shell for all components, which can be integrated into the SALOME + platform.

+ +

 

+ +

IAPP + component in SALOME platform provides:

+ +

 

+ + + +

- + VTK viewer,

+ +

- + OCC viewer,

+ +

- + Plot2d viewer,

+ +

- + Supervision viewer.

+ +

 

+ +

 

+ +

 

+ + +Related Topics + + + + +
  + + +
  + + +
  + + +

 

+ + + + diff --git a/doc/salome/gui/KERNEL/kernel/introduction_to_salome_pro.htm b/doc/salome/gui/KERNEL/kernel/introduction_to_salome_pro.htm new file mode 100755 index 000000000..a61cbdb8d --- /dev/null +++ b/doc/salome/gui/KERNEL/kernel/introduction_to_salome_pro.htm @@ -0,0 +1,203 @@ + + + + + +Introduction to SALOME + + + + + + + + + + + + +

Introduction to SALOME +

+ +

 SALOME + platform represents a generic open source platform for pre- and post-processing + in numeric simulations. This platform is made of reusable open-source + components, enabling to build your + own specific software or applications and integrate them.

+ +

 

+ +

+ +

 

+ +

 SALOME + combines several software components, which are built in such a way that + it allows to integrate solvers and existing meshing algorithms along with + the specification of physical properties for a given domain. The originality + of this approach is that the various components must cooperate dynamically + and be configurable.

+ +

 

+ +

SALOME platform + encapsulates the following modules:

+ +

 

+ +

+ +

 

+ +

Every + component of SALOME platform has its own function:

+ +

 

+ + + +

 

+ + + +

 

+ + + +

 

+ + + +

 

+ + + +

 

+ +

 

+ +

 

+ +

+Related Topics + + +

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/KERNEL/kernel/navigating_topics.htm b/doc/salome/gui/KERNEL/kernel/navigating_topics.htm new file mode 100755 index 000000000..624ebb82f --- /dev/null +++ b/doc/salome/gui/KERNEL/kernel/navigating_topics.htm @@ -0,0 +1,167 @@ + + + + + +Navigating topics + + + + + + + + + + + +

Navigating topics

+ +

Topics in the SALOME + Help system include + a variety of navigation components including:

+ +

 

+ + + +

 

+ + + +

 

+ + + +

 

+ + + +

 

+ + + +

      

+ +

+Related Topics + + +

+ + + + diff --git a/doc/salome/gui/KERNEL/kernel/opening_studies.htm b/doc/salome/gui/KERNEL/kernel/opening_studies.htm new file mode 100755 index 000000000..0171322d5 --- /dev/null +++ b/doc/salome/gui/KERNEL/kernel/opening_studies.htm @@ -0,0 +1,192 @@ + + + + + +Opening studies + + + + + + + + + + + + +

Opening studies

+ +

In SALOME all studies are stored in a special + format *.hdf.

+ +

 

+ +

To open an existing + study:

+ +

 

+ +

In + the main toolbar click or + from the main menu select File + > Open option. + From a standard Search File dialog box choose the required *.hdf file + and click Open + button.

+ +

 

+ +

To + load an unloaded study (see also): +

+ +

 

+ +

From the main menu select + File > Load option. In the + following dialog box select one of the studies, which has been previously + created and unloaded and click Ok + button:

+ +

 

+ +

+ +

 

+ +

After opening an existing study, you will see its structure + in the Object Browser. It will + contain the objects created with the help of different components during + the previous study session. If you right-click on one of the objects and + from the associated pop-up menu choose Open + With option, which will automatically + launch the component corresponding to this object.

+ +

 

+ +

 

+ +

 

+ +

 

+ +

+Related Topics + + +

+ +

 

+ +

 

+ +

 

+ +

 

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/KERNEL/kernel/readme.html b/doc/salome/gui/KERNEL/kernel/readme.html new file mode 100755 index 000000000..e16bc0408 --- /dev/null +++ b/doc/salome/gui/KERNEL/kernel/readme.html @@ -0,0 +1,1252 @@ + + + + + +Installation Wizard + + + + + + + + + + + +

Installing SALOME

+ + +
+ + + + + +
+ + +

Installing products with the Installation Wizard

+ +

You can run the Installation Wizard in two modes. It's root directory + contains python script runInstall.py:

+ +

[ python ] runInstall [ -g | b ] [ -f + <xml-file> ] [ -t <target-dir> ] [ -tmp <tmp-dir> ] +

+ +

 

+ + + +++ + + + + + + + + + + + + + + + + + + + + + + + + +
+

-g

+

Runs the Installation Wizard in the GUI mode. In this case only <xml-file> + key is taken into account. This option is used by default.

+

-b

+

Runs the Installation Wizard in the batch mode.

+

-f <xml-file>

+

The configuration file to be used by the Installation Wizard.  + If this parameter is missed then the script tries to define the Red + Hat version and uses corresponding xml file. For example, for the + Red Hat 8.0 config_RedHat8_0.xml  file is supposed + to be used by default. If the appropriate file is not found, config.xml + is used by default.

+

 -t <target-dir>

+

The target directory, SALOME products to be installed to. If used, overloads + target directory, given in the configuration xml file.

+

-tmp <tmp-dir>

+

The directory, which is used to contain temporary files.  If used, + overloads temporary directory, given in the configuration xml file.

+

-h

+

Prints this help information.

+ +

   +      

+ +

So, to run the Installation Wizard in the GUI mode, just type runInstall. +

+ +

 

+ +

The installation procedure can support some different Linux platforms + (currently it provides only configuration scripts for RedHat-8.0) + and various number of products. The using of configuration xml files gives + flexible way to modify the list of products to be installed by the Installation + Wizard without changing program's source code. Just create your own configuration + file and implement installation scripts for products you want to be provided + by Wizard. See modifying XML configuration file + and implementing installation scripts for the + new products for more information.

+ +

The Installation Wizard was built with using + of the Qt  library. The program contains several pages. + To navigate between pages use "Next" and "Back" + buttons in the lower part of the wizard window. "Cancel" + button closes dialog window and quits the installation procedure. To invoke + this help information click "Help" button.

+ +

Skip the first "Introduction" page by pressing "Next" + button.

+ +

In the second page you are proposed to enter the target directory where + all selected products will be installed to. You can also press "Browse..." + button and choose the folder for installation using standard Qt + browse directory dialog box.
+If the directory you want to install products does not exist you will be + prompted to confirm directory creation. If you type wrong directory path, + or if you have no permission for the directory you use, the corresponding + message box will raise.

+ +

The Installation Wizard has two modes of the installation: basic and + advanced. In the basic mode it is necessary just to enter target directory. + If you want to use advanced mode, click "More..." button. +

+ +

In the advanced mode you have the possibility to select products to + be installed (see Fig.1 ). Each product has + several options of installation: you have a possibility to use native + products, install already precompiled binaries, build product from the + sources or not installed at all. Possible options and default choice are + provided by the configuration file. You can mark the products, you want + to install, by clicking the corresponding radiobuttons in the list view + in the left part of the page. Note that some products can be installed + only together with other products (or these prerequisite products should + be already installed on your computer). The installation procedure has + a special feature to automatically mark these products in the list view. + For example, in order to install pyqt it's necessary to + have gcc, python, qt and sip + installed. Therefore all these products will be marked when you check + on pyqt. This feature can be switched off by clicking "Auto + set prerequisites products" checkbox.
+Special button in the right part of the page - "Unselect All" + - allows to reset quickly all products to the "not install" + state.
+If you want to use native Linux Red Hat 8.0 products (these are gcc, tcl, + Python, Qt, Sip and PyQt), select "use native" option. +

+ +

The box at the right side of the page displays the information about + currently highlighted product: name, version, short description (if provided), + required disk space, temporary files disk space, list of prerequisites + and user choice.

+ + + +

 

+ +

+

+ +

Figure 1: "Installation + settings" page in the advanced mode

+ +

 

+ +

The "Total disk space required:" field displays how + much disk space on the hard drive is required for installation of selected + products.

+ +

 

+ +  + +

Please, take into account + that displayed amount of required disk space is approximate and may differ + when you install products on your hard drive.

+ +

 

+ +

The installation procedure uses a special directory to store temporary + files. The "Space for temporary files:" field shows the + information about required disk space on the hard drive for extracting + and compiling of the selected products. You can change the default directory + - just type path to the folder you want to use or click on the corresponding + "Browse..." button.

+ +

 

+ +

The installation procedure also checks the available disk space on the + selected directories according to the products selected. If there is no + enough disk space on your hard drive you will see the corresponding error + message box.

+ +

 

+ +

Unfortunately, the + configure procedure has a very annoying bug under Linux platform. The + directory should be obligatory entered without spaces. For example, the + configure procedure for gcc won't work if you pass the following + parameter: --prefix="/New Folder 1". Therefore you + are strongly recommended not to use directory names containing spaces. +

+ +

 

+ +

To proceed further click "Next" button. At this moment + program will make some tests to check installation settings: if there + is enough disk space on the hard drive, if native products are preinstalled, + dependencies (prerequisites) for each product you have selected to be  + installed. If any test fails you will see corresponding warning message + box. Otherwise wizard will follow to the next page:

+ +

 

+ +


+

+ +

Figure 2: "Check + your choice" page

+ +

 

+ +

This page summarizes the installation settings you've made on the previous + pages. You can check again your choice to change it if necessary.

+ +  + +

When you are sure that everything is OK, press "Next" + button to follow to the next page.

+ +

 

+ + + +

+ +

Figure 3: "Installation + progress" page

+ +

 

+ +

To start installation of the selected products click "Start" + button. It launches the shell installation script and you will be able + to see the output of the script in the topmost dialog's frame. In case + of any installation problems (for example, you have accidentally removed + the temporary directory) the script will ask you: "Would you like + to continue : (Y,N) ?". You can answer this question by typing + [Y] or [N] in the middle text edit control frame.

+ +

 

+ +  + +

press [Enter] when you finish + typing data.

+ +

 

+ +

The "Installation Status" frame window shows you the + progress of installation. It contains a list of all selected products + with brief descriptions. "Waiting" + description means that installation of this product have not started yet. + Currently installing product is marked as "Processing". + All installed products have "Completed" + description.

+ +

You can abort installation and close the installation procedure using + "Cancel" button. It sends the signal "SIGTERM" + to the shell script. The script has a signal handler and will try to clear + all temporary files. The process of removing temporary files can take + some time, so the installation wizard will wait 3 seconds before closing. +

+ +

 

+ +

At the end of installation (all selected products have been installed + successfully) you can go back to the previous pages to start a new installation + or click "Next" button to go the Readme page:

+ +


+

+ +

Figure 4: "Finish + installation" page

+ +

 

+ +

In this page you can read important information about the Instalation + Wizard itself and some hints: how to run and test SALOME or how to build + SALOME from the sources. This is the contents of the README file which + you can find in the root directory of the Installation Wizard.

+ +  + +

You can also launch SALOME Desktop from this page by clicking "Launch + SALOME" button.

+ +

During the process of installation the script creates some environment + files to simplify procedure of launching SALOME. These shell scripts set + all necessary environment variables for all products you have installed. + To learn how installation scripts collects the environment, see  here. These files are: salome.csh + salome.sh + in the KERNEL + module sources and KERNEL module binaries + root directories and env_products.csh + env_products.sh in + the target directory.

+ + +
+ + +

Notes on check products + version procedure

+ +

Unfortunately under Linux platform there is no exact algorithm to identify + the product's version. The table below contains the information relating + to checking preinstalled products for the Linux.RedHat 8.0 platform

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Product

+

Algorithm of checking

+

Preliminary steps before launching
+of installation procedure

+

Notes

+

gcc 3.2

+

ver=`/usr/bin/gcc --version | grep 'gcc (GCC) .*' | cut -b 11-13`

+

-

+

ver should be equal 3.2
+It is recommended to use native gcc on Linux RedHat 8.0

+

tcl 8.3

+

existence of TCLHOME
+existence of tclsh8.3
+existence of wish8.3
+existence of libtcl8.3.so
+existence of libtk8.3.so
+existence of libtclx8.3.so
+existence of libtkx8.3.so

+

set TCLHOME if you have preinstalled version of tcl.
+set LD_LIBRARY_PATH on a directory where libs can be found.

+

It is recommended to use native tcl on Linux RedHat 8.0

+

boost 1.30.2

+

ver=`egrep 'BOOST_VERSION [0-9]+' ${BOOSTDIR}/boost/version.hpp | sed + 's/.*BOOST_VERSION \([0-9]\+\)/\1/g'`

+

set BOOSTDIR if you have preinstalled version of boost

+

It is impossible to use native BOOST and to install BOOST from binaries.

+

Cascade 5.1.2

+

existence of CASROOT environment variable

+

set CASROOT if you have preinstalled version of CASCADE

+

Unfortunately we can't say anything exactly about CASCADE 5.1.2 and + we only check CASROOT environment variable. If you have problem with preinstalled + version of CASCADE reinstall it

+

Python 2.2.1

+

existence of PYTHONHOME
+isPython=`which python`
+ver=`python -V`

+

set PYTHONHOME to root Python folder
+set PATH on a directory where python can be found

+

Python should exist and ver should be equal to 2.2.1
+It is recommended to use native Python on Linux RedHat 8.0

+

Mesa 3.4.2

+

existence of libGL.so.1.2.030402

+

set LD_LIBRARY_PATH on a directory where libGL.so.1.2.030402 can be + found

+

You have a possibility to build products (vtk & qt) with Mesa drivers + from the package supplied with this installation procedure or to use OpenGL + drivers installed on your computer locally. This check procedure concerns + only supplied Mesa driver.

+

Swig 1.3.17

+

isSwig=`which swig`
+ver=`swig -version`
+ver=`echo $ver | awk '{print $3}'`

+

set PATH on a directory where swig can be found

+

Swig should exist and ver should be equal to 1.3.17

+

Qt 3.0.5

+

existence of QTDIR
+existence of libqt-mt.so.3.0.5

+

set QTDIR if you have preinstalled version of qt

+

We try to find libqt-mt.so.3.0.5 in ${QTDIR}/lib folder.
+You should set MESA_HOME only if you have preinstalled version of Mesa + 3.4.2.
+It is recommended to use native Qt on Linux RedHat 8.0

+

Qwt 0.4.1

+

existence of QWTHOME
+existence of libqwt.so.0.4.1

+

set  QWTHOME if you have preinstalled version of qwt

+

We try to find libqwt.so.0.4.1 in the ${QWTHOME}/lib folder. 

+

Hdf 5-1.4.4

+

existence of HDF5HOME
+existence of libhdf5.so.0.0.0
+existence of libhdf5.settings

+

set HDF5HOME if you have preinstalled version of hdf

+

We try to find libhdf5.so.0.0.0 and libhdf5.settings in ${HDF5HOME}/lib + folder.
+File libhdf5.settings should contain the following entry:
+HDF5 Version: 1.4.4

+

Med 2.1.6

+

existence of MED2HOME
+existence of libmed.so.0.0.0

+

set MED2HOME if you have preinstalled version of med

+

Unfortunately we can't check version number.
+We try to find libmed.so.0.0.0 in ${MED2HOME}/lib folder.
+If you have problem with preinstalled version of med reinstall it.

+

Vtk 4.2

+

existence of VTKHOME
+existence of libvtkCommon.so

+

set VTKHOME if you have preinstalled version of vtk

+

Unfortunately we can't check the version number.
+We try to find libvtkCommon.so in ${VTKHOME}/lib/vtk folder.
+If you have problem with preinstalled version of vtk reinstall it.

+

Netgen 4.3

+

existence of NETGENROOT

+

set NETGENROOT if you have preinstalled version of Netgen.

+

Unfortunarely we can't find anything about netgen version.
+We just check if NETGENROOT environment varible is set.

+

OmniORB 3.0.5,
+OmniORBpy 1.5,
+OmniNotify 1.2

+

existence of OMNIORBDIR
+existence of libomniORB3.so.0.5
+existence of _omnipymodule.so.0.5
+existence of libCOSNotify3.so.0.5
+existence of notifd
+existence of THIS_IS_omniORB_3_0_5
+existence of THIS_IS_omniNotify_1_2
+existence of THIS_IS_OMNIORBPY_1_5

+

set OMNIORBDIR if you have preinstalled version of omni

+

We try to find libomniORB3.so.0.5, _omnipymodule.so.0.5 and libCOSNotify3.so.0.5 + in ${OMNIORBDIR}/lib/i586_linux_2.0_glibc2.1 folder.
+We try to find notifd in ${OMNIORBDIR}/bin/i586_linux_2.0_glibc2.1 folder. +
+Additional checking - omni add special files THIS_IS_...
+We try to find THIS_IS_omniORB_3_0_5 in ${OMNIORBDIR} folder.
+We try to find THIS_IS_omniNotify_1_2 in ${OMNIORBDIR}/src/services/omniNotify. +
+We try to find THIS_IS_OMNIORBPY_1_5 in ${OMNIORBDIR}/src/lib/omniORBpy + folder.

+

Numeric 22.0

+

existence of Numeric folder
+existence of _numpy.so

+

set PYTHONHOME if you have preinstalled version of python

+

Unfortunately we can't check the version number.
+We try to find Numeric folder in ${PYTHONHOME}/lib/python2.2/site-packages/Numeric + folder.
+If you have problem with preinstalled version of numeric 22.0 reinstall + it.

+

Sip 3.3.2

+

existence of SIPDIR
+existence of sip
+existence of libsip.so.9.1.0

+

set SIPDIR to directory where you have sip preinstalled

+

We try to find sip and libsip.so.9.1.0 in $SIPDIR folder if you set + SIPDIR , otherwise searching is done using $PATH and $LD_LIBRARY_PATH + accordingly.
+It is recommended to use native Sip on Linux RedHat 8.0

+

PyQt 3.3.2

+

existence of PYQTDIR
+existence of libqtxmlcmodule.so.1.0.0

+

set PYQTDIR to directory where you have sip preinstalled

+

Unfortunately we can't check the version number.
+We try to find libqtxmlcmodule.so.1.0.0 in $PYQTDIR folder if you set PYQTDIR, + otherwise searching is done using $LD_LIBRARY_PATH .
+If you have problem with preinstalled version of PyQt 3.3.2 reinstall it. +
+It is recommended to use native PyQt on Linux RedHat 8.0

+

HappyDoc 2.1

+

existence of happydoc
+ver=`happydoc | grep "HappyDoc version 2.1"`

+

set PYTHONHOME if you have preinstalled version of python

+

We try to find happydoc in $PYTHONHOME/bin folder.
+ver should not be empty.
+This product is not obligatory. It was added only for your comfort.

+

Doxygen 1.3-rc2

+

existence of doxygen
+existence of doxysearch
+existence of doxytag
+existence of doxywizard

+

set QTDIR if you have preinstalled version of qt
+set PATH on a directory where doxygen, doxysearch, doxytag and doxywizard + can be found

+

Unfortunately we can't check the version number.
+It's necessary to have compiled Qt in order to build doxywizard.
+If you have problem with preinstalled version of doxygen 1.3-rc2 reinstall + it.
+This product is not obligatory. It was added only for your comfort.

+

Graphviz 1.9

+

existence of dot

+

add GraphViz's bin directory to the PATH environment variable

+

Unfortunately we can't check the version number.
+We try to find dot program in the $PATH

+

MODULE binaries
+(MODULE=KERNEL,

+

GEOM, ...)

+

existence of MODULE_ROOT_DIR
+existence of VERSION file
+ver=`cat $MODULE_ROOT_DIR/bin/salome/VERSION | awk -F: '{print $2}' | tr + -d '[:space:]'`

+

set MODULE_ROOT_DIR if you have preinstalled binaries of MODULE version + 1.4.x

+

MODULE binaries should exist and ver should be equal to 1.4.x

+

MODULE sources
+(MODULE=KERNEL,

+

GEOM, ...)

+

existence of MODULE_SRC_DIR
+existence of VERSION file
+ver=`cat $MODULE_SRC/bin/VERSION | awk -F: '{print $2}' | tr -d '[:space:]'`

+

set MODULE_SRC_DIR if you have preinstalled sources of MODULE version + 1.4.x

+

MODULE sources should exist and ver should be equal to 1.4.x

+ +

 

+ +

For native products installation + procedure sets proper environment variables itself, and you do not need + to set such variables like, e.g. TCLHOME or PYTHONHOME. +
+If you have native products installed to different from default directories + (not /usr/bin, /usr/lib...), it is recommended to follow + above description. Or you should set properly $PATH and $LD_LIBRARY_PATH + variables before starting Installation + Wizard. Otherwise installation script will fail to find preinstalled products. +

+ + +
+ + +

Pick up the environment

+ +

Please, read carefully the following information. This section describes + how the installation procedure collects environment.

+ +

After installing each product shell script creates in the product root + folder special environment file. The name of the file is generated from + the name of product by the following scheme: env_<product_name>.sh. + This file includes all necessary product settings. For example for Vtk + the file is env_Vtk.sh. Environment files allows to pick up all + environment settings which are necessary to build and launch SALOME. When + installing SALOME sources and/or binaries, installation procedure picks + up all the settings files and generate two scripts: salome.sh and + salome.csh for sh and csh correspondingly. Such approach helps + to save time when reinstalling products and you may not to care about + setting all environment variables manually to build/launch SALOME. What + you need is just to use one of these scripts.

+ +

This concerns also those products which are not currently installed. + For example, you install some SALOME binaries to the directory where you + have previously installed other products.  Installation procedure + still tries to collect environment files from the target directory if + it find necessary products there. If some product is not found in the + target directory the corresponding section of salome.sh/salome.csh + files will be skipped.
+For native products (gcc, tcl, python, qt, sip, pyqt for RedHat-8.0) + instal script tries to find them using $PATH / $LD_LIBRARY_PATH + variables and then in the system default directories (/usr/bin, /usr/lib + etc., depending on the product).

+ +

In any case you may edit salome.* files after installation procedure + finishes, as you want.

+ + +
+ + +

Modifying XML configuration + file

+ +

You can create your own configuration. Installation Wizard then can + take it as command line argument to provide list of products you want + to install with it. The list of products and some another settings for + the Installation Wizard are provided in xml file. The default file which + Installation Wizard looks for if no command line arguments ar given, is + config.xml. This section describes the format of configuration + file.
+Xml tags are in bold blue, optional sections/tags are in brackets.

+ +

 

+ +

<document> +
+   
[
<config [version=<install_wizard_version>]
+                  + [caption=<install_wizard_caption>]

+                  + [copyright=<install_wizard_copyright>]

+                  + [license=<install_wizard_license_info>]

+                  + [os=<target_paltform>]
/>]
+   
[
<path [targetdir=<target_directory>]
+                + [tempdir=<temp_directory>]
/>]
+    [
<product name=<product_name>
+                      + version=<product_version>

+                +       [description=<product_description>]
+                      + install=<installation_mode>

+                      + supported=<supported_installation_modes>

+                      + disable=<disable_flag>
+                      + [pickupenv=<pickup_env_flag>]

+                      + dependancies=<list_of_prerequisites>
 
+                     +  installdiskspace=<install_disk_space>

+                     +  temporarydiskspace=<tmp_disk_space>

+                     +  script=<installation_script_name>
/>]
+    [
<product ... />]
+    .
.. +
+</document>

+ +

<config> section

+ +

This is optional section - contains general information + Installation Wizard itself.

+ + + +

 

+ +

<path> section

+ +

 

+ +

This is optional section - contains default directories.

+ +

 

+ + + +

 

+ +

<product> section

+ +

 

+ +

This section describes product to be installed with the Installation + Wizard. All tags are obligatory. Products appears in the products tree + and are installed in the order they are described in the configuration + file. It is recommended to insert native products at the top of the list + before all other products.

+ + 
+ + + +  + +

If you add new products + to be installed with Installation Wizard, you should also provide installation + script for this product. See next section for more details.

+ + +
+ + +

Implementing installation + scripts for the new products

+ +

When you want some product to be installed with the Installation Wizard, + you should add it's description it in the configuration + file and create bash installation script, following described in this + section rules.
+There are some obligatory functions to be provided in this installation + script. These functions are automatically called by master installation + script or/and GUI shell when it is necessary.
+File common.sh contains some service functions which can be used + in your installation script, like make_env(), make_dir(), + try_existing(), sort_path(), find_in_path(), etc. +

+ + 
+ + + +  + +

The calling signature of the product installation + script is following:
+<product_script_name> <function_name> <temp_folder> <products_directory> + <target_directory> <dependancies> <product_name>
+

+ +

where
+<product_script_name>
- installation script name (described in + configuration xml file);

+<function_name>
- the name of function, corresponding to the + selected installation mode: try_native, install_source, install_binary + or try_preinstalled;

+<temp_folder>
- temporary files directory;

+<products_directory>
- directory where the sources/binaries package + can be found. You should provide sources package in the <Install_Wizard_root_directory>/Products/SOURCES + directory and binaries package  in the <InstallWizard_root_directory>/Products/BINARIES/<os_version>, + where <os_version> is target platform description, which appears + in the corresponding section of the configuration + xml file.

+<target_directory>
- root target directory where product should + be installed to;

+<dependancies>
- single-quoted list of prerequisite products, + separated by space;

+<product_name>
- product name itself.

+ +

 

+ +

med-2.1.6.sh install_binary /tmp/work ./Products/BINARIES/RedHat8.0 + /usr/salome 'gcc Hdf' med

+ +

Copy created script into the <Install_Wizard_root_directory>/config_files + sub-directory where all installation scripts are stored. Installation + Wizard will automatically search and call your script during the installation + procedure.

+ + +
+ + +  + +
  + + + + + diff --git a/doc/salome/gui/KERNEL/kernel/running_salome_pro.htm b/doc/salome/gui/KERNEL/kernel/running_salome_pro.htm new file mode 100755 index 000000000..8992914d6 --- /dev/null +++ b/doc/salome/gui/KERNEL/kernel/running_salome_pro.htm @@ -0,0 +1,295 @@ + + + + + +Running SALOME + + + + + + + + + + + + +

Running SALOME

+ +

To launch SALOME:

+ +

 

+ +

1. Install the SALOME package into a definite + directory (ex. SALOME) on your + hard disk. It is preferable if you use the special + installation procedure allowing to install the  SALOME + platform and all corresponding applications.

+ +

 

+ +

2. + The installation shell script will create a special file: env.csh + (CShell file) in your SALOME directory. + This file contains all environment variables necessary for launching SALOME + platform with other application products provided with SALOME installation + package. You have a possibility to add one of them into your profile if + you enter in the command console the following:

+ +

 

+ +

source + env.csh

+ +

 

+ +

During + the installation procedure you have a possibility to + set your profile automatically.  

+ +

 

+ +

 

+ +

3. Launch SALOME platform, using the following + Python script located in the SALOME/KERNEL/bin/salome + directory:

+ +

 

+ + + +

 

+ + + +++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Options

+

Description

+

--help or + -h   

+

print this help

+

 

+

--gui or + -g   

+

launch with GUI

+

 --terminal or + -t      

+

launch without GUI in batch mode

+

--logger or + -l   

+

redirection of log messages into a definite file

+

--xterm or + -x

+

the servers open an xterm window and log messages are displayed in this + window

+

--modules=module1,module2,... + or -m=module1,module2,...

+

list of SALOME modules which will be loaded into the module catalogue

+

--containers=cpp,python,superv

+

or -c=cpp,python,superv

+

launch of cpp, python and supervision containers

+

--portkill or + -p

+

kill SALOME launched with the current port

+

--killall or + -k    

+

kill SALOME

+ +

 

+ +

+ If the runSalome.py + script + is launched without prompting any options, they will be taken by default + from the xml file salome.launch, + which has been automatically created in your home directory: HOME/.salome/. + If you are constantly launching SALOME with some specific options which + are different from default ones, you can edit this file according to your + requirements. So the next time you run SALOME, you won't have to enter + these numerous command console options.    

+ +

 

+ +

 

+ +

+Related Topics + + +

+ +

 

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/KERNEL/kernel/salome_pro_desktop.htm b/doc/salome/gui/KERNEL/kernel/salome_pro_desktop.htm new file mode 100755 index 000000000..deb9ef61f --- /dev/null +++ b/doc/salome/gui/KERNEL/kernel/salome_pro_desktop.htm @@ -0,0 +1,262 @@ + + + + + +SALOME desktop + + + + + + + + + + + +

SALOME Desktop

+ +

The main SALOME Desktop + consists of the following sections and toolbars:

+ +

 

+ +

+ +

Basic parts of the SALOME Desktop:

+ +

 

+ +

Main + menu - It's a set of context-sensitive menus, which will be updated + according the functionality of the loaded component. In general,  these + menus contain all functional options of SALOME platform.

+ +

Standard + Toolbar - This toolbar contains icons allowing creating/saving + studies, correcting mistakes, copying/pasting objects

+ +

Components + Toolbar - This toolbar is destined for uploading components in + SALOME platform

+ +

Viewer + Toolbar - It's a set of tools destined for visualization of the + presentations in the viewer.

+ +

 

+ +

These tools are context-sensitive. For different viewers combination + of these tools is different.

+ +

 

+ +
+ + ++++++ + + + + + + + + + + + + + + + + + + + + + +
+

+

Camera dump

+

Saves images from the viewer in *.bmp, *.png, *.jpg, *.jpeg + files  

+

+

Shows/Hides Trihedron

+

+

Fits all displayed objects to the size of the window  

+

+

Fits within rectangle.

+

 Displays + in the whole window of the viewer outlined area of the presentation

+

 

+

+

Zooming of presentations

+

 

+

+

Panning of presentations in the window

+

+

Rotation of presentations in 3d space

+

+

Global panning

+

+

Front view of presentations

+

+

Back view of presentations

+

+

Top view of presentations

+

+

Bottom view of presentations

+

+

Left view of presentations

+

+

Right view of presentations

+

+

Resets to initial position

+
+

 

+ +

Parts of  the + study window:

+ +

 

+ +

Object Browser / UseCase Browser - Management + of objects created or imported into SALOME application

+ +

Viewer + - This window is destined for visualization of presentations. In + SALOME the following viewers are integrated: VTK, OCC, Plot2d. +

+ +

Python + console - Window for Python interpreter. This window functions + like a standard document: the pop-up menu invoked by right-click in this + window gives access to Copy/Paste/SelectAll/ClearAll + options.

+ +

Output + messages - This window displays all output messages produced by + SALOME during performance of operations. This window functions like a + standard document: the pop-up menu invoked by right-click in this window + gives access to Copy/SelectAll options.

+ +

 

+ +

For your convenience, the whole study window as well as all + its parts can be resized / minimized + / maximized.

+ +

 

+ +

 

+ +

 

+ +

+Related Topics + + +

+ +

 

+ +

 

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/KERNEL/kernel/saving_a_study.htm b/doc/salome/gui/KERNEL/kernel/saving_a_study.htm new file mode 100755 index 000000000..b12edd635 --- /dev/null +++ b/doc/salome/gui/KERNEL/kernel/saving_a_study.htm @@ -0,0 +1,252 @@ + + + + + +Saving a study + + + + + + + + + + + + +

Saving and closing studies

+ +

In SALOME + a study can be saved in HDF + (by default) or ASCII files (see also: Setting ASCII save option).

+ +

 

+ +

You can also specify  two + options of saving your study:

+ +

 

+ + + +

 

+ +

To save an existing + study :

+ +

 

+ +

In + the main toolbar click or + from the main menu select File + > Save as option. + Your study will be automatically updated.

+ +

 

+ +

If your study hasn't been + previously saved, this option will call the standard Search File dialog + box where you can enter the name for your study and save it.

+ +

 

+ +

To save a study with + a new name:

+ +

 

+ +

From the main menu select + File > Save as option. In the + standard Search File dialog box enter a new name for your study and click + Save button.

+ +

 

+ +

To close a study:

+ +

 

+ +

From + the main menu select File > + Close option + or click on the cross in the upper right corner of the study window.

+ +

 

+ +

If your study hasn't been + previously saved, this option will call the following dialog box with + several options:

+ +

 

+ +

+ +

 

+ +

Unload + option allows to unload your current study from the SALOME Desktop. + In the same working session you can  reload + it again (see: Opening studies). But + if you quit the SALOME application, all changes in the unloaded study + will be LOST.

+ +

 

+ +

To close a definite + study window:

+ +

 

+ +

Click on the small cross + button in the right upper corner of the study window. If it is the last + study window this operation will result in closing of the whole study.

+ +

 

+ +

 

+ +

 

+ +

+Related Topics + + +

+ +

 

+ +

 

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/KERNEL/kernel/setting_preferences.htm b/doc/salome/gui/KERNEL/kernel/setting_preferences.htm new file mode 100755 index 000000000..c8de5bbb2 --- /dev/null +++ b/doc/salome/gui/KERNEL/kernel/setting_preferences.htm @@ -0,0 +1,243 @@ + + + + + +Setting preferences + + + + + + + + + + + + +

Setting preferences

+ +

In SALOME + you can set the preferences, which will be valid for the whole + study session.

+ +

 

+ +

In the main menu select + Preferences, the following submenu + will appear:

+ +

 

+ +

              

+ +

 

+ + + +

 

+ +

+ +

 

+ +

- + Displays/hides Entry, IOR columns

+ +

- Displays/hides + Value column

+ +

- Displays/hides Interface + Applicative (folder containing all study windows created within + the current study session),

+ +

- + Chronological sort of objects displayed + in the Object Browser.

+ +

- Show UseCase Browser - displays/hides + UseCase Browser

+ +

- + No autosize columns -  This + item allows to disable/enable auto resizing of columns of the Object Browser +     

+ +

 

+ + + +

The + preferences, set during the current study session, are automatically saved + at the end of the session. So, next time you launch SALOME application, + these preferences will be restored.

+ +

 

+ +

Depending on the currently loaded component, the Preferences + menu may contain a submenu with the name of this component allowing + to set its own preferences.

+ +

 

+ +

 

+ +

+Related Topics + + +

+ +

 

+ +

 

+ +

 

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/KERNEL/kernel/using_catalog_generator.htm b/doc/salome/gui/KERNEL/kernel/using_catalog_generator.htm new file mode 100755 index 000000000..b254694b7 --- /dev/null +++ b/doc/salome/gui/KERNEL/kernel/using_catalog_generator.htm @@ -0,0 +1,223 @@ + + + + + +Using Catalog Generator + + + + + + + + + + + + +

Using Catalog Generator + (for advanced users)

+ +

SALOME + platform is an open platform for integration of your custom components, + which can used in the same way as typical modules provided in the standard + installed package. The Catalog Generator + tool serves for implementation of the interface of your custom + component. It allows to generate from IDL description of your component + interface its xml description.  The + component xml description allows SALOME application to know about the + component and its services and provides the possibility to call the component + services, for example, inside SUPERVISION module.

+ +

If you have a look at runSalome, runSalomeWithPort + scripts running SALOME application, which are stored in build/bin directory + you will see that SALOME_ModuleCatalog_Server is started with two xml + files as its input parameters: CatalogModuleGeneral.xml + and CatalogModulePersonnel.xml. + These two files store the descriptions of interfaces and services of all + components, provided with typical SALOME package. To add a new component + into SALOME platform you should either update one of these existing xml + files with generated xml description of your component or create a new + one.

+ +

 

+ +

To open the Catalog Generator:

+ +

 

+ +

From the main menu choose Tools + > Catalog Generator, the following dialog box will appear:

+ +

 

+ +

+ +

 

+ +

 

+ +

In + this dialog box you can specify:

+ +

 

+ + + +

 

+ +

If you have chosen to create a new xml file containing the + description of your component, don't forget to specify it as input parameter + for SALOME_ModuleCatalog_Server in the file, you are using as a running + script of SALOME platform (in runSalomeWithPort, for example).

+ +

 

+ +

 When + launching SALOME next time you will see your module alongside other components.

+ +

 

+ +

You can use the Catalog + Generator tool, if you would like to test + the functionality of your new component. After implementation of your + component interface, launch SUPERVISION module where you can try using + the services of your new component. (see also: Adding factory nodes)

+ +

 

+ +

 

+ +

 

+ +

+Related Topics + + +

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/KERNEL/kernel/using_left-hand_tabs.htm b/doc/salome/gui/KERNEL/kernel/using_left-hand_tabs.htm new file mode 100755 index 000000000..8c1b49913 --- /dev/null +++ b/doc/salome/gui/KERNEL/kernel/using_left-hand_tabs.htm @@ -0,0 +1,161 @@ + + + + + +Using left-hand tabs + + + + + + + + + + + +

Using left-hand tabs

+ +

SALOME Help system includes + the following left-hand tabs:

+ +

 

+ + + +

 

+ + + +

 

+ + + +

 

+ + + +

     

+ +

+Related Topics + + +

+ +

 

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/KERNEL/kernel/using_object_browser.htm b/doc/salome/gui/KERNEL/kernel/using_object_browser.htm new file mode 100755 index 000000000..a0cd06481 --- /dev/null +++ b/doc/salome/gui/KERNEL/kernel/using_object_browser.htm @@ -0,0 +1,219 @@ + + + + + +Using Object Browser + + + + + + + + + + + + +

Using Object Browser

+ +

The Object + Browser in SALOME is destined for displaying the structure of the + current study in a tree-like form. It contains:

+ +

 

+ + + +

 

+ +

The Object Browser is + destined for getting quick access to different objects created during + SALOME session. All pop-up menu associated with the objects displayed + in the Object Browser are context-sensitive. So it depends on a definite + currently loaded SALOME component what options you will see in the pop-up + menu, if you right-click on definite object in the Object Browser.

+ +

 

+ +

The Object Browser may contain supplementary + attributes of the objects displayed in additional columns. By default, + these columns are not displayed - displaying/hiding these columns is possible + through setting study + preferences.

+ +

 

+ + + +

 

+ +

The attributes Entry, IOR, + Reference entry  are + only for debugging purposes in the framework of SALOME application.

+ +

 

+ + + +

 

+ +

                   

+ +

 

+ +

In the Object Browser you can apply to + the objects an ascending or descending sorting + according to one definite attribute.

+ +

 

+ +

To sort the objects by one of the attributes:

+ +

 

+ +

Click on the column + of this attribute. An arrow down shows that the sorting is descending, + an arrow up - ascending.

+ +

 

+ +

 

+ +

 

+ +

 

+ +

+Related Topics + + +

+ +

 

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/KERNEL/kernel/using_registry.htm b/doc/salome/gui/KERNEL/kernel/using_registry.htm new file mode 100755 index 000000000..9e1551fc0 --- /dev/null +++ b/doc/salome/gui/KERNEL/kernel/using_registry.htm @@ -0,0 +1,204 @@ + + + + + +Using Registry tool + + + + + + + + + + + + +

Using Registry tool

+ +

Registry + tool is in the SALOME platform is destined for providing information about + the processes (components), which have ever been launched in the current + study session.  

+ +

 

+ +

 

+ +

To view the Registry:

+ +

 

+ +

From the main menu choose + Tools > Registry, the following + dialog box will appear:

+ +

 

+ +

+ +

 

+ +

Running + tab of this dialog box displays a list of the currently started processes + (components) with supplementary information on each of them divided into + columns:

+ +

 

+ +

- Component: + name of the started component

+ +

- PID: + process identification number

+ +

- User + Name: name of the user launching the component

+ +

- Machine: + name of the machine, on which the process has been started

+ +

- begins: + date and time of the starting of the component

+ +

- hello: + date and time of the last call to the component

+ +

 

+ +

History + tab displays a list of all processes, which have ever been launched within + this study session. It contains the same supplementary information on + each of the processes (components).

+ +

 

+ +

Refresh + button allows to refresh the current list of processes (components).

+ +

 

+ +

Interval + button allows to set an interval for refreshment of the current list of + processes (components).

+ +

 

+ +

Help + displays a help message on this tool

+ +

 

+ +

To display complete information on a definite process (component):

+ +

 

+ +

Double-click on this + process (component). The following window will appear:

+ +

 

+ +

+ +

 

+ +

 

+ +

 

+ +

+Related Topics + + +

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/KERNEL/kernel/using_usecase_browser.htm b/doc/salome/gui/KERNEL/kernel/using_usecase_browser.htm new file mode 100755 index 000000000..569861b3b --- /dev/null +++ b/doc/salome/gui/KERNEL/kernel/using_usecase_browser.htm @@ -0,0 +1,211 @@ + + + + + +Using UseCase Browser + + + + + + + + + + + + +

Using UseCase Browser

+ +

In comparison with the Object + Browser, the UseCase Browser is + destined for displaying  a + user-defined structure of the current study. All objects created during + SALOME session are displayed the Object Browser and copied to the UseCase + Browser. But in the UseCase Browser they are displayed without any structure. + In the UseCase Browser you can create your own structure of the study. +

+ +

 

+ +

To view the UseCase Browser:

+ +

 

+ +

Click on the tab UseCase Browser at the bottom of the + study window:

+ +

 

+ +

+ +

 

+ +

On this picture you can + see that all objects are displayed on one level and under one folder Use cases.

+ +

 

+ +

   Creates + a new object under the current object with a default name New + object. The same operation is possible if you right-click on the + object, which you would like to be current for a new object, and from + the pop-up menu select Use case > + New object.

+ +

These objects can be + renamed: right-click on it and from the pop-up menu select Use + case > Rename.

+ +

 

+ +

   Adds + a selected object to the current object. This operation is also possible + if you drag and drop any object to another object. In this case the second + object will be automatically set as current.

+ +

 

+ +

  Removes + the selected object with all child objects.

+ +

 

+ +

  Clears + all objects from the UseCase Browser.

+ +

 

+ +

  Set + the selected object current (root) for other objects. You can add one + or several objects to the current object.

+ +

 

+ +

On the following picture + you can see a custom tree-like structure of objects created in the UseCase + Browser:

+ +

 

+ +

+ +

 

+ +

The UseCase Browser  is + also destined for getting quick access to different objects in the user-defined + structure of the study. All pop-up menu associated with the objects displayed + in the UseCase Browser are context-sensitive. So it depends on a definite + currently loaded SALOME component what options you will see in the pop-up + menu (besides the options allowing to modify the structure), if you right-click + on definite object in the UseCase Browser.

+ +

 

+ +

 

+ +

 

+ +

+Related Topics + + +

+ +

 

+ +

 

+ +

 

+ +

   

+ + + + diff --git a/doc/salome/gui/KERNEL/kernel_csh.htm b/doc/salome/gui/KERNEL/kernel_csh.htm new file mode 100755 index 000000000..23afeaa1d --- /dev/null +++ b/doc/salome/gui/KERNEL/kernel_csh.htm @@ -0,0 +1,106 @@ + + +KERNEL + + + + + + + + + + + + + \ No newline at end of file diff --git a/doc/salome/gui/KERNEL/kernel_rhc.htm b/doc/salome/gui/KERNEL/kernel_rhc.htm new file mode 100755 index 000000000..65674f4f8 --- /dev/null +++ b/doc/salome/gui/KERNEL/kernel_rhc.htm @@ -0,0 +1,106 @@ + + +KERNEL + + + + + + + + + + + + + \ No newline at end of file diff --git a/doc/salome/gui/KERNEL/robohhre.lng b/doc/salome/gui/KERNEL/robohhre.lng new file mode 100755 index 000000000..297538b0b --- /dev/null +++ b/doc/salome/gui/KERNEL/robohhre.lng @@ -0,0 +1,101 @@ +[GlossaryTab] +TabCaption=&Glossary +TermCaption=&Term +DefinitionCaption=&Definition For: + +[BrowseSequence] +PreCaption=Previous +PreTooltip=Previous Topic +NextCaption=Next +NextTooltip=Next Topic +BlockTooltip=Select Block + +[Common] +Contents=Contents +Index=Index +Search=Search +Glossary=Glossary +Logo/Author=Powered By +Show=Show +Hide=Hide +SyncToc=SyncToc +Prev=<< +Next=>> +Disabled Prev=<< +Disabled Next=>> +Seperate = | + +[WebHelp] +Cancel=Cancel +CantOpenURLorFile=Can't open URL or file +CompletingContents=Completing Contents... +Display=Display +Term=Term: +Definition=Definition: +Done=Done +Find=Find +IndexInputPrompt=Type in the keyword to find: +RelateTopicListPrompt=Click a topic, then click Display. +LoadingData=Loading data, please wait... +LoadingContents=Loading contents, please wait... +LoadingContentsData=Loading, click here to cancel... +LoadingFTS=Reading Search Data... +LoadingIndex=Loading Index... +LoadingTOCItem=Loading Table of Contents: +Searching=Searching... +FtsInputPrompt=Type in the word(s) to search for: +TopicsFound=Topics Found +BrowserLimitedMessage=Your browser does not support frames. We recommend that you update your browser to a version that supports frames. +SuggestViewNoFrameMessage=To view the Help system without frames click on this +SuggestViewNoFrameMsg2=hyperlink. +TopicsNotFound=No Topics Found. +CantSearch=Cannot search for that phrase. +JS_alert_appletNotLoad = Unable to load applet. If you are using an old version of Netscape, the prefs.js file needs to be edited. +JS_alert_colorlimitation=WebHelp has detected that your display is set to 16 colors. For full WebHelp support, please set your display to use 256 or more colors. +Blank_topic_text=This topic was created by WinHelp Project Conversion Wizard, and is the destination of a missing topic or broken hyperlink. +JS_alert_ProjectLoadingFail=Could not load correctly, please click Refresh. +JS_alert_cantLoadProject=Can't load project: +JS_alert_ErrorInLoading=Error in Loading navigation component. Please regenerate WebHelp. +IndexBtnText=Go +FtsBtnText=Go +ToolBarSearchBtnText=Go +InTopicSearchBtnText=Go +SearchLabel=Search +SearchPrompt=- Search - +PreTooltip=Previous Topic +NextTooltip=Next Topic +WebSearch=WebSearch +SyncTocTooltip=Sync TOC +Book=Book +Page=Page +Remote_Page=Remote Page +Show_Navigation_Component=Show Navigation Component +Hide_Navigation_Component=Hide Navigation Component +nls_edit_label=Type in your question: +nls_button_go_hint=Go Search +nls_button_go_text=Go +nls_body_instruction=Enter your question in the text box above, then click GO. +nls_body_empty=Sorry, we were unable to find a good answer for your question. +IndexSelectTopicTitle=Select a Topic +IndexSelectTopicLabel=Select a topic, then click Display +IndexSelectTopicError=Please select a topic. +IndexAlphabetBookmarks=ABCDEFGHIJKLMNOPQRSTUVWXYZ +MergeError1=The merged Help system +MergeError2=is using a different language from the master Help system, which will cause the index and full-text search functionality to be disabled in the merged Help system. +PoweredBy=Powered by +GeneratedBy=Generated by +Author=Author +About=About +Print=Print + +[PrintedDoc] +TableOfContents=Table Of Contents +TitlePage=Title Page +ChapterFileNamePrefix=Chapter_ +TitlePageFileName=Chapter__Title_Page.doc +CrossReferencePrefix=See +GlossaryHeadingStyleName=Glossary Heading +GlossaryTermStyleName=Glossary Term +GlossaryDefinitionStyleName=Glossary Definition +TitlePageTitleStyleName=Title Page Title +TocPageTitleStyleName=Table of Contents Page Title diff --git a/doc/salome/gui/KERNEL/webhelp.cab b/doc/salome/gui/KERNEL/webhelp.cab index 145860899..b942f642f 100755 Binary files a/doc/salome/gui/KERNEL/webhelp.cab and b/doc/salome/gui/KERNEL/webhelp.cab differ diff --git a/doc/salome/gui/KERNEL/webhelp.jar b/doc/salome/gui/KERNEL/webhelp.jar index d985cac1c..53b266636 100755 Binary files a/doc/salome/gui/KERNEL/webhelp.jar and b/doc/salome/gui/KERNEL/webhelp.jar differ diff --git a/doc/salome/gui/KERNEL/whcsh_home.htm b/doc/salome/gui/KERNEL/whcsh_home.htm new file mode 100755 index 000000000..daece5e43 --- /dev/null +++ b/doc/salome/gui/KERNEL/whcsh_home.htm @@ -0,0 +1,600 @@ + + + + + + \ No newline at end of file diff --git a/doc/salome/gui/KERNEL/whcshdata.htm b/doc/salome/gui/KERNEL/whcshdata.htm new file mode 100755 index 000000000..0e0412421 --- /dev/null +++ b/doc/salome/gui/KERNEL/whcshdata.htm @@ -0,0 +1,87 @@ + + +KERNEL + + + + + + + + + + diff --git a/doc/salome/gui/KERNEL/whdata/whftdata.js b/doc/salome/gui/KERNEL/whdata/whftdata.js index 9e3b6abd0..071ae6fc7 100755 --- a/doc/salome/gui/KERNEL/whdata/whftdata.js +++ b/doc/salome/gui/KERNEL/whdata/whftdata.js @@ -1,3 +1,4 @@ +// WebHelp 5.10.001 var gTEA = new Array(); function aTE(sTopicTitle, sTopicURL) { diff --git a/doc/salome/gui/KERNEL/whdata/whftdata0.htm b/doc/salome/gui/KERNEL/whdata/whftdata0.htm index 3156a4403..f48525808 100755 --- a/doc/salome/gui/KERNEL/whdata/whftdata0.htm +++ b/doc/salome/gui/KERNEL/whdata/whftdata0.htm @@ -1,6 +1,8 @@ - + + + @@ -10,32 +12,31 @@ - + diff --git a/doc/salome/gui/KERNEL/whdata/whfts.htm b/doc/salome/gui/KERNEL/whdata/whfts.htm index 8375a4d93..e2b057984 100755 --- a/doc/salome/gui/KERNEL/whdata/whfts.htm +++ b/doc/salome/gui/KERNEL/whdata/whfts.htm @@ -1,6 +1,8 @@ - + + + @@ -8,9 +10,9 @@ +//--> \ No newline at end of file diff --git a/doc/salome/gui/KERNEL/whdata/whfts.js b/doc/salome/gui/KERNEL/whdata/whfts.js index 2041512fe..2b6678690 100755 --- a/doc/salome/gui/KERNEL/whdata/whfts.js +++ b/doc/salome/gui/KERNEL/whdata/whfts.js @@ -1,3 +1,4 @@ +// WebHelp 5.10.001 var gaFileMapping = new Array(); var gaFileTopicMapping = new Array(); diff --git a/doc/salome/gui/KERNEL/whdata/whfwdata.js b/doc/salome/gui/KERNEL/whdata/whfwdata.js index 463bfb00d..e9e8bc6c1 100755 --- a/doc/salome/gui/KERNEL/whdata/whfwdata.js +++ b/doc/salome/gui/KERNEL/whdata/whfwdata.js @@ -1,3 +1,4 @@ +// WebHelp 5.10.001 var gWEA = new Array(); function aWE() { diff --git a/doc/salome/gui/KERNEL/whdata/whfwdata0.htm b/doc/salome/gui/KERNEL/whdata/whfwdata0.htm index 81d8b19cf..d6dc00c36 100755 --- a/doc/salome/gui/KERNEL/whdata/whfwdata0.htm +++ b/doc/salome/gui/KERNEL/whdata/whfwdata0.htm @@ -1,6 +1,8 @@ - + + + @@ -10,1089 +12,1059 @@ - + diff --git a/doc/salome/gui/KERNEL/whdata/whgdata.js b/doc/salome/gui/KERNEL/whdata/whgdata.js index 729327323..77e0107f3 100755 --- a/doc/salome/gui/KERNEL/whdata/whgdata.js +++ b/doc/salome/gui/KERNEL/whdata/whgdata.js @@ -1,3 +1,4 @@ +// WebHelp 5.10.001 var gIEA = new Array(); function aGE(sName, sDef) { diff --git a/doc/salome/gui/KERNEL/whdata/whgdata0.htm b/doc/salome/gui/KERNEL/whdata/whgdata0.htm index 9fbefcb8f..9d256b1a8 100755 --- a/doc/salome/gui/KERNEL/whdata/whgdata0.htm +++ b/doc/salome/gui/KERNEL/whdata/whgdata0.htm @@ -1,6 +1,8 @@ - + + + diff --git a/doc/salome/gui/KERNEL/whdata/whglo.htm b/doc/salome/gui/KERNEL/whdata/whglo.htm index d00c26063..dc5a67786 100755 --- a/doc/salome/gui/KERNEL/whdata/whglo.htm +++ b/doc/salome/gui/KERNEL/whdata/whglo.htm @@ -1,6 +1,8 @@ - + + + diff --git a/doc/salome/gui/KERNEL/whdata/whglo.js b/doc/salome/gui/KERNEL/whdata/whglo.js index ded3d5791..e0519afcb 100755 --- a/doc/salome/gui/KERNEL/whdata/whglo.js +++ b/doc/salome/gui/KERNEL/whdata/whglo.js @@ -1,3 +1,4 @@ +// WebHelp 5.10.001 var gaFileMapping = new Array(); function fileMapping(sBK, sEK, sFileName, nNum) { diff --git a/doc/salome/gui/KERNEL/whdata/whidata.js b/doc/salome/gui/KERNEL/whdata/whidata.js index c8c2a05fd..9f0eb15ed 100755 --- a/doc/salome/gui/KERNEL/whdata/whidata.js +++ b/doc/salome/gui/KERNEL/whdata/whidata.js @@ -1,3 +1,4 @@ +// WebHelp 5.10.001 // const strings var gIEA = new Array(); function aIE() diff --git a/doc/salome/gui/KERNEL/whdata/whidx.htm b/doc/salome/gui/KERNEL/whdata/whidx.htm index c0aa1758e..0a0deedd0 100755 --- a/doc/salome/gui/KERNEL/whdata/whidx.htm +++ b/doc/salome/gui/KERNEL/whdata/whidx.htm @@ -1,13 +1,15 @@ - + + + - \ No newline at end of file diff --git a/doc/salome/gui/KERNEL/whdata/whidx.js b/doc/salome/gui/KERNEL/whdata/whidx.js index ded3d5791..e0519afcb 100755 --- a/doc/salome/gui/KERNEL/whdata/whidx.js +++ b/doc/salome/gui/KERNEL/whdata/whidx.js @@ -1,3 +1,4 @@ +// WebHelp 5.10.001 var gaFileMapping = new Array(); function fileMapping(sBK, sEK, sFileName, nNum) { diff --git a/doc/salome/gui/KERNEL/whdata/whtdata.js b/doc/salome/gui/KERNEL/whdata/whtdata.js index 64bcff920..d5428a7de 100755 --- a/doc/salome/gui/KERNEL/whdata/whtdata.js +++ b/doc/salome/gui/KERNEL/whdata/whtdata.js @@ -1,3 +1,4 @@ +// WebHelp 5.10.001 var gTEA = new Array(); function aTE() { @@ -34,6 +35,11 @@ function tocEntry(fn_arguments) if (fn_arguments.length > 3) { this.sRefURL = fn_arguments[3]; + if (this.nType == 4) + { + if(this.sRefURL.lastIndexOf("/")!=this.sRefURL.length-1) + this.sRefURL+="/"; + } if (fn_arguments.length > 4) { this.sItemURL = fn_arguments[4]; diff --git a/doc/salome/gui/KERNEL/whdata/whtdata0.htm b/doc/salome/gui/KERNEL/whdata/whtdata0.htm index a03503327..d89a6fafd 100755 --- a/doc/salome/gui/KERNEL/whdata/whtdata0.htm +++ b/doc/salome/gui/KERNEL/whdata/whtdata0.htm @@ -1,38 +1,40 @@ - + + + - + diff --git a/doc/salome/gui/KERNEL/whdata/whtoc.htm b/doc/salome/gui/KERNEL/whdata/whtoc.htm index 5f8c14e00..54e0cbf26 100755 --- a/doc/salome/gui/KERNEL/whdata/whtoc.htm +++ b/doc/salome/gui/KERNEL/whdata/whtoc.htm @@ -1,9 +1,11 @@ - + + + - + diff --git a/doc/salome/gui/KERNEL/whgdhtml.htm b/doc/salome/gui/KERNEL/whgdhtml.htm index 01b669216..6ffb2947a 100755 --- a/doc/salome/gui/KERNEL/whgdhtml.htm +++ b/doc/salome/gui/KERNEL/whgdhtml.htm @@ -1,9 +1,9 @@ Glossary - + - + diff --git a/doc/salome/gui/KERNEL/whghost.js b/doc/salome/gui/KERNEL/whghost.js index 77751a19e..56e1d5659 100755 --- a/doc/salome/gui/KERNEL/whghost.js +++ b/doc/salome/gui/KERNEL/whghost.js @@ -1,3 +1,4 @@ +// WebHelp 5.10.004 var gbXML=false; var gaDef=new Array(); var gsBgColor="#ffffff"; @@ -8,6 +9,8 @@ var gsMargin="2pt"; var gsIndent="2pt"; var gsActiveBgColor="#cccccc"; var gbWhGHost=false; +var gbShowDef=true; +var gsGloId="Glo_" function setBackground(sBgImage) { @@ -43,22 +46,6 @@ function setIndent(sIndent) gsIndent=sIndent; } -function writeOneItem(oHTML,bDown,aDataCon,aCurIdxSet,n,aPos,nLevel) -{ - - var sHTML=""; - var nIdxSet=aCurIdxSet[n]; - var nIIdx=aPos[nIdxSet]; - var sRawKName = getItemName(aDataCon,nIdxSet,nIIdx); - var sKName=_textToHtml(sRawKName); - var nIndex=insertDef(sKName,_textToHtml_nonbsp(getDef(aDataCon,nIdxSet,nIIdx))); - if(nLevel==1){ - sHTML+="

"+sKName+"

"; - } - oHTML.addHTML(sHTML,1,bDown,true,sRawKName); -} - function insertDef(sKName,sDef) { var nLength=gaDef.length @@ -71,6 +58,7 @@ function showDef(nDef) { if(nDef"; + sHTML+=""+sKName+"

"; + oHTML.addHTML(sHTML,nLength,bDown,true,sRawKName); + if(gbShowDef) + { + setTimeout("showDef(0);",100); + gbShowDef = false; + } + } +} + +function HighLight(nIndex) +{ + var oObj=getElement(getGloId(nIndex)); + if(oObj) + HighLightElement(oObj,gsActiveBgColor,"transparent"); +} + +function getGloId(nIndex) +{ + return gsGloId+nIndex; } function adjustPosition(bDown,aDataCon,aCurIdxSet,nLength,aPos) @@ -146,7 +176,7 @@ function loadGlo() var sLangId=aProj[0].sLangId; for(var i=0;i Index content - + - + @@ -15,11 +15,7 @@ -<p>Your browser does not support frames. We recommend that you update your browser to a version that supports frames.</p><p>To view the Help system without frames click on this<a href="whgdata/whnvp30.htm">hyperlink.</a></p> +<p>Your browser does not support frames. We recommend that you update your browser to a version that supports frames.</p><p>To view the Help system without frames click on this<a href="whgdata/whnvp30.htm">hyperlink.</a></p> \ No newline at end of file diff --git a/doc/salome/gui/KERNEL/whphost.js b/doc/salome/gui/KERNEL/whphost.js index d4c80bbb9..9c91b49c8 100755 --- a/doc/salome/gui/KERNEL/whphost.js +++ b/doc/salome/gui/KERNEL/whphost.js @@ -1,3 +1,4 @@ +// WebHelp 5.10.005 var gaProj=new Array(); var gnChecked=0; var gsProjName=""; @@ -87,7 +88,7 @@ function whCom(sName,sComFile) var strFile= _getFullPath(getPath(), this.msComFile); var oDiv=getElement(this.msDivId); if(oDiv){ - if(gbIE4){ + if(gbIE4||gbOpera7){ var nIFrameHeight=oDiv.style.pixelHeight; var nIFrameWidth=oDiv.style.pixelWidth; var sHTML=""; + gsHTML=""; goDiv = oDiv; setTimeout("delayLoad()", 100); } @@ -119,11 +119,12 @@ function whCom(sName,sComFile) var sHTML=""; if(gbMac&&gbIE4) sHTML+="
"; + else if(gbIE5) + sHTML+="
"; + else if(gbIE4||gbWindows) + sHTML+="
"; else - if (gbIE5) - sHTML+="
"; - else - sHTML+="
"; + sHTML+="
"; sHTML+="
"; return sHTML; } @@ -203,29 +204,68 @@ function getPath() goMan=new whComMan(); function addPane(sName,sFileName) { - goMan.addCom(sName,sFileName); + var oParam=new Object(); + oParam.sName=sName; + var oMsg=new whMessage(WH_MSG_GETPANE, this, 1, oParam); + if (SendMessage(oMsg)) + { + if (oMsg.oParam.bEnable) + goMan.addCom(sName,sFileName); + } + else + goMan.addCom(sName,sFileName); } function setShowPane(sName, bForce) { if ((gsFirstPane == "") || bForce) - gsFirstPane=sName; + { + var oMsg=new whMessage(WH_MSG_GETDEFPANE, this, 1, null); + if (SendMessage(oMsg)) + { + if (oMsg.oParam) + gsFirstPane = oMsg.oParam; + else + gsFirstPane=sName; + } + else + gsFirstPane=sName; + } } function window_OnLoad() { - if(gsProjName!="") + var oMsg=new whMessage(WH_MSG_GETCMD,this,1,null); + var bHidePane=false; + if (SendMessage(oMsg)) { - goMan.init(); - if(gsFirstPane!="") - goMan.show(gsFirstPane); - else - goMan.showById(0); - loadData2(gsProjName); + if(oMsg.oParam>0) + { + if(oMsg.oParam==1) + gsFirstPane="toc"; + else if(oMsg.oParam==2) + gsFirstPane="idx"; + else if(oMsg.oParam==3) + gsFirstPane="fts"; + else if(oMsg.oParam==4) + gsFirstPane="glo"; + } + else if(oMsg.oParam==0) + { + bHidePane=true; + } } - else if (gServerEnabled) + goMan.init(); + if(gsProjName!="") + loadData2(gsProjName); + if (bHidePane) + { + gsFirstPane=""; + var oMsg1=new whMessage(WH_MSG_HIDEPANE, this, 1, null) + SendMessage(oMsg1); + } + else { - goMan.init(); if(gsFirstPane!="") goMan.show(gsFirstPane); else @@ -249,7 +289,7 @@ function loadData2(strFile) function addProject(bPreferXML,sXMLName,sHTMLName) { var bLoadXML=bPreferXML; - if(!gbIE4&&!gbNav6) + if(!gbIE4&&!gbNav6&&!gbOpera7) return; if(gbIE4&&!gbIE5) bLoadXML=false; @@ -257,6 +297,8 @@ function addProject(bPreferXML,sXMLName,sHTMLName) bLoadXML=true; if(gbIE55||gbNav6) bLoadXML=true; + if(gbOpera7) + bLoadXML=false; if(bLoadXML) addProjectXML(sXMLName); else @@ -316,6 +358,8 @@ function putDataXML(xmlDoc,sdocPath) var sURL=RmtProject[i].getAttribute("url"); if(sURL) { + if(sURL.lastIndexOf("/")!=sURL.length-1) + sURL+="/"; aRProj[nCount]=new Object(); aRProj[nCount++].sPPath=_getFullPath(aRProj[0].sPPath,sURL); } @@ -326,11 +370,23 @@ function putDataXML(xmlDoc,sdocPath) { // on Netscape 6.0 under some situation the xml file cannot be loaded. // so we use pure html instead. - setTimeout("redirectToList();",100); + if (gnChecked == 0) + setTimeout("redirectToList();",100); + else + { + gnChecked++; + setTimeout("checkRemoteProject();", 1); + } } } } +function onLoadXMLError() +{ + gnChecked++; + setTimeout("checkRemoteProject();", 1); +} + function redirectToList() { if(gbReDirectThis) @@ -346,7 +402,7 @@ function putProjectInfo(aRProj) if(gnChecked!=0) { if(aRProj[0].sLangId!=gaProj[0].sLangId) - alert("The project: "+aRProj[0].sPPath+" is using a different language to the main project, which will cause the index and full text search functionality to be disabled for this remote project."); + alert("The merged Help system "+aRProj[0].sPPath+" is using a different language from the master Help system, which will cause the index and full-text search functionality to be disabled in the merged Help system."); } gaProj[gnChecked]=aRProj[0]; for(var i=1;i project description - + - + diff --git a/doc/salome/gui/KERNEL/whproj.js b/doc/salome/gui/KERNEL/whproj.js index 0e235159b..ae38fa994 100755 --- a/doc/salome/gui/KERNEL/whproj.js +++ b/doc/salome/gui/KERNEL/whproj.js @@ -1,3 +1,4 @@ +// WebHelp 5.10.001 var gaProj=new Array(); gaProj[0]=new project(""); @@ -41,6 +42,8 @@ function addGlo(sFile) function addRemoteProject(sProjRelPath) { + if(sProjRelPath.lastIndexOf("/")!=sProjRelPath.length-1) + sProjRelPath+="/"; gaProj[gaProj.length]=new project(sProjRelPath); } diff --git a/doc/salome/gui/KERNEL/whproj.xml b/doc/salome/gui/KERNEL/whproj.xml index d16f189af..4bd4a8de7 100755 --- a/doc/salome/gui/KERNEL/whproj.xml +++ b/doc/salome/gui/KERNEL/whproj.xml @@ -1,3 +1,3 @@ - - + + diff --git a/doc/salome/gui/KERNEL/whproxy.js b/doc/salome/gui/KERNEL/whproxy.js index 222927a0a..d0ee29813 100755 --- a/doc/salome/gui/KERNEL/whproxy.js +++ b/doc/salome/gui/KERNEL/whproxy.js @@ -1,3 +1,4 @@ +// WebHelp 5.10.001 var gbInited=false; var gWndStubPage=null; function getStubPage() @@ -60,4 +61,14 @@ function SendMessage(oMessage) return false; } -var gbWhProxy=true; \ No newline at end of file +var gbWhProxy=true; + +var gbPreview=false; +gbPreview=false; +if (gbPreview) + document.oncontextmenu=contextMenu; + +function contextMenu() +{ + return false; +} diff --git a/doc/salome/gui/KERNEL/whres.xml b/doc/salome/gui/KERNEL/whres.xml index 9634684e9..f3f010a3f 100755 --- a/doc/salome/gui/KERNEL/whres.xml +++ b/doc/salome/gui/KERNEL/whres.xml @@ -1,4 +1,4 @@ - + @@ -6,9 +6,13 @@ + + + + @@ -18,7 +22,11 @@ + + + + @@ -28,13 +36,21 @@ + + + + + + + + @@ -57,6 +73,7 @@ + @@ -160,14 +177,14 @@ - - - - + + + + diff --git a/doc/salome/gui/KERNEL/whskin_banner.htm b/doc/salome/gui/KERNEL/whskin_banner.htm index afe2d3f06..39ed797e6 100755 --- a/doc/salome/gui/KERNEL/whskin_banner.htm +++ b/doc/salome/gui/KERNEL/whskin_banner.htm @@ -1,13 +1,14 @@ About WebHelp                                                                                    - + - + + KERNEL + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/doc/salome/gui/KERNEL/whskin_info.htm b/doc/salome/gui/KERNEL/whskin_info.htm index a68fcd5ce..3092cac5d 100755 --- a/doc/salome/gui/KERNEL/whskin_info.htm +++ b/doc/salome/gui/KERNEL/whskin_info.htm @@ -1,20 +1,20 @@ -WebHelp 5.00 +WebHelp 5.50 - + -

WebHelp 5.00 System Info

+

WebHelp 5.50 System Info

- + - + - - - + + +
Start Page kernel.html
Start Page kernel.htm
Skin Name Default
Generating Time 14:23 03/03/2004
Generating Time 13:17 03/01/2005
Language ID 1033
Compile Script webhelp5_compile_script.xml
Compile Build Version 10.00.949
Product Name WebHelp 5.00
Authoring Tool Name RoboHelp 2002
Compile Build Version 13.10.606
Product Name WebHelp 5.50
Authoring Tool Name RoboHelp X5
\ No newline at end of file diff --git a/doc/salome/gui/KERNEL/whskin_mbars.htm b/doc/salome/gui/KERNEL/whskin_mbars.htm index 66e8c5329..c4fa48af8 100755 --- a/doc/salome/gui/KERNEL/whskin_mbars.htm +++ b/doc/salome/gui/KERNEL/whskin_mbars.htm @@ -1,6 +1,9 @@ - + WebHelp Navigation Mini-bar + + +\n"; + document.write(sStyle); +} + +function window_OnLoad() +{ + if(document.body) + { + if(gsBgImage&&gsBgImage.length>0) + { + document.body.background=gsBgImage; + } + if(gsBgColor&&gsBgColor.length>0) + { + document.body.bgColor=gsBgColor; + } + } + fnOnload(); + window_onResize(); +} + +function window_onResize() +{ + var oDiv = getElement("divlist"); + var oTitle = getElement("p_title"); + var oButton = getElement("tb_button"); + if (oDiv && oTitle && oButton) + { + oDiv.style.height = document.body.offsetHeight - oTitle.offsetHeight - oButton.offsetHeight - 8; + } +} +goTableFont=new whFont("Verdana","8pt","#000000","normal","normal","none"); +goFont=new whFont("Verdana","8pt","#000000","normal","normal","none"); +goHoverFont=new whFont("Verdana","8pt","#666666","normal","normal","none"); + + +setBackgroundcolor("White"); + +setFont("Table", "Tahoma","8pt","Navy","Normal","Normal","none"); +setListBackgroundcolor("White"); + +setFont("Normal", "Tahoma","8pt","Black","Normal","Normal","none"); +setFont("Hover", "Tahoma","8pt","Navy","Normal","Normal","underline"); +setActiveBgColor("Silver"); + +window.onload=window_OnLoad; +window.onresize = window_onResize; +writeStyle(); +//--> + + + + +

Select a topic, then click Display

+
+
+
+ + + +
+ + + + \ No newline at end of file diff --git a/doc/salome/gui/KERNEL/whskin_plist.htm b/doc/salome/gui/KERNEL/whskin_plist.htm index 35f0155b8..f7cf6d1d5 100755 --- a/doc/salome/gui/KERNEL/whskin_plist.htm +++ b/doc/salome/gui/KERNEL/whskin_plist.htm @@ -1,47 +1,38 @@ Navigation Pane - + - + \ No newline at end of file diff --git a/doc/salome/gui/KERNEL/whskin_tbars.htm b/doc/salome/gui/KERNEL/whskin_tbars.htm index 8b705444c..6cb490239 100755 --- a/doc/salome/gui/KERNEL/whskin_tbars.htm +++ b/doc/salome/gui/KERNEL/whskin_tbars.htm @@ -1,6 +1,9 @@ - + WebHelp Navigation Toolbar + + + "; + var sStyle=""; document.write(sStyle); } } } -function button(sText, nWidth, nHeight) +function button(sText,nWidth,nHeight) { - this.sText = sText; - this.nWidth = nWidth; - this.nHeight = nHeight; + this.sText=sText; + this.nWidth=nWidth; + this.nHeight=nHeight; - this.aImgs = new Array(); - var i = 0; - while (button.arguments.length > i + 3) + this.aImgs=new Array(); + var i=0; + while(button.arguments.length>i+3) { - this.aImgs[i] = button.arguments[3 + i]; - i ++; + this.aImgs[i]=button.arguments[3+i]; + i++; } } -// project info +//project info function setRelStartPage(sPath) { - if (gsPPath.length == 0) + if(gsPPath.length==0) { - gsPPath = _getFullPath(_getPath(document.location.href), _getPath(sPath)); - gsStartPage = _getFullPath(_getPath(document.location.href), sPath); - gsRelCurPagePath = _getRelativeFileName(gsStartPage, document.location.href); + gsPPath=_getFullPath(_getPath(document.location.href),_getPath(sPath)); + gsStartPage=_getFullPath(_getPath(document.location.href),sPath); + gsRelCurPagePath=_getRelativeFileName(gsStartPage,document.location.href); } } -function getImage(oImage, sType) +function getImage(oImage,sType) { var sImg=""; - if (oImage && oImage.aImgs && (oImage.aImgs.length > 0)) + if(oImage&&oImage.aImgs&&(oImage.aImgs.length>0)) { - sImg+="\""+ 0) - sImg+=" width=" + oImage.nWidth; - if (oImage.nHeight > 0) - sImg+=" height=" + oImage.nHeight; - sImg+=" border=no>"; + sImg+="\""+sType+"\"0) + sImg+=" width="+oImage.nWidth; + if(oImage.nHeight>0) + sImg+=" height="+oImage.nHeight; + sImg+=" border=0>"; } return sImg; } function addTocInfo(sTocPath) { - gaPaths[gaPaths.length] = sTocPath; + gaPaths[gaPaths.length]=sTocPath; } -function addAvenueInfo(sName, sPrev, sNext) +function addAvenueInfo(sName,sPrev,sNext) { - gaAvenues[gaAvenues.length] = new avenueInfo(sName, sPrev, sNext); + gaAvenues[gaAvenues.length]=new avenueInfo(sName,sPrev,sNext); } -function addButton(sType, nStyle, sText, sHref, sOnClick, sOnMouseOver, sOnLoad, nWidth, nHeight, sImg1, sImg2, sImg3) +function addButton(sType,nStyle,sText,sHref,sOnClick,sOnMouseOver,sOnLoad,nWidth,nHeight,sImg1,sImg2,sImg3) { - var sButton = ""; + var sButton=""; var nBtn=gaButtons.length; - if (sType == "prev") + if(sType=="prev") { - if (canGo(false)) + if(canGo(false)) { - var sTitle = "Previous Topic"; - goPrev = new button(sText, nWidth, nHeight, sImg1, sImg2, sImg3); - sButton = ""; - if (nStyle == BTN_TEXT) - sButton += goPrev.sText; + var sTitle="Previous Topic"; + goPrev=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3); + sButton=""; + if(nStyle==BTN_TEXT) + sButton+=goPrev.sText; else - sButton += getImage(goPrev, sTitle); - sButton += ""; + sButton+=getImage(goPrev,sTitle); + sButton+=""; } } - else if (sType == "next") + else if(sType=="next") { - if (canGo(true)) + if(canGo(true)) { - var sTitle = "Next Topic"; - goNext = new button(sText, nWidth, nHeight, sImg1, sImg2, sImg3); - sButton = ""; - if (nStyle == BTN_TEXT) - sButton += goNext.sText; + var sTitle="Next Topic"; + goNext=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3); + sButton=""; + if(nStyle==BTN_TEXT) + sButton+=goNext.sText; else - sButton += getImage(goNext, sTitle); - sButton += ""; + sButton+=getImage(goNext,sTitle); + sButton+=""; } } - else if (sType == "show") + else if(sType=="show") { - if (isTopicOnly()) + if(isTopicOnly()&&(!gbOpera6||gbOpera7)) { - var sTitle = "Show Navigation Component"; - goShow = new button(sText, nWidth, nHeight, sImg1, sImg2, sImg3); - sButton = ""; - if (nStyle == BTN_TEXT) - sButton += goShow.sText; + var sTitle="Show Navigation Component"; + goShow=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3); + sButton=""; + if(nStyle==BTN_TEXT) + sButton+=goShow.sText; else - sButton += getImage(goShow, sTitle); - sButton += ""; + sButton+=getImage(goShow,sTitle); + sButton+=""; } } - else if (sType == "hide") + else if(sType=="hide") { - if (!isTopicOnly()) + if(!isTopicOnly()&&!gbOpera6) { - var sTitle = "Hide Navigation Component"; - goHide = new button(sText, nWidth, nHeight, sImg1, sImg2, sImg3); - sButton = ""; - if (nStyle == BTN_TEXT) - sButton += goHide.sText; + var sTitle="Hide Navigation Component"; + goHide=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3); + sButton=""; + if(nStyle==BTN_TEXT) + sButton+=goHide.sText; else - sButton += getImage(goHide, sTitle); - sButton += ""; + sButton+=getImage(goHide,sTitle); + sButton+=""; } } - else if (sType == "shownav") + else if(sType=="shownav") { - - if (isShowHideEnable()) + if(isShowHideEnable()) { - var sTitle = "Show Navigation Component"; - goShowNav = new button(sText, nWidth, nHeight, sImg1, sImg2, sImg3); - sButton = ""; - if (nStyle == BTN_TEXT) - sButton += goShowNav.sText; + var sTitle="Show Navigation Component"; + goShowNav=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3); + sButton=""; + if(nStyle==BTN_TEXT) + sButton+=goShowNav.sText; else - sButton += getImage(goShowNav, sTitle); - sButton += ""; + sButton+=getImage(goShowNav,sTitle); + sButton+=""; } } - else if (sType == "hidenav") + else if(sType=="hidenav") { - if (isShowHideEnable()) + if(isShowHideEnable()) { - var sTitle = "Hide Navigation Component"; - goHideNav = new button(sText, nWidth, nHeight, sImg1, sImg2, sImg3); - sButton = ""; - if (nStyle == BTN_TEXT) - sButton += goHideNav.sText; + var sTitle="Hide Navigation Component"; + goHideNav=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3); + sButton=""; + if(nStyle==BTN_TEXT) + sButton+=goHideNav.sText; else - sButton += getImage(goHideNav, sTitle); - sButton += ""; + sButton+=getImage(goHideNav,sTitle); + sButton+=""; } } - else if (sType == "synctoc") + else if(sType=="synctoc") { - if (gaPaths.length > 0) + if(gaPaths.length>0) { - var sTitle = "Sync TOC"; - goSync = new button(sText, nWidth, nHeight, sImg1, sImg2, sImg3); - sButton = ""; - if (nStyle == BTN_TEXT) - sButton += goSync.sText; + var sTitle="Sync TOC"; + goSync=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3); + sButton=""; + if(nStyle==BTN_TEXT) + sButton+=goSync.sText; else - sButton += getImage(goSync, sTitle); - sButton += ""; + sButton+=getImage(goSync,sTitle); + sButton+=""; } } - else if (sType == "websearch") + else if(sType=="websearch") { - if (gsSearchFormHref.length > 0) + if(gsSearchFormHref.length>0) { - var sTitle = "WebSearch"; - goWebSearch = new button(sText, nWidth, nHeight, sImg1, sImg2, sImg3); - sButton = ""; - if (nStyle == BTN_TEXT) - sButton += goWebSearch.sText; + var sTitle="WebSearch"; + goWebSearch=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3); + sButton=""; + if(nStyle==BTN_TEXT) + sButton+=goWebSearch.sText; else - sButton += getImage(goWebSearch, sTitle); - sButton += ""; + sButton+=getImage(goWebSearch,sTitle); + sButton+=""; } } - else if (sType == "searchform") + else if(sType=="searchform") { - gaButtons[nBtn] = "NeedSearchForm"; - gaTypes[nBtn] = sType; + gaButtons[nBtn]="NeedSearchForm"; + gaTypes[nBtn]=sType; } - if (sButton.length != 0) + if(sButton.length!=0) { - if (nStyle == BTN_TEXT) - sButton += " "; - gaButtons[nBtn] = "" + sButton + ""; - gaTypes[nBtn] = sType; + if(nStyle==BTN_TEXT) + sButton+=" "; + gaButtons[nBtn]=""+sButton+""; + gaTypes[nBtn]=sType; } } function isSyncEnabled() { - if (!gbCheckSync) + if(!gbCheckSync) { var oMsg=new whMessage(WH_MSG_ISSYNCSSUPPORT,this,1,null); if(SendMessage(oMsg)) @@ -250,30 +250,30 @@ function isSyncEnabled() function isInPopup() { - return (window.name.indexOf("BSSCPopup") != -1); + return (window.name.indexOf("BSSCPopup")!=-1); } function getIntopicBar(sAlign) { - var sHTML = ""; - if (gaButtons.length > 0) + var sHTML=""; + if(gaButtons.length>0) { - sHTML += "
"; + sHTML+="
"; - sHTML += ""; - for (var i = 0; i < gaButtons.length; i++) + sHTML+="
"; + for(var i=0;i 0) + if(isInPopup()) return; + if(gaButtons.length>0) { - var sHTML = ""; - if (nAligns != 0) + var sHTML=""; + if(nAligns!=0) { - sHTML += "
" - if (nAligns & 1) - sHTML += ""; - if (nAligns & 2) - sHTML += ""; - if (nAligns & 4) - sHTML += ""; - sHTML += "
" + getIntopicBar("left") + "" + getIntopicBar("center") + "" + getIntopicBar("right") + "
"; + sHTML+="" + if(nAligns&1) + sHTML+=""; + if(nAligns&2) + sHTML+=""; + if(nAligns&4) + sHTML+=""; + sHTML+="
"+getIntopicBar("left")+""+getIntopicBar("center")+""+getIntopicBar("right")+"
"; document.write(sHTML); } } @@ -302,45 +302,45 @@ function writeIntopicBar(nAligns) function sendAveInfoOut() { - if (!isInPopup()) - setTimeout("sendAveInfo();", 100); + if(!isInPopup()) + setTimeout("sendAveInfo();",100); } function sendAveInfo() { - var oMsg = new whMessage(WH_MSG_AVENUEINFO, this, 1, gaAvenues); + var oMsg=new whMessage(WH_MSG_AVENUEINFO,this,1,gaAvenues); SendMessage(oMsg); } function onNext() { - var oMsg = new whMessage(WH_MSG_NEXT, this, 1, null); + var oMsg=new whMessage(WH_MSG_NEXT,this,1,null); SendMessage(oMsg); } function onPrev() { - var oMsg = new whMessage(WH_MSG_PREV, this, 1, null); + var oMsg=new whMessage(WH_MSG_PREV,this,1,null); SendMessage(oMsg); } function createSyncInfo() { - var oParam = new Object(); - if (gsPPath.length == 0) - gsPPath = _getPath(document.location.href); - oParam.sPPath = gsPPath; - oParam.sTPath = document.location.href; - oParam.aPaths = gaPaths; + var oParam=new Object(); + if(gsPPath.length==0) + gsPPath=_getPath(document.location.href); + oParam.sPPath=gsPPath; + oParam.sTPath=document.location.href; + oParam.aPaths=gaPaths; return oParam; } function syncWithShow() { - if (isTopicOnly()) + if(isTopicOnly()) show(); - else + else { sync(); showTocPane(); @@ -349,86 +349,86 @@ function syncWithShow() function showTocPane() { - var oMsg = new whMessage(WH_MSG_SHOWTOC, this, 1, null); + var oMsg=new whMessage(WH_MSG_SHOWTOC,this,1,null); SendMessage(oMsg); } function sendSyncInfo() { - if (!isInPopup()) + if(!isInPopup()) { - var oParam = null; - if (gaPaths.length > 0) + var oParam=null; + if(gaPaths.length>0) { - oParam = createSyncInfo(); + oParam=createSyncInfo(); } - var oMsg = new whMessage(WH_MSG_SYNCINFO, this, 1, oParam); + var oMsg=new whMessage(WH_MSG_SYNCINFO,this,1,oParam); SendMessage(oMsg); } } function sendInvalidSyncInfo() { - if (!isInPopup()) + if(!isInPopup()) { - var oMsg = new whMessage(WH_MSG_SYNCINFO, this, 1, null); + var oMsg=new whMessage(WH_MSG_SYNCINFO,this,1,null); SendMessage(oMsg); } } function enableWebSearch(bEnable) { - if (!isInPopup()) + if(!isInPopup()) { - var oMsg = new whMessage(WH_MSG_ENABLEWEBSEARCH, this, 1, bEnable); + var oMsg=new whMessage(WH_MSG_ENABLEWEBSEARCH,this,1,bEnable); SendMessage(oMsg); } } function autoSync(nSync) { - if (nSync == 0) return; - if (isInPopup()) return; - if (isOutMostTopic()) + if(nSync==0) return; + if(isInPopup()) return; + if(isOutMostTopic()) sync(); } function isOutMostTopic() { - if (gnOutmostTopic == -1) + if(gnOutmostTopic==-1) { - var oMessage = new whMessage(WH_MSG_ISINFRAMESET, this, 1 , null); - if (SendMessage(oMessage)) - gnOutmostTopic = 0; + var oMessage=new whMessage(WH_MSG_ISINFRAMESET,this,1,null); + if(SendMessage(oMessage)) + gnOutmostTopic=0; else - gnOutmostTopic = 1; + gnOutmostTopic=1; } - return (gnOutmostTopic == 1); + return (gnOutmostTopic==1); } function sync() { - if (gaPaths.length > 0) + if(gaPaths.length>0) { - var oParam = createSyncInfo(); - var oMessage = new whMessage(WH_MSG_SYNCTOC, this, 1, oParam); + var oParam=createSyncInfo(); + var oMessage=new whMessage(WH_MSG_SYNCTOC,this,1,oParam); SendMessage(oMessage); } } -function avenueInfo(sName, sPrev, sNext) +function avenueInfo(sName,sPrev,sNext) { - this.sName = sName; - this.sPrev = sPrev; - this.sNext = sNext; + this.sName=sName; + this.sPrev=sPrev; + this.sNext=sNext; } function getCurrentAvenue() { - var oParam = new Object(); - oParam.sAvenue = null; - var oMessage = new whMessage(WH_MSG_GETCURRENTAVENUE, this, 1, oParam); + var oParam=new Object(); + oParam.sAvenue=null; + var oMessage=new whMessage(WH_MSG_GETCURRENTAVENUE,this,1,oParam); SendMessage(oMessage); return oParam.sAvenue; } @@ -437,37 +437,37 @@ function unRegisterListener() { sendInvalidSyncInfo(); enableWebSearch(false); - if (whtopic_foldUnload) + if(whtopic_foldUnload) whtopic_foldUnload(); } function onSendMessage(oMsg) { - var nMsgId = oMsg.nMessageId; - if (nMsgId == WH_MSG_GETAVIAVENUES) + var nMsgId=oMsg.nMessageId; + if(nMsgId==WH_MSG_GETAVIAVENUES) { - oMsg.oParam.aAvenues = gaAvenues; + oMsg.oParam.aAvenues=gaAvenues; return false; } - else if (nMsgId == WH_MSG_GETTOCPATHS) + else if(nMsgId==WH_MSG_GETTOCPATHS) { - if (isOutMostTopic()) + if(isOutMostTopic()) { - oMsg.oParam.oTocInfo = createSyncInfo(); + oMsg.oParam.oTocInfo=createSyncInfo(); return false; } else return true; } - else if (nMsgId == WH_MSG_NEXT) + else if(nMsgId==WH_MSG_NEXT) { goAvenue(true); } - else if (nMsgId == WH_MSG_PREV) + else if(nMsgId==WH_MSG_PREV) { goAvenue(false); } - else if (nMsgId == WH_MSG_WEBSEARCH) + else if(nMsgId==WH_MSG_WEBSEARCH) { websearch(); } @@ -476,60 +476,60 @@ function onSendMessage(oMsg) function goAvenue(bNext) { - var sTopic = null; - var sAvenue = getCurrentAvenue(); - var nAvenue = -1; - if (sAvenue != null && sAvenue != "") + var sTopic=null; + var sAvenue=getCurrentAvenue(); + var nAvenue=-1; + if(sAvenue!=null&&sAvenue!="") { - for (var i = 0; i < gaAvenues.length ; i ++) + for(var i=0;i 0 && bNext) + if(gaAvenues[i].sNext!=null&&gaAvenues[i].sNext.length>0&&bNext) { - sTopic = gaAvenues[i].sNext; + sTopic=gaAvenues[i].sNext; break; } - else if (gaAvenues[i].sPrev != null && gaAvenues[i].sPrev.length > 0 && !bNext) + else if(gaAvenues[i].sPrev!=null&&gaAvenues[i].sPrev.length>0&&!bNext) { - sTopic = gaAvenues[i].sPrev; + sTopic=gaAvenues[i].sPrev; break; } } } - if (sTopic != null && sTopic != "") + if(sTopic!=null&&sTopic!="") { - if (gsPPath != null && gsPPath != "") + if(gsPPath!=null&&gsPPath!="") { - sFullTopicPath = _getFullPath(gsPPath, sTopic); - document.location = sFullTopicPath; + sFullTopicPath=_getFullPath(gsPPath,sTopic); + document.location=sFullTopicPath; } } } function canGo(bNext) { - for (var i = 0; i < gaAvenues.length ; i ++) + for(var i=0;i 0 && bNext) || - (gaAvenues[i].sPrev != null && gaAvenues[i].sPrev.length > 0 && !bNext)) + if((gaAvenues[i].sNext!=null&&gaAvenues[i].sNext.length>0&&bNext)|| + (gaAvenues[i].sPrev!=null&&gaAvenues[i].sPrev.length>0&&!bNext)) return true; } return false; @@ -537,34 +537,34 @@ function canGo(bNext) function show() { - if (gsStartPage != "") - window.location = gsStartPage + "#" + gsRelCurPagePath; + if(gsStartPage!="") + window.location=gsStartPage+"#"+gsRelCurPagePath; } function hide() { - if (goFrame != null) + if(goFrame!=null) { - goFrame.location = window.location; + goFrame.location=window.location; } } function isTopicOnly() { - if (gnTopicOnly == -1) + if(gnTopicOnly==-1) { - var oParam = new Object(); - oParam.oFrame = null; - var oMsg = new whMessage(WH_MSG_GETSTARTFRAME, this, 1, oParam); - if (SendMessage(oMsg)) + var oParam=new Object(); + oParam.oFrame=null; + var oMsg=new whMessage(WH_MSG_GETSTARTFRAME,this,1,oParam); + if(SendMessage(oMsg)) { - goFrame = oParam.oFrame; - gnTopicOnly = 0; + goFrame=oParam.oFrame; + gnTopicOnly=0; } else - gnTopicOnly = 1; + gnTopicOnly=1; } - if (gnTopicOnly == 1) + if(gnTopicOnly==1) return true; else return false; @@ -572,88 +572,150 @@ function isTopicOnly() function websearch() { - if (gbNav4) + if(gbNav4) { - if (document.ehelpform) + if(document.ehelpform) document.ehelpform.submit(); } else { - if (window.ehelpform) + if(window.ehelpform) window.ehelpform.submit(); } } function addSearchFormHref(sHref) { - gsSearchFormHref = sHref; + gsSearchFormHref=sHref; enableWebSearch(true); } function searchB(nForm) { - var sValue = eval("document.searchForm" + nForm + ".searchString.value"); - var oMsg = new whMessage(WH_MSG_SEARCHTHIS, this, 1, sValue); + var sValue=eval("document.searchForm"+nForm+".searchString.value"); + var oMsg=new whMessage(WH_MSG_SEARCHTHIS,this,1,sValue); SendMessage(oMsg); } function getSearchFormHTML() { - var sHTML = ""; - gnForm ++; - var sFormName = "searchForm" + gnForm; - var sButton = "
" - sButton += ""; - if ("" == "text") + var sHTML=""; + gnForm++; + var sFormName="searchForm"+gnForm; + var sButton="" + sButton+=""; + if(""=="text") { - sButton+=""; + sButton+=""; } - else if ("" == "image") + else if(""=="image") { - sButton+="" + sButton+="" sButton+=""; } - sButton += "
"; - sHTML ="" + sButton + ""; + sButton+=""; + sHTML=""+sButton+""; return sHTML; } function showHidePane(bShow) { var oMsg=null; - if (bShow) - oMsg=new whMessage(WH_MSG_SHOWPANE, this, 1, null); + if(bShow) + oMsg=new whMessage(WH_MSG_SHOWPANE,this,1,null); else - oMsg=new whMessage(WH_MSG_HIDEPANE, this, 1, null); + oMsg=new whMessage(WH_MSG_HIDEPANE,this,1,null); SendMessage(oMsg); } function isShowHideEnable() { - if (gbIE4) + if(gbIE4) return true; else return false; } + +function PickupDialog_Invoke() +{ + if(!gbIE4||gbMac) + { + if(typeof(_PopupMenu_Invoke)=="function") + return _PopupMenu_Invoke(PickupDialog_Invoke.arguments); + } + else + { + if(PickupDialog_Invoke.arguments.length>2) + { + var sPickup="whskin_pickup.htm"; + var sPickupPath=gsPPath+sPickup; + if(gbIE4) + { + var sFrame=PickupDialog_Invoke.arguments[1]; + var aTopics=new Array(); + for(var i=2;i1) + { + var nWidth=300; + var nHeight=180; + var nScreenWidth=screen.width; + var nScreenHeight=screen.height; + var nLeft=(nScreenWidth-nWidth)/2; + var nTop=(nScreenHeight-nHeight)/2; + if(gbIE4) + { + var vRet=window.showModalDialog(sPickupPath,aTopics,"dialogHeight:"+nHeight+"px;dialogWidth:"+nWidth+"px;resizable:yes;status:no;scroll:no;help:no;center:yes;"); + if(vRet) + { + var sURL=vRet.m_url; + if(sFrame) + window.open(sURL,sFrame); + else + window.open(sURL,"_self"); + } + } + } + else if(aTopics.length==1) + { + var sURL=aTopics[0].m_sURL + if(sFrame) + window.open(sURL,sFrame); + else + window.open(sURL,"_self"); + } + } + } + } +} + if(window.gbWhUtil&&window.gbWhMsg&&window.gbWhVer&&window.gbWhProxy) { - RegisterListener("bsscright", WH_MSG_GETAVIAVENUES); - RegisterListener("bsscright", WH_MSG_GETTOCPATHS); - RegisterListener("bsscright", WH_MSG_NEXT); - RegisterListener("bsscright", WH_MSG_PREV); - RegisterListener("bsscright", WH_MSG_WEBSEARCH); - if (gbMac && gbIE4) + RegisterListener("bsscright",WH_MSG_GETAVIAVENUES); + RegisterListener("bsscright",WH_MSG_GETTOCPATHS); + RegisterListener("bsscright",WH_MSG_NEXT); + RegisterListener("bsscright",WH_MSG_PREV); + RegisterListener("bsscright",WH_MSG_WEBSEARCH); + if(gbMac&&gbIE4) { - if (typeof(window.onunload) != "unknown") - whtopic_foldUnload = window.onunload; + if(typeof(window.onunload)!="unknown") + if(window.onunload.toString!=unRegisterListener.toString) + whtopic_foldUnload=window.onunload; } else { - if (window.onunload) - whtopic_foldUnload = window.onunload; + if(window.onunload) + if(window.onunload.toString!=unRegisterListener.toString) + whtopic_foldUnload=window.onunload; } - window.onunload = unRegisterListener; + window.onunload=unRegisterListener; setButtonFont("show","","10pt","","","",""); gbWhTopic=true; diff --git a/doc/salome/gui/KERNEL/whutils.js b/doc/salome/gui/KERNEL/whutils.js index 7fa6c28a8..85fae7e05 100755 --- a/doc/salome/gui/KERNEL/whutils.js +++ b/doc/salome/gui/KERNEL/whutils.js @@ -1,19 +1,26 @@ +// WebHelp 5.10.004 var gsFileName=""; +var gsDivName=""; var xmlDoc=null; var sdocPath=null; var gsInsertBeforeEndHTML=""; var sReplaceStringsSrc=new Array(); +var gsDivName="dataDiv"; +var gnLoadDivNum=0; sReplaceStringsSrc[0]="&"; sReplaceStringsSrc[1]=">"; sReplaceStringsSrc[2]="<"; sReplaceStringsSrc[3]="""; -sReplaceStringsSrc[4]=" "; +sReplaceStringsSrc[4]=String.fromCharCode(8364); +sReplaceStringsSrc[5]=" "; + var sReplaceStringsDst=new Array(); sReplaceStringsDst[0]="&"; sReplaceStringsDst[1]=">"; sReplaceStringsDst[2]="<"; sReplaceStringsDst[3]="\""; -sReplaceStringsDst[4]=" "; +sReplaceStringsDst[4]=String.fromCharCode(128); +sReplaceStringsDst[5]=" "; var goHighLighted=null; function _getRelativePath(strParentPath,strCurrentPath) @@ -45,7 +52,7 @@ function _getRelativePath(strParentPath,strCurrentPath) return strCurrentPath; } -function _getRelativeFileName(strParentPath, strCurrentPath) +function _getRelativeFileName(strParentPath,strCurrentPath) { strParentPath=_replaceSlash(strParentPath); strParentPath=_getPath(strParentPath); @@ -108,7 +115,7 @@ function _getFullPath(sPath,sRelPath) { sRelPath=sRelPath.substring(nPathPos+3); sFullPath=sFullPath.substring(0,sFullPath.length-1); - var nPos2 = sFullPath.lastIndexOf("/"); + var nPos2=sFullPath.lastIndexOf("/"); if(nPos2!=-1) sFullPath=sFullPath.substring(0,nPos2+1); else @@ -123,7 +130,7 @@ function _getFullPath(sPath,sRelPath) function _isAbsPath(strPath) { var strUpper=strPath.toUpperCase(); - return (strUpper.indexOf(":")!=-1); + return (strUpper.indexOf(":")!=-1||strUpper.indexOf("\\\\")==0); } function _replaceSlash(strURL) @@ -166,21 +173,29 @@ function insertItemIntoArray(oArray,i,obj) function loadData(sFileName) { - if(!getElement("dataDiv")) + var i=gnLoadDivNum; + var sName=gsDivName+gnLoadDivNum++; + loadData_2(sFileName,sName); +} + +function loadData_2(sFileName,sDivName) +{ + if(!getElement(sDivName)) { - if(!insertDataDiv()) + if(!insertDataDiv(sDivName)) { gsFileName=sFileName; + gsDivName=sDivName; return; } } var sHTML=""; if(gbMac) - sHTML+=""; + sHTML+=""; else - sHTML+=""; + sHTML+=""; - var oDivCon=getElement("dataDiv"); + var oDivCon=getElement(sDivName); if(oDivCon) { if(gbNav6) @@ -231,21 +246,21 @@ function checkState() if(state==4) { var err=xmlDoc.parseError; - if(err.errorCode!=0) - alert(err.reason); - else + if(err.errorCode==0) putDataXML(xmlDoc,sdocPath); + else + onLoadXMLError(); } } } -function insertDataDiv() +function insertDataDiv(sName) { var sHTML=""; if(gbMac) - sHTML+="
"; + sHTML+="
"; else - sHTML+="
"; + sHTML+="
"; if((gbIE5||gbNav6)&&document.body) document.body.insertAdjacentHTML("beforeEnd",sHTML); else @@ -264,7 +279,7 @@ function insertWhenBodyReady() { document.body.insertAdjacentHTML("beforeEnd",gsInsertBeforeEndHTML); gsInsertBeforeEndHTML=""; - loadData(gsFileName); + loadData_2(gsFileName,gsDivName); } else { @@ -274,9 +289,12 @@ function insertWhenBodyReady() function window_BUnload() { - var oDivCon=getElement("dataDiv"); - if(oDivCon) - oDivCon.innerHTML=""; + for(var i=0;i='0'&&sBStr.charAt(i)<='9') + { + sNum+=sBStr.charAt(i++); + } + if(sNum!=""){ + var nNum=parseInt(sNum,16); + sText+=String.fromCharCode(nNum); + sBStr=sBStr.substring(i); + } + nPos=sBStr.indexOf('%'); + } + sText+=sBStr; + return sText; +} + +function excapeSingleQuotandSlash(str) +{ + if(str==null) return null; + var nPos=0; + var sRes=""; + var nPosNew=str.indexOf("\\",nPos); + while(nPosNew!=-1){ + sRes+=str.substring(nPos,nPosNew+1)+"\\"; + nPos=nPosNew+1; + nPosNew=str.indexOf("\\",nPos); + } + if(nPos=4) +if(!gbOpera&&!gbKonqueror&&!gbSafari) // opera can mimic IE or Netscape by settings. { - if(navigator.appName=="Netscape") + gbIE=(navigator.appName.indexOf("Microsoft")!=-1); + gbNav=(gAgent.indexOf('mozilla')!=-1) && ((gAgent.indexOf('spoofer')==-1) && (gAgent.indexOf('compatible')==-1)); + if(gnVerMajor>=4) { - gbNav4=true; - if(gnVerMajor>=5) - gbNav6=true; + if(navigator.appName=="Netscape") + { + gbNav4=true; + if(gnVerMajor>=5) + gbNav6=true; + } + gbIE4=(navigator.appName.indexOf("Microsoft")!=-1); + } + if(gbNav6) + { + var nPos=gAgent.indexOf("gecko"); + if(nPos!=-1) + { + var nPos2=gAgent.indexOf("/", nPos); + if(nPos2!=-1) + { + var nVersion=parseFloat(gAgent.substring(nPos2+1)); + if(nVersion>=20010726) + { + gbNav61=true; + if (nVersion>=20020823) + gbNav7=true; + } + } + } + }else if(gbIE4) + { + var nPos=gAgent.indexOf("msie"); + if(nPos!=-1) + { + var nVersion=parseFloat(gAgent.substring(nPos+5)); + if(nVersion>=5) + { + gbIE5=true; + if(nVersion>=5.5) + gbIE55=true; + } + } } - gbIE4=(navigator.appName.indexOf("Microsoft")!=-1); } -if(gbNav6) +else if (gbOpera) { - document.gnPageWidth=innerWidth; - document.gnPageHeight=innerHeight; - var nPos=gAgent.indexOf("netscape"); + var nPos = gAgent.indexOf("opera"); if(nPos!=-1) { - var nVersion=parseFloat(gAgent.substring(nPos+10)); - if(nVersion>=6.1) - gbNav61=true; + var nVersion=parseFloat(gAgent.substring(nPos+6)); + if(nVersion>=6) + { + gbOpera6=true; + if(nVersion>=7) + gbOpera7=true; + } } -}else if(gbIE4) +} +else if (gbKonqueror) { - var nPos=gAgent.indexOf("msie"); + var nPos = gAgent.indexOf("konqueror"); if(nPos!=-1) { - var nVersion=parseFloat(gAgent.substring(nPos+5)); - if(nVersion>=5) - gbIE5=true; - if(nVersion>=5.5) - gbIE55=true; + var nVersion = parseFloat(gAgent.substring(nPos+10)); + if (nVersion >= 3) + { + gbKonqueror3=true; + } } } diff --git a/doc/salome/gui/KERNEL/whxdata/whftdata0.xml b/doc/salome/gui/KERNEL/whxdata/whftdata0.xml new file mode 100755 index 000000000..79d67eb76 --- /dev/null +++ b/doc/salome/gui/KERNEL/whxdata/whftdata0.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/salome/gui/KERNEL/whxdata/whfts.xml b/doc/salome/gui/KERNEL/whxdata/whfts.xml new file mode 100755 index 000000000..7e2e74af4 --- /dev/null +++ b/doc/salome/gui/KERNEL/whxdata/whfts.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/doc/salome/gui/KERNEL/whxdata/whfwdata0.xml b/doc/salome/gui/KERNEL/whxdata/whfwdata0.xml new file mode 100755 index 000000000..9b6ef44b9 --- /dev/null +++ b/doc/salome/gui/KERNEL/whxdata/whfwdata0.xml @@ -0,0 +1,1056 @@ + + + 14, + 14, + 14, + 14, + 14, + 3,14,15, + 14, + 14, + 14, + 3,14,15, + 2, + 14, + 14,15, + 14, + 11,16, + 2,14, + 14, + 14, + 14, + 14, + 2, + 0,14, + 14, + 7,14, + 0,16,21,23, + 14, + 14,15,16,20,21, + 2, + 14, + 0, + 1, + 18, + 3, + 3,5, + 5, + 14,19,23, + 0, + 4,14,15,19,23, + 3, + 0,4,6,14,10,21, + 14,19, + 0, + 14,12,17, + 0,14,11, + 0,5,6,14,11,15,16,17,18,19,22,23, + 11, + 19, + 14, + 14, + 14, + 0,14,17,23, + 14, + 0,1,2,4,7,14,12,15,23, + 14, + 21, + 2,7,8,14,18,19,22, + 1, + 0,4,8,9,10,11,15,16,17,18,19,21, + 10,18, + 14,11, + 14, + 14, + 14, + 0, + 16, + 14, + 2, + 21, + 21, + 17,18, + 14, + 13,20,21,23, + 21, + 7,19, + 14,18, + 4,14,13,15,17,18,23, + 18, + 0,14, + 14, + 14, + 14, + 14,16, + 18, + 0,9,17, + 14, + 14,16, + 0,14,15, + 2, + 14, + 22, + 0, + 9, + 14,12, + 23, + 14,15,19, + 14, + 14, + 0, + 16, + 14, + 20, + 14, + 14, + 14, + 16,23, + 7,14,13,17,19,22, + 14, + 2, + 14,12, + 1,14,10,13,16,18,21,23, + 14, + 14,11,19, + 14,11, + 14,12,13,17,22, + 15, + 2, + 2,9, + 0,14, + 8,11, + 14,17,19,22, + 16, + 14, + 19, + 14, + 14,9, + 14, + 0,7,14,17,23, + 2,5,14, + 14, + 14, + 19, + 19, + 19, + 10,15, + 20, + 0,2,7,14,17, + 1, + 14, + 14, + 14, + 14, + 23, + 14, + 3,5,4,6,7,14,13,19,22, + 19, + 18, + 14,23, + 16, + 3,6,7,14,12,13,16,17,20,21,22,23, + 12, + 0, + 14,12,17,20, + 0, + 0,14,9, + 14, + 18,21, + 18,21,22, + 11, + 16, + 14, + 14, + 0,14,15, + 2, + 14,10,17, + 0, + 23, + 14, + 7,14,20,22, + 0,9, + 0,1,4,6,10,11,12,13,16,17,18,19,21,22,23, + 14, + 0,9, + 0,12, + 14,9, + 0, + 14, + 14, + 14, + 14, + 11, + 14, + 14, + 8, + 2, + 16, + 15,16,18, + 0,15, + 2, + 11, + 1,2,7,14,13,15,16,18,19,20,21,22, + 15, + 14,20, + 4,16,21,23, + 14, + 9, + 3,14, + 16, + 11, + 2,23, + 6,14,16,17, + 2,14, + 0, + 17, + 16, + 14,13,15,20, + 9, + 0,9, + 15, + 0,1,3,8,14,10,13,15,16,17,18,19,21,23, + 0,14,9,10, + 9, + 12,17, + 14,15, + 15, + 6,7,14,12,15,17,18,21,22,23, + 9,18,19,23, + 14, + 14, + 7,22, + 0,8,14,10,11,17,18, + 0, + 2, + 21, + 3,4,14,15,17,18,21,23, + 14,18,23, + 0,3,4,6,15,17,18,21,22,23, + 0,20, + 9, + 14,18,21,23, + 14, + 14, + 0,9, + 21, + 0,1,2,14,19, + 14,15,19, + 9, + 19, + 5,4,8,14,10,16,17, + 8,16,21,22,23, + 12, + 14, + 0, + 0,9, + 7,14,13,17,19,20,22, + 14, + 0,1,3,5,8,14,13,15,16,21,23, + 9, + 14, + 20, + 14,18, + 14,15,17,18,19, + 14,18, + 14, + 14,15, + 5,4,14,12,15,16,18,20,21,22,23, + 0, + 0, + 1,22, + 14, + 2,8,14,16, + 0,2,9,11, + 14,19, + 14, + 22, + 7,12,21, + 14, + 14, + 14, + 14, + 4,23, + 0, + 14, + 14, + 4,12,23, + 16, + 11, + 14, + 9, + 0, + 0, + 14, + 0, + 6,7,14,10,15, + 9, + 14, + 19, + 9, + 2,9, + 14, + 11,18,20, + 11, + 0, + 14,18, + 0, + 10, + 14, + 0,9, + 7,14,15,17, + 14, + 14,18,21, + 14,15, + 14, + 14, + 14, + 0,8,14,9,10,15, + 14, + 9, + 2,14, + 0,4,14, + 22, + 0, + 9,11,20, + 14, + 9, + 0, + 15, + 14, + 14,9,19, + 0, + 11, + 0,14,11,13,17,19, + 14, + 12, + 0, + 9, + 0, + 1, + 0, + 17, + 18, + 14, + 9, + 14, + 0, + 19, + 14, + 14, + 1,6,14, + 7,14, + 14, + 14, + 3,7,14,13,15,16,17,18,19, + 14,20, + 14, + 0, + 14,12, + 14,21, + 16, + 14, + 0, + 14, + 12, + 14,18,21,23, + 0,5,7,8,14,11,12,13,15,16,17,18,19,20,22,23, + 18, + 19, + 1,14,13,18, + 10, + 10, + 14, + 10,21, + 2, + 9, + 16, + 20, + 14,11,16,17, + 14, + 16, + 0,1,6,8,16,19, + 0, + 2, + 14, + 14,15, + 14, + 8,14,16, + 14,19, + 11, + 10,19, + 9,11, + 0,4,6,14,11, + 1,7,8,9,21,23, + 7,14,16, + 14,11, + 16, + 20, + 14,12, + 11, + 14, + 14, + 0,14,15, + 14,15, + 0,12,20, + 14,9,10, + 14, + 14,15, + 17, + 14, + 12,21, + 14,13,17,18, + 14, + 14, + 22, + 0,1,14,12,13,15,20,21,22, + 14,18, + 4,16,18,21, + 9, + 14,21, + 14, + 22, + 2, + 15, + 0, + 12, + 0,14, + 14, + 1,20, + 14, + 0,10,11, + 3,6,16,19, + 21,22, + 14, + 0,19, + 18, + 3,14,13,15,17,18,19,20,21,23, + 16, + 12, + 2, + 0,14, + 0,19, + 14, + 10,16, + 14, + 14, + 2,14,12,20, + 0, + 9, + 0, + 0, + 0, + 20,21, + 9, + 0,2,7,14,12,17,20,22, + 8,16, + 19, + 14, + 12,19, + 14, + 14,19, + 14, + 14,15, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14,15, + 14, + 14, + 14, + 14, + 0, + 9, + 14, + 0,10,11,16, + 0,9,10,19, + 20, + 0,9,10,11,18,19, + 14,9, + 1, + 21, + 10,16, + 22, + 14,9,10,11, + 17, + 14,16, + 18,21, + 14, + 14, + 7,18, + 14, + 1, + 16, + 16, + 14, + 15, + 14, + 14,11,15, + 14, + 20, + 15, + 15, + 7,12, + 19, + 15, + 0, + 17,22, + 1,14,13,15,18,19,22, + 14, + 17, + 14, + 14,16,20, + 18,20,23, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 2,14, + 0,5,4,14,12,16,17,19,21,23, + 1,14,15, + 0,9,12, + 1,14, + 7,14,12,15,18,20,22, + 14, + 10,13,15,16,18,21,23, + 14, + 4,15,20,21, + 19, + 7, + 15, + 0, + 5,14,19,20, + 17, + 14,20, + 15, + 0,17,22, + 1, + 0, + 3,5,4,6,7,14,13,16,17,18,19,22, + 3,5,14, + 14, + 14, + 10,16, + 1,14,18, + 0, + 4,14,18, + 9, + 0, + 14, + 20, + 2, + 3,5,16, + 2,8,14, + 2, + 14, + 9, + 3,5,4,6,7,10,12,13,16,17,18,19,21,22,23, + 14, + 14, + 11, + 7,14,10,15,16,18,22, + 14, + 3,16, + 14, + 16, + 0,14,15, + 0,9,11, + 9, + 0,7, + 14,23, + 1,14,11,15,19, + 14, + 14, + 14, + 15, + 15, + 14, + 4, + 18, + 14, + 14, + 8,10,19,20, + 17,18, + 17, + 0, + 0,9,11, + 14, + 2,3,5,7,14,17,18,19,21,22,23, + 14, + 0, + 14,12, + 1,12, + 1, + 14,12, + 14,15, + 14, + 14, + 1,18, + 0,3,7,8,14,17,18,19,23, + 7,14,15,18,19, + 19, + 14, + 2, + 0, + 14, + 8, + 14,18,22, + 14,9,11, + 0,8, + 15, + 0,6,10,13,16,18,21,23, + 0, + 14, + 3,10,16,18, + 14, + 14, + 0, + 9, + 14,13, + 0, + 14, + 14, + 14, + 14, + 14, + 14, + 0,6,14,10,12,13,15,17,18,19,20,21,23, + 20, + 2,8,11,12,13,15,17,18,19,20, + 14, + 9, + 6,8,16,17,23, + 9, + 5,6,7,14,13,15,16,17,18,21,23, + 14, + 14, + 0, + 11, + 14, + 14, + 1, + 2,14,17, + 16, + 14,10,16,18, + 14, + 14,11,18,23, + 15, + 14,15,19, + 14,20, + 12,16,20, + 0, + 14,19, + 0,19, + 2,14,16, + 9,17, + 14, + 6,16, + 14, + 0, + 14, + 0,8,9,16, + 2,14, + 9, + 0, + 2, + 20, + 0,9,11, + 14, + 14, + 14, + 14, + 7,23, + 22, + 0, + 4,14, + 0,1,8,14,9,10,11,15,16,17,19,22, + 14, + 3,10,16,18, + 16, + 14, + 12,13,16,21,23, + 12, + 15, + 9, + 15, + 16, + 0,14,15,19, + 14,21,23, + 9,11, + 9,11, + 14, + 0, + 15, + 18,21, + 14, + 14, + 14, + 14, + 14, + 16, + 14,13, + 14,13,17, + 14,15, + 14, + 14,9, + 8,14, + 14,15, + 14,9,11,22, + 0,9, + 16, + 2,14,9,15, + 14, + 14, + 14, + 14, + 0, + 14, + 15, + 0,14, + 14, + 14,15, + 14, + 14, + 7,11, + 14, + 2, + 0,14,9,10,15,19,20,22, + 8,21, + 14,15, + 14, + 14, + 0,14,10,15,16,18, + 14, + 14, + 14, + 14, + 9, + 14, + 14,18,21,23, + 14,17, + 14, + 14, + 14, + 14, + 14, + 0, + 2, + 14, + 12, + 9, + 14,12, + 14, + 8, + 14, + 2,7, + 16, + 14,21, + 14, + 14, + 15, + 6, + 9, + 9, + 1,12,18,21, + 9, + 22, + 22, + 2, + 10,22, + 14, + 14, + 14, + 14,12,20, + 14, + 12, + 9, + 17, + 4, + 0, + 14,23, + 23, + 2, + 0,8,9,10,11,20, + 5, + 2, + 14,9,13,17, + 0,9,15, + 2, + 14,16, + 16,18, + 2, + 0, + 2, + 14, + 18, + 8,17, + 2, + 0,9, + 11, + 2,14,12,13,16,17,20,21,23, + 9, + 9, + 0, + 14,23, + 16, + 2, + 14, + 0,14,15,19,22, + 14, + 15,19, + 19, + 0,2,14,12,16, + 2, + 0,1,3,5,4,6,8,14,9,10,11,12,13,15,16,17,18,19,20,21,22,23, + 19, + 12,17,19,22,23, + 14,10,16,17,18, + 14, + 0, + 0,14, + 0, + 0,14,15,19, + 7, + 7,14,13,17,19,21,23, + 1,14,13,17,20, + 14,23, + 14,16, + 14, + 3,5,7,14,13,17,18,20,23, + 16, + 14, + 4,16,21,23, + 14, + 0,19, + 0,15, + 0,14,19, + 13,17,18,21,22,23, + 1,7,14,15,16,17,18,21,22,23, + 14, + 9, + 14, + 9, + 14,10,15, + 14,20, + 2,8,14,17,19, + 14,16,18,21, + 7, + 14, + 14, + 14, + 14, + 0, + 14, + 0, + 9,11, + 8, + 14, + 14, + 14, + 14, + 0, + 16,18, + 14, + 17, + 0,4,11, + 0,14,15,18,20,21,23, + 0,2,9,11, + 9, + 11, + 18,21, + 14, + 14,11,15, + 14,16, + 14,13,15,17, + 0, + 0,4,9,11,15,20, + 9, + 11, + 17,19, + 9, + 14, + 3,14,10,13,16,17,19, + 8,14,19,22, + 14, + 0, + 14, + 14, + 14, + 0,14,13,17,19, + 2, + 14, + 14, + 9,13,21,23, + 9, + 3,5,6,8,10,13,16,17, + 0,3,5,6,7,8,10,11,13,16,17,18,19,21,22,23, + 3, + 14,20, + 2, + 3,4,18, + 14, + 14, + 15, + 10,11,15,19, + 21,22, + 14, + 14,19, + 14, + 14, + 14, + 14, + 5,14,10, + 0,1,2,14,12,20, + 14,15,17,19, + 20,22,23, + 14, + 14, + 0,14, + 14,15, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 0, + 9, + 2, + 0, + 14, + 14, + 14, + 14, + 14, + 14, + 2,9,12,20, + 15, + 0,14,19, + 14,12,20, + 0,14,11,15,22, + 14, + 14, + 14, + 14, + 14, + 14,20, + 0, + 5, + 0,7,14,9,15,18,19,22, + 14, + 14, + 14, + 14, + 0,10,16,19,22, + 3,4,6,10,13,16,17, + 3,4,14,16, + 1,12,20, + 14, + 14, + 0, + 14, + 2, + 9, + 2, + 14,21,23, + 14, + 16,18, + 14, + 7,14,17,19, + 14, + 14, + 14, + 14,12,17,19, + 14,19, + 19, + 0, + 9, + 6,18, + 18, + 14, + 14, + 1, + 13,17, + 4, + 14, + 14, + 14,12,13,16,17,21,23, + 16,17,19, + 4,10,16, + 0,2,6,7,8,14,9,15,17,18,19,20,21,22,23, + 14, + 10,16,18,23, + 7,19, + 14, + 1, + 14, + 18, + 0, + 14,18,21, + 14,15, + 14, + 1,12, + 14,11, + 14, + 14, + 14,19, + 14,9, + 3,4,7,14,10,12,16,18,20,22,23, + 3,10,16, + 0,4,6,11, + 8,10,11,16, + 3,14,10,16,18, + 14, + 14, + 14,12, + 7,14, + 5,14,11,19,20, + 1,9, + 16, + 0,14,12,21,23, + 0, + 16,17,18, + 1, + 1,3,5,4,7,8,14,13,15,16,17,18,19,21,22,23, + 1,3,5,4,8,14,10,12,15,16,17,18,22,23, + 14, + 0,6,16,18,22, + 0,2,14,15,23, + 14, + 14,15, + 20, + 0,8,14,17,20, + 4,14,17,19,23, + 2,17, + 17, + 14, + 0, + 14,15, + 14,15,19, + 15, + 14, + 9, + 7, + 14, + 3,5,6,7,14,11,15,16,17,19,20,23, + 3, + 16, + + diff --git a/doc/salome/gui/KERNEL/whxdata/whgdata0.xml b/doc/salome/gui/KERNEL/whxdata/whgdata0.xml new file mode 100755 index 000000000..0075ff8d5 --- /dev/null +++ b/doc/salome/gui/KERNEL/whxdata/whgdata0.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/salome/gui/KERNEL/whxdata/whglo.xml b/doc/salome/gui/KERNEL/whxdata/whglo.xml new file mode 100755 index 000000000..0f1cd68e5 --- /dev/null +++ b/doc/salome/gui/KERNEL/whxdata/whglo.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/doc/salome/gui/KERNEL/whxdata/whidx.xml b/doc/salome/gui/KERNEL/whxdata/whidx.xml new file mode 100755 index 000000000..ac66bb966 --- /dev/null +++ b/doc/salome/gui/KERNEL/whxdata/whidx.xml @@ -0,0 +1,4 @@ + + + + diff --git a/doc/salome/gui/KERNEL/whxdata/whtdata0.xml b/doc/salome/gui/KERNEL/whxdata/whtdata0.xml new file mode 100755 index 000000000..41b084bfa --- /dev/null +++ b/doc/salome/gui/KERNEL/whxdata/whtdata0.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/salome/gui/KERNEL/whxdata/whtoc.xml b/doc/salome/gui/KERNEL/whxdata/whtoc.xml new file mode 100755 index 000000000..a271ba7cc --- /dev/null +++ b/doc/salome/gui/KERNEL/whxdata/whtoc.xml @@ -0,0 +1,4 @@ + + + + diff --git a/resources/KERNELCatalog.xml b/resources/KERNELCatalog.xml index 4bad252ff..70151724e 100644 --- a/resources/KERNELCatalog.xml +++ b/resources/KERNELCatalog.xml @@ -16,7 +16,7 @@ Salome Other NRI - 2.2.0 + 2.2.2 GUI Neutral Context 1 @@ -27,7 +27,7 @@ SalomeTestComponent Other NRI - 2.1.0 + 2.2.2 GUI Neutral Context 1 'linux' ~ OS @@ -37,7 +37,7 @@ SALOME_TestComponentPy Other NRI - 2.1.0 + 2.2.2 GUI Neutral Context 1 'linux' ~ OS diff --git a/salome_adm/unix/SALOMEconfig.h.in b/salome_adm/unix/SALOMEconfig.h.in index e79eb7ae8..c1be35bd0 100644 --- a/salome_adm/unix/SALOMEconfig.h.in +++ b/salome_adm/unix/SALOMEconfig.h.in @@ -19,9 +19,17 @@ See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org ------------------------------------------------------------------------------------*/ +#ifndef SALOME_CONFIG_H +#define SALOME_CONFIG_H + #define DEBUG #define QUOTE(x) #x #define CORBA_CLIENT_HEADER(x) QUOTE(x@IDL_CLN_H@) #define CORBA_SERVER_HEADER(x) QUOTE(x@IDL_SRV_H@) +#ifndef @MACHINE@ + #define @MACHINE@ +#endif + +#endif diff --git a/salome_adm/unix/config_files/ac_cxx_depend_flag.m4 b/salome_adm/unix/config_files/ac_cxx_depend_flag.m4 index 9e3d4ecc9..ee49cd8a3 100644 --- a/salome_adm/unix/config_files/ac_cxx_depend_flag.m4 +++ b/salome_adm/unix/config_files/ac_cxx_depend_flag.m4 @@ -44,12 +44,14 @@ dnl on utilise donc gnu pour generer les dependances. DEPCXX=g++ DEPCXXFLAGS="-Wno-deprecated" DIFFFLAGS="-w" + MACHINE="OSF1" ;; *) DEPCC=${CC-cc} DEPCXX=${CXX-c++} DEPCXXFLAGS="\${CXXFLAGS}" DIFFFLAGS="-b -B" + MACHINE="PCLINUX" ;; esac C_DEPEND_FLAG= @@ -137,5 +139,6 @@ dnl use g++ option -MG : asume unknown file will be construct later AC_SUBST(DEPCXXFLAGS) AC_SUBST(C_DEPEND_FLAG) AC_SUBST(CXX_DEPEND_FLAG) + AC_SUBST(MACHINE) ]) ]) diff --git a/salome_adm/unix/config_files/check_cas.m4 b/salome_adm/unix/config_files/check_cas.m4 index 3b3f654f9..b27c7deac 100644 --- a/salome_adm/unix/config_files/check_cas.m4 +++ b/salome_adm/unix/config_files/check_cas.m4 @@ -113,7 +113,14 @@ dnl test c++ compiler flag for unsigned character dnl cascade headers CPPFLAGS_old="$CPPFLAGS" - CAS_CPPFLAGS="-DOCC_VERSION_MAJOR=$OCC_VERSION_MAJOR -DLIN -DLINTEL -DCSFDB -DNO_CXX_EXCEPTION -DNo_exception -DHAVE_CONFIG_H -DHAVE_LIMITS_H -DHAVE_WOK_CONFIG_H -I$CASROOT/inc" +case $host_os in + linux*) + CAS_CPPFLAGS="-DOCC_VERSION_MAJOR=$OCC_VERSION_MAJOR -DLIN -DLINTEL -DCSFDB -DNO_CXX_EXCEPTION -DNo_exception -DHAVE_CONFIG_H -DHAVE_LIMITS_H -DHAVE_WOK_CONFIG_H -I$CASROOT/inc" + ;; + osf*) + CAS_CPPFLAGS="-DOCC_VERSION_MAJOR=$OCC_VERSION_MAJOR -DLIN -DLINTEL -DCSFDB -DNo_exception -DHAVE_CONFIG_H -DHAVE_LIMITS_H -DHAVE_WOK_CONFIG_H -I$CASROOT/inc" + ;; +esac CPPFLAGS="$CPPFLAGS $CAS_CPPFLAGS" echo diff --git a/salome_adm/unix/config_files/check_med2.m4 b/salome_adm/unix/config_files/check_med2.m4 index 6e8192b44..3b8fd9f8d 100644 --- a/salome_adm/unix/config_files/check_med2.m4 +++ b/salome_adm/unix/config_files/check_med2.m4 @@ -24,6 +24,7 @@ AC_DEFUN([CHECK_MED2],[ AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_CPP])dnl AC_REQUIRE([CHECK_HDF5])dnl +AC_REQUIRE([AC_DEPEND_FLAG])dnl AC_CHECKING(for MED2) @@ -41,57 +42,38 @@ MED2_INCLUDES="" MED2_LIBS="" MED2_MT_LIBS="" -med2_ok=no +LOCAL_INCLUDES="" +LOCAL_LIBS="" -LOCAL_INCLUDES="$HDF5_INCLUDES" -LOCAL_LIBS="-lmed $HDF5_LIBS" +med2_ok=no +dnl check, if there is MED library if test -z $MED2HOME then AC_MSG_WARN(undefined MED2HOME variable which specify med2 installation directory) else - LOCAL_INCLUDES="$LOCAL_INCLUDES -I$MED2HOME/include" - LOCAL_LIBS="-L$MED2HOME/lib $LOCAL_LIBS" + LOCAL_INCLUDES="$HDF5_INCLUDES -I$MED2HOME/include" + LOCAL_LIBS="-L$MED2HOME/lib -lmed $HDF5_LIBS" fi dnl check med2 header - CPPFLAGS_old="$CPPFLAGS" -dnl we must test system : linux = -DPCLINUX -dnl we must test system : Alpha-OSF = -DOSF1 -case $host_os in - linux*) - CPPFLAGS="$CPPFLAGS -DPCLINUX $LOCAL_INCLUDES" - ;; - osf*) - CPPFLAGS="$CPPFLAGS -DOSF1 $LOCAL_INCLUDES" - ;; -esac +CPPFLAGS="$CPPFLAGS -D$MACHINE $LOCAL_INCLUDES" AC_CHECK_HEADER(med.h,med2_ok=yes ,med2_ok=no) CPPFLAGS="$CPPFLAGS_old" +dnl check med2 library if test "x$med2_ok" = "xyes" then - -dnl check med2 library - LIBS_old="$LIBS" LIBS="$LIBS $LOCAL_LIBS" AC_CHECK_LIB(med,MEDouvrir,med2_ok=yes,med2_ok=no) LIBS="$LIBS_old" - fi if test "x$med2_ok" = "xyes" then -case $host_os in - linux*) - MED2_INCLUDES="-DPCLINUX $LOCAL_INCLUDES" - ;; - osf*) - MED2_INCLUDES="-DOSF1 $LOCAL_INCLUDES" - ;; -esac + MED2_INCLUDES="-D$MACHINE $LOCAL_INCLUDES" MED2_LIBS="$LOCAL_LIBS" MED2_MT_LIBS="$LOCAL_LIBS" fi diff --git a/salome_adm/unix/config_files/check_pyqt.m4 b/salome_adm/unix/config_files/check_pyqt.m4 index cb99775f8..9374319a6 100644 --- a/salome_adm/unix/config_files/check_pyqt.m4 +++ b/salome_adm/unix/config_files/check_pyqt.m4 @@ -56,17 +56,17 @@ fi AC_CHECK_FILE("$PYUIC",pyqt_ok=yes,pyqt_ok=no) -if test "x$pyqt_ok" = xyes ; then - AC_CHECK_FILES("$PYQTLIB/qt.py",pyqt_ok=yes,pyqt_ok=no) -fi +dnl if test "x$pyqt_ok" = xyes ; then +dnl AC_CHECK_FILES("$PYQTLIB/qt.py",pyqt_ok=yes,pyqt_ok=no) +dnl fi -if test "x$pyqt_ok" = xno ; then - AC_CHECK_FILES("$PYQTLIB/qt/qt.py",pyqt_ok=yes,pyqt_ok=no) -fi +dnl if test "x$pyqt_ok" = xno ; then +dnl AC_CHECK_FILES("$PYQTLIB/qt/qt.py",pyqt_ok=yes,pyqt_ok=no) +dnl fi -if test "x$pyqt_ok" = xyes ; then - AC_CHECK_FILE("$PYQTLIB/libqtcmodule.so",pyqt_ok=yes,pyqt_ok=no) -fi +dnl if test "x$pyqt_ok" = xyes ; then +dnl AC_CHECK_FILE("$PYQTLIB/libqtcmodule.so",pyqt_ok=yes,pyqt_ok=no) +dnl fi if test "x$pyqt_ok" = xyes ; then AC_CHECK_FILES("$PYQT_SIPS/qtmod.sip",pyqt_ok=yes,pyqt_ok=no) @@ -78,7 +78,7 @@ fi if test "x$pyqt_ok" = xyes ; then PYQT_ROOT=$PYQTDIR PYQT_INCLUDES="-I$PYQT_SIPS" - PYQT_LIBS="-L$PYQTLIB -lqtcmodule" + PYQT_LIBS="-L$PYQTLIB " AC_SUBST(PYQT_ROOT) AC_SUBST(PYQT_INCLUDES) AC_SUBST(PYQT_LIBS) diff --git a/salome_adm/unix/config_files/check_qt.m4 b/salome_adm/unix/config_files/check_qt.m4 index b27de2779..b1557decd 100644 --- a/salome_adm/unix/config_files/check_qt.m4 +++ b/salome_adm/unix/config_files/check_qt.m4 @@ -75,6 +75,25 @@ then fi fi +version=`moc -v > mocversion 2>&1;cut -c40-44 mocversion;rm -rf mocversion` +case "$version" in + 3.3.3) + QT_VERS=v3_3_3 + AC_MSG_RESULT(QT3.3.3 install detected) + qt_ok=yes;; + 3.0.5) + AC_MSG_RESULT(QT3.0.5 install detected) + QT_VERS=v3_0_5 + qt_ok=yes;; + *) + AC_MSG_RESULT(qt version $version not supported) + qt_ok=no + QT_VERS=no ;; +esac + +AC_SUBST(QT_VERS) +AC_MSG_RESULT(qt version $QT_VERS ) + AC_SUBST(QTDIR) QT_ROOT=$QTDIR @@ -90,14 +109,31 @@ then AC_MSG_CHECKING(include of qt headers) - if test "x$qt_ok" = "xno" + if test "x$qt_ok" = "xyes" then - AC_MSG_RESULT(qt headers not found, or too old qt version, in $QTDIR/include) - AC_MSG_RESULT(QTDIR environment variable may be wrong) - else AC_MSG_RESULT(yes) QT_INCLUDES="-I${QT_ROOT}/include -DQT_THREAD_SUPPORT" QT_MT_INCLUDES="-I${QT_ROOT}/include -DQT_THREAD_SUPPORT" + else + CPPFLAGS_old=$CPPFLAGS + CPPFLAGS="$CPPFLAGS -I$QTDIR/include/qt3" + + AC_LANG_CPLUSPLUS + AC_CHECK_HEADER(qapp.h,qt_ok=yes ,qt_ok=no) + + CPPFLAGS=$CPPFLAGS_old + + AC_MSG_CHECKING(include of qt headers) + + if test "x$qt_ok" = "xno" + then + AC_MSG_RESULT(qt headers not found, or too old qt version, in $QTDIR/include) + AC_MSG_RESULT(QTDIR environment variable may be wrong) + else + AC_MSG_RESULT(yes) + QT_INCLUDES="-I${QT_ROOT}/include/qt3 -DQT_THREAD_SUPPORT" + QT_MT_INCLUDES="-I${QT_ROOT}/include/qt3 -DQT_THREAD_SUPPORT" + fi fi fi @@ -108,7 +144,7 @@ then LIBS="$LIBS -L$QTDIR/lib -lqt-mt $OGL_LIBS" CXXFLAGS_old=$CXXFLAGS - CXXFLAGS="$CXXFLAGS -I$QTDIR/include" + CXXFLAGS="$CXXFLAGS $QT_MT_INCLUDES" AC_CACHE_VAL(salome_cv_lib_qt,[ AC_TRY_LINK( @@ -143,6 +179,7 @@ AC_SUBST(QT_ROOT) AC_SUBST(QT_INCLUDES) AC_SUBST(QT_LIBS) AC_SUBST(QT_MT_LIBS) +AC_SUBST(QT_VERS) AC_LANG_RESTORE diff --git a/salome_adm/unix/config_files/check_qwt.m4 b/salome_adm/unix/config_files/check_qwt.m4 index 4e541d70d..21b15fa3a 100644 --- a/salome_adm/unix/config_files/check_qwt.m4 +++ b/salome_adm/unix/config_files/check_qwt.m4 @@ -22,18 +22,24 @@ AC_ARG_WITH(qwt_inc, ]) if test -z $QWTHOME; then + AC_MSG_RESULT(QWTHOME not defined) exits_ok=no AC_CHECK_FILE("/usr/local/lib/libqwt.so",exits_ok=yes,exits_ok=no) if test "x$exits_ok" = "xyes"; then QWTHOME="/usr/local/lib" + AC_MSG_RESULT(libqwt.so detected in /usr/local/lib) if test -z $QWT_INCLUDES; then QWT_INCLUDES="/usr/local/include/qwt" fi else - QWTHOME="/usr/lib" - if test -z $QWT_INCLUDES; then - QWT_INCLUDES="/usr/include/qwt" - fi + AC_CHECK_FILE("/usr/lib/libqwt.so",exits_ok=yes,exits_ok=no) + if test "x$exits_ok" = "xyes"; then + QWTHOME="/usr/lib" + AC_MSG_RESULT(libqwt.so detected in /usr/lib) + if test -z $QWT_INCLUDES; then + QWT_INCLUDES="/usr/include/qwt" + fi + fi fi else if test -z $QWT_INCLUDES; then @@ -50,7 +56,8 @@ else AC_LANG_CPLUSPLUS CPPFLAGS_old=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$QWT_INCLUDES" - CPPFLAGS="$CPPFLAGS -I$QTDIR/include" + CPPFLAGS="$CPPFLAGS $QT_INCLUDES" +# CPPFLAGS="$CPPFLAGS -I$QTDIR/include" AC_CHECK_HEADER(qwt.h,qwt_ok=yes,qwt_ok=no) @@ -70,7 +77,8 @@ then LIBS="$LIBS -L$QTDIR/lib -lqt-mt -L$QWTHOME/lib -lqwt" CXXFLAGS_old=$CXXFLAGS - CXXFLAGS="$CXXFLAGS -I$QTDIR/include -I$QWT_INCLUDES" + CXXFLAGS="$CXXFLAGS $QT_INCLUDES -I$QWT_INCLUDES" +# CXXFLAGS="$CXXFLAGS -I$QTDIR/include -I$QWT_INCLUDES" AC_CACHE_VAL(salome_cv_lib_qwt,[ AC_TRY_LINK( diff --git a/salome_adm/unix/config_files/check_sip.m4 b/salome_adm/unix/config_files/check_sip.m4 index 84c2beaf7..84d35f629 100644 --- a/salome_adm/unix/config_files/check_sip.m4 +++ b/salome_adm/unix/config_files/check_sip.m4 @@ -38,6 +38,8 @@ else SIP_VERS=new ;; 3.10*) SIP_VERS=new2 ;; + 4.1*) + SIP_VERS=v4_1 ;; *) AC_MSG_RESULT(sip version $version not supported) SIP_VERS=no ;; @@ -83,6 +85,17 @@ else AC_CHECK_FILE($PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages/libsip.so,sip_ok=$sip_ok,sip_ok=no) SIP_LIBS="-L${PYTHON_PREFIX}/lib/python${PYTHON_VERSION}/site-packages -lsip" fi + + if test "x$SIP_VERS" = "xv4_1" + then + dnl 4.1 install : includes and libs are in python install + AC_MSG_RESULT(4.1 install detected) + sip_ok=yes + AC_CHECK_FILE($PYTHON_PREFIX/include/python$PYTHON_VERSION/sip.h,sip_ok=$sip_ok,sip_ok=no) + SIP_INCLUDES="${PYTHON_INCLUDES}" + AC_CHECK_FILE($PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages/sip.so,sip_ok=$sip_ok,sip_ok=no) + SIP_LIBS="${PYTHON_PREFIX}/lib/python${PYTHON_VERSION}/site-packages/sip.so" + fi fi AC_SUBST(SIP) diff --git a/salome_adm/unix/make_commence.in b/salome_adm/unix/make_commence.in index 620cfd9ff..faf3e9a0e 100644 --- a/salome_adm/unix/make_commence.in +++ b/salome_adm/unix/make_commence.in @@ -81,6 +81,7 @@ QT_MT_LIBS = @QT_MT_LIBS@ MOC = @MOC@ UIC = @UIC@ +QT_VERS = @QT_VERS@ #QWT @@ -192,6 +193,7 @@ CXXFLAGS+= $(CORBA_CXXFLAGS) # add corba libs when link salome application ! #LDFLAGS+= $(CORBA_LIBS) LIBS+=$(CORBA_LIBS) +LIBSFORBIN+=$(CORBA_LIBS) DOXYGEN = @DOXYGEN@ diff --git a/src/Container/Container_i.cxx b/src/Container/Container_i.cxx index b65bf13bd..2a4257217 100644 --- a/src/Container/Container_i.cxx +++ b/src/Container/Container_i.cxx @@ -332,8 +332,8 @@ void SigIntHandler(int what , siginfo_t * siginfo , // Get the PID of the Container -long Engines_Container_i::getPID() { - return (long)getpid(); +CORBA::Long Engines_Container_i::getPID() { + return (CORBA::Long)getpid(); } // Get the hostName of the Container diff --git a/src/Container/Makefile.in b/src/Container/Makefile.in index 1ed861ed0..fa963603b 100644 --- a/src/Container/Makefile.in +++ b/src/Container/Makefile.in @@ -49,7 +49,7 @@ LIB_SERVER_IDL = SALOME_Registry.idl SALOME_Component.idl SALOME_ContainerManage LIB_CLIENT_IDL = # Executables targets -BIN = SALOME_Container +BIN = SALOME_Container SALOME_ContainerManagerServer BIN_SRC = SALOME_Container_SignalsHandler.cxx BIN_SERVER_IDL = SALOME_Component.idl SALOME_ContainerManager.idl diff --git a/src/Container/SALOME_Container.cxx b/src/Container/SALOME_Container.cxx index dfd501e9f..be08e2197 100644 --- a/src/Container/SALOME_Container.cxx +++ b/src/Container/SALOME_Container.cxx @@ -112,8 +112,8 @@ int main(int argc, char* argv[]) theObj = orb->resolve_initial_references("NameService"); if (!CORBA::is_nil(theObj)) inc = CosNaming::NamingContext::_narrow(theObj); - }catch(CORBA::COMM_FAILURE&){ - MESSAGE( "Container: CORBA::COMM_FAILURE: Unable to contact the Naming Service" ); + }catch(CORBA::SystemException&){ + MESSAGE( "Container: CORBA::SystemException: Unable to contact the Naming Service" ); } if(!CORBA::is_nil(inc)){ MESSAGE( "Container: Naming Service was found" ); diff --git a/src/Container/SALOME_ContainerManager.cxx b/src/Container/SALOME_ContainerManager.cxx index d5fad0ae9..77cebf354 100644 --- a/src/Container/SALOME_ContainerManager.cxx +++ b/src/Container/SALOME_ContainerManager.cxx @@ -15,8 +15,16 @@ SALOME_ContainerManager::SALOME_ContainerManager(CORBA::ORB_ptr orb) { _NS=new SALOME_NamingService(orb); PortableServer::POA_var root_poa=PortableServer::POA::_the_root_poa(); - PortableServer::ObjectId_var id=root_poa->activate_object(this); - CORBA::Object_var obj=root_poa->id_to_reference(id); + PortableServer::POAManager_var pman = root_poa->the_POAManager(); + PortableServer::POA_var my_poa; + CORBA::PolicyList policies; + policies.length(1); + PortableServer::ThreadPolicy_var threadPol=root_poa->create_thread_policy(PortableServer::SINGLE_THREAD_MODEL); + policies[0]=PortableServer::ThreadPolicy::_duplicate(threadPol); + my_poa=root_poa->create_POA("SThreadPOA",pman,policies); + threadPol->destroy(); + PortableServer::ObjectId_var id=my_poa->activate_object(this); + CORBA::Object_var obj=my_poa->id_to_reference(id); Engines::ContainerManager_var refContMan = Engines::ContainerManager::_narrow(obj); _NS->Register(refContMan,_ContainerManagerNameInNS); } diff --git a/src/Container/SALOME_ContainerManagerServer.cxx b/src/Container/SALOME_ContainerManagerServer.cxx new file mode 100644 index 000000000..77297a412 --- /dev/null +++ b/src/Container/SALOME_ContainerManagerServer.cxx @@ -0,0 +1,39 @@ +#include "SALOME_ContainerManager.hxx" +#include "utilities.h" + +int main(int argc, char* argv[]) +{ + PortableServer::POA_var root_poa; + PortableServer::POAManager_var pman; + CORBA::Object_var obj; + + CORBA::ORB_var orb = CORBA::ORB_init( argc , argv ) ; + try{ + obj = orb->resolve_initial_references("RootPOA"); + if(!CORBA::is_nil(obj)) + root_poa = PortableServer::POA::_narrow(obj); + if(!CORBA::is_nil(root_poa)) + pman = root_poa->the_POAManager(); + } + catch(CORBA::COMM_FAILURE&){ + MESSAGE( "Container: CORBA::COMM_FAILURE: Unable to contact the Naming Service" ); + } + try{ + SALOME_ContainerManager *cmServ=new SALOME_ContainerManager(orb); + pman->activate(); + orb->run(); + }catch(CORBA::SystemException&){ + MESSAGE("Caught CORBA::SystemException."); + }catch(PortableServer::POA::WrongPolicy&){ + MESSAGE("Caught CORBA::WrongPolicyException."); + }catch(PortableServer::POA::ServantAlreadyActive&){ + MESSAGE("Caught CORBA::ServantAlreadyActiveException"); + }catch(CORBA::Exception&){ + MESSAGE("Caught CORBA::Exception."); + }catch(std::exception& exc){ + MESSAGE("Caught std::exception - "<resolve_initial_references("NameService"); if (!CORBA::is_nil(theObj)) inc = CosNaming::NamingContext::_narrow(theObj);} - catch( CORBA::COMM_FAILURE& ) + catch( CORBA::SystemException& ) { - MESSAGE( "Data Type Catalog: CORBA::COMM_FAILURE: Unable to contact the Naming Service" ); + MESSAGE( "Data Type Catalog: CORBA::SystemException: Unable to contact the Naming Service" ); } if(!CORBA::is_nil(inc)) { diff --git a/src/LifeCycleCORBA/TestLifeCycleCORBA.cxx b/src/LifeCycleCORBA/TestLifeCycleCORBA.cxx index 49e3b28b0..312cbd211 100644 --- a/src/LifeCycleCORBA/TestLifeCycleCORBA.cxx +++ b/src/LifeCycleCORBA/TestLifeCycleCORBA.cxx @@ -111,7 +111,7 @@ int main (int argc, char * argv[]) cout << m4->instanceName() << endl; } - catch(CORBA::COMM_FAILURE& ex) + catch(CORBA::SystemException& ex) { INFOS("Caught system exception COMM_FAILURE -- unable to contact the object."); } diff --git a/src/Loader/InquireServersQThread.cxx b/src/Loader/InquireServersQThread.cxx index a293e4766..a26a1dea2 100644 --- a/src/Loader/InquireServersQThread.cxx +++ b/src/Loader/InquireServersQThread.cxx @@ -312,9 +312,9 @@ bool InquireServersQThread::AskServer(int iteration, QString ** errMessage) IsPassed = true; break; } - catch(CORBA::COMM_FAILURE&) + catch(CORBA::SystemException&) { - MESSAGE("CORBA::COMM_FAILURE: unable to contact the naming service"); + MESSAGE("CORBA::SystemException: unable to contact the naming service"); } catch(...) { @@ -399,7 +399,7 @@ bool InquireServersQThread::pingServer(int iteration, QString& errMessage) break; case 4: { - CORBA::Object_var obj = NS.Resolve("Kernel/ModulCatalog"); + CORBA::Object_var obj = NS.Resolve("/Kernel/ModulCatalog"); SALOME_ModuleCatalog::ModuleCatalog_var catalog = SALOME_ModuleCatalog::ModuleCatalog::_narrow(obj) ; if (!CORBA::is_nil(catalog)) { @@ -413,7 +413,7 @@ bool InquireServersQThread::pingServer(int iteration, QString& errMessage) break; case 5: { - CORBA::Object_var obj = NS.Resolve("Kernel/Session"); + CORBA::Object_var obj = NS.Resolve("/Kernel/Session"); SALOME::Session_var session = SALOME::Session::_narrow(obj) ; if (!CORBA::is_nil(session)) { diff --git a/src/Logger/SALOME_Trace.cxx b/src/Logger/SALOME_Trace.cxx index 1a33333eb..705f066bd 100644 --- a/src/Logger/SALOME_Trace.cxx +++ b/src/Logger/SALOME_Trace.cxx @@ -62,7 +62,7 @@ int SALOME_Trace::Initialize(CORBA::ORB_ptr theOrb) { if (!CORBA::is_nil(theObj)) inc = CosNaming::NamingContext::_narrow(theObj); if (!CORBA::is_nil(inc)) break; - } catch( CORBA::COMM_FAILURE& ) { + } catch( CORBA::SystemException& ) { } catch (...) { } } diff --git a/src/Logger/SALOME_Trace.py b/src/Logger/SALOME_Trace.py index fd507c7c7..2b88171d6 100644 --- a/src/Logger/SALOME_Trace.py +++ b/src/Logger/SALOME_Trace.py @@ -41,7 +41,7 @@ class SALOME_Trace : except CosNaming.NamingContext.NotFound, e : if steps == 1: print "Caught exception: Naming Service can't found Logger" - except CORBA.COMM_FAILURE, e: + except (CORBA.TRANSIENT,CORBA.OBJECT_NOT_EXIST,CORBA.COMM_FAILURE): if steps == 1: print "Caught CORBA::SystemException CommFailure" except CORBA.SystemException, e: if steps == 1: print "Caught CORBA::SystemException." diff --git a/src/MEDWrapper/Base/MED_Common.hxx b/src/MEDWrapper/Base/MED_Common.hxx index c2ae42522..a4d5af9f3 100644 --- a/src/MEDWrapper/Base/MED_Common.hxx +++ b/src/MEDWrapper/Base/MED_Common.hxx @@ -42,6 +42,8 @@ extern "C"{ #include +#include "SALOMEconfig.h" + namespace MED{ enum EVersion {eVUnknown = -1, eV2_1, eV2_2}; @@ -148,8 +150,12 @@ namespace MED{ typedef enum {eFAUX, eVRAI} EBooleen ; typedef double TFloat; +#if defined(SUN4SOL2) || defined(PCLINUX) || defined(OSF1_32) || defined(IRIX64_32) || defined(RS6000) || defined(HP9000) typedef int TInt; - +#endif +#if defined(IRIX64) || defined(OSF1) + typedef long TInt; +#endif typedef hid_t TIdt; typedef herr_t TErr; diff --git a/src/MEDWrapper/V2_1/MED_V2_1_Wrapper.cxx b/src/MEDWrapper/V2_1/MED_V2_1_Wrapper.cxx index 9dc64affc..04afa18fc 100644 --- a/src/MEDWrapper/V2_1/MED_V2_1_Wrapper.cxx +++ b/src/MEDWrapper/V2_1/MED_V2_1_Wrapper.cxx @@ -135,7 +135,7 @@ namespace MED{ TErr aRet = MEDmaaInfo(myFile->Id(), theMeshId, &theInfo.myName[0], - &theInfo.myDim); + (med_2_1::med_int *)&theInfo.myDim); if(theErr) *theErr = aRet; else if(aRet < 0) @@ -243,13 +243,13 @@ namespace MED{ &aMeshInfo.myName[0], theFamId, &theInfo.myName[0], - &theInfo.myId, - &theInfo.myAttrId[0], - &theInfo.myAttrVal[0], + (med_2_1::med_int *)&theInfo.myId, + (med_2_1::med_int *)&theInfo.myAttrId[0], + (med_2_1::med_int *)&theInfo.myAttrVal[0], &theInfo.myAttrDesc[0], - &theInfo.myNbAttr, + (med_2_1::med_int *)&theInfo.myNbAttr, &theInfo.myGroupNames[0], - &theInfo.myNbGroup); + (med_2_1::med_int *)&theInfo.myNbGroup); if(theErr) *theErr = aRet; @@ -278,8 +278,8 @@ namespace MED{ &aMeshInfo.myName[0], &anInfo.myName[0], anInfo.myId, - &anInfo.myAttrId[0], - &anInfo.myAttrVal[0], + (med_2_1::med_int *)&anInfo.myAttrId[0], + (med_2_1::med_int *)&anInfo.myAttrVal[0], &anInfo.myAttrDesc[0], anInfo.myNbAttr, &anInfo.myGroupNames[0], @@ -341,9 +341,9 @@ namespace MED{ MED::TMeshInfo& aMeshInfo = *theInfo.myMeshInfo; - med_repere& aRepere = static_cast(theInfo.mySystem); - med_booleen& anIsElemNames = static_cast(theInfo.myIsElemNames); - med_booleen& anIsElemNum = static_cast(theInfo.myIsElemNum); + med_repere& aRepere = (med_repere&)(theInfo.mySystem); + med_booleen& anIsElemNames = (med_booleen&)(theInfo.myIsElemNames); + med_booleen& anIsElemNum = (med_booleen&)(theInfo.myIsElemNum); TErr aRet = MEDnoeudsLire(myFile->Id(), &aMeshInfo.myName[0], @@ -355,9 +355,9 @@ namespace MED{ &theInfo.myCoordUnits[0], &theInfo.myElemNames[0], &anIsElemNames, - &theInfo.myElemNum[0], + (med_2_1::med_int *)&theInfo.myElemNum[0], &anIsElemNum, - &theInfo.myFamNum[0], + (med_2_1::med_int *)&theInfo.myFamNum[0], theInfo.myNbElem); ADDMSG(MYDEBUG," myDim="<(theInfo); MED::TMeshInfo& aMeshInfo = *anInfo.myMeshInfo; - med_repere& aRepere = static_cast(theInfo.mySystem); - med_booleen& anIsElemNames = static_cast(theInfo.myIsElemNames); - med_booleen& anIsElemNum = static_cast(theInfo.myIsElemNum); + med_repere& aRepere = (med_repere&)(theInfo.mySystem); + med_booleen& anIsElemNames = (med_booleen&)(theInfo.myIsElemNames); + med_booleen& anIsElemNum = (med_booleen&)(theInfo.myIsElemNum); TErr aRet = MEDnoeudsEcr(myFile->Id(), &aMeshInfo.myName[0], @@ -395,9 +395,9 @@ namespace MED{ &anInfo.myCoordUnits[0], &anInfo.myElemNames[0], anIsElemNames, - &anInfo.myElemNum[0], + (med_2_1::med_int *)&anInfo.myElemNum[0], anIsElemNum, - &anInfo.myFamNum[0], + (med_2_1::med_int *)&anInfo.myFamNum[0], anInfo.myNbElem, MED_REMP); if(theErr) @@ -489,22 +489,22 @@ namespace MED{ MED::TMeshInfo& aMeshInfo = *theInfo.myMeshInfo; TInt aNbElem = theInfo.myElemNum.size(); - med_booleen& anIsElemNames = static_cast(theInfo.myIsElemNames); - med_booleen& anIsElemNum = static_cast(theInfo.myIsElemNum); - med_entite_maillage& anEntity = static_cast(theInfo.myTEntity); - med_geometrie_element& aGeom = static_cast(theInfo.myTGeom); - med_connectivite& aConn = static_cast(theInfo.myTConn); + med_booleen& anIsElemNames = (med_booleen&)(theInfo.myIsElemNames); + med_booleen& anIsElemNum = (med_booleen&)(theInfo.myIsElemNum); + med_entite_maillage& anEntity = (med_entite_maillage&)(theInfo.myTEntity); + med_geometrie_element& aGeom = (med_geometrie_element&)(theInfo.myTGeom); + med_connectivite& aConn = (med_connectivite&)(theInfo.myTConn); TErr aRet = MEDelementsLire(myFile->Id(), &aMeshInfo.myName[0], aMeshInfo.myDim, - &theInfo.myConn[0], + (med_2_1::med_int *)&theInfo.myConn[0], MED_FULL_INTERLACE, &theInfo.myElemNames[0], &anIsElemNames, - &theInfo.myElemNum[0], + (med_2_1::med_int *)&theInfo.myElemNum[0], &anIsElemNum, - &theInfo.myFamNum[0], + (med_2_1::med_int *)&theInfo.myFamNum[0], aNbElem, anEntity, aGeom, @@ -529,22 +529,22 @@ namespace MED{ MED::TCellInfo& anInfo = const_cast(theInfo); MED::TMeshInfo& aMeshInfo = *anInfo.myMeshInfo; - med_booleen& anIsElemNames = static_cast(theInfo.myIsElemNames); - med_booleen& anIsElemNum = static_cast(theInfo.myIsElemNum); - med_entite_maillage& anEntity = static_cast(theInfo.myTEntity); - med_geometrie_element& aGeom = static_cast(theInfo.myTGeom); - med_connectivite& aConn = static_cast(theInfo.myTConn); + med_booleen& anIsElemNames = (med_booleen&)(theInfo.myIsElemNames); + med_booleen& anIsElemNum = (med_booleen&)(theInfo.myIsElemNum); + med_entite_maillage& anEntity = (med_entite_maillage&)(theInfo.myTEntity); + med_geometrie_element& aGeom = (med_geometrie_element&)(theInfo.myTGeom); + med_connectivite& aConn = (med_connectivite&)(theInfo.myTConn); TErr aRet = MEDelementsEcr(myFile->Id(), &aMeshInfo.myName[0], aMeshInfo.myDim, - &anInfo.myConn[0], + (med_2_1::med_int *)&anInfo.myConn[0], MED_FULL_INTERLACE, &anInfo.myElemNames[0], anIsElemNames, - &anInfo.myElemNum[0], + (med_2_1::med_int *)&anInfo.myElemNum[0], anIsElemNum, - &anInfo.myFamNum[0], + (med_2_1::med_int *)&anInfo.myFamNum[0], anInfo.myNbElem, anEntity, aGeom, @@ -601,7 +601,7 @@ namespace MED{ if(theErr && *theErr < 0) return; - med_type_champ& aType = static_cast(theInfo.myType); + med_type_champ& aType = (med_type_champ&)(theInfo.myType); TErr aRet = MEDchampInfo(myFile->Id(), theFieldId, @@ -628,7 +628,7 @@ namespace MED{ MED::TFieldInfo& anInfo = const_cast(theInfo); - med_type_champ& aType = static_cast(theInfo.myType); + med_type_champ& aType = (med_type_champ&)(theInfo.myType); TErr aRet = MEDchampCr(myFile->Id(), &anInfo.myName[0], @@ -685,11 +685,11 @@ namespace MED{ MED::TFieldInfo& anInfo = const_cast(theInfo); TEntityInfo::const_iterator anIter = theEntityInfo.begin(); for(; anIter != theEntityInfo.end(); anIter++){ - const med_entite_maillage& anEntity = static_cast(anIter->first); + const med_entite_maillage& anEntity = (const med_entite_maillage&)(anIter->first); const TGeom& aTGeom = anIter->second; TGeom::const_iterator anGeomIter = aTGeom.begin(); for(; anGeomIter != aTGeom.end(); anGeomIter++){ - const med_geometrie_element& aGeom = static_cast(anGeomIter->first); + const med_geometrie_element& aGeom = (const med_geometrie_element&)(anGeomIter->first); aNbTimeStamps = MEDnPasdetemps(myFile->Id(),&anInfo.myName[0],anEntity,aGeom); if(aNbTimeStamps){ theEntity = EEntiteMaillage(anEntity); @@ -722,10 +722,10 @@ namespace MED{ MED::TFieldInfo& aFieldInfo = *theInfo.myFieldInfo; MED::TMeshInfo& aMeshInfo = *aFieldInfo.myMeshInfo; - med_entite_maillage& anEntity = static_cast(theInfo.myEntity); + med_entite_maillage& anEntity = (med_entite_maillage&)(theInfo.myEntity); TGeom::iterator anIter = aTGeom.begin(); - med_geometrie_element& aGeom = static_cast(anIter->first); + med_geometrie_element& aGeom = (med_geometrie_element&)(anIter->first); TErr aRet = MEDpasdetempsInfo(myFile->Id(), &aFieldInfo.myName[0], @@ -733,11 +733,11 @@ namespace MED{ aGeom, theTimeStampId, &aMeshInfo.myName[0], - &theInfo.myNbGauss, - &theInfo.myNumDt, + (med_2_1::med_int *)&theInfo.myNbGauss, + (med_2_1::med_int *)&theInfo.myNumDt, &theInfo.myUnitDt[0], &theInfo.myDt, - &theInfo.myNumOrd); + (med_2_1::med_int *)&theInfo.myNumOrd); if(theErr) *theErr = aRet; @@ -764,11 +764,11 @@ namespace MED{ MED::TFieldInfo& aFieldInfo = *aTimeStampInfo.myFieldInfo; MED::TMeshInfo& aMeshInfo = *aFieldInfo.myMeshInfo; - med_entite_maillage& anEntity = static_cast(aTimeStampInfo.myEntity); + med_entite_maillage& anEntity = (med_entite_maillage&)(aTimeStampInfo.myEntity); TGeom& aTGeom = aTimeStampInfo.myGeom; TGeom::iterator anIter = aTGeom.begin(); for(; anIter != aTGeom.end(); anIter++){ - med_geometrie_element& aGeom = static_cast(anIter->first); + med_geometrie_element& aGeom = (med_geometrie_element&)(anIter->first); TInt aNbVal = MEDnVal(anId, &aFieldInfo.myName[0], anEntity, @@ -866,10 +866,10 @@ namespace MED{ MED::TMeshInfo& aMeshInfo = *aFieldInfo.myMeshInfo; MED::TMeshValue& aMeshValue = aVal.myMeshValue; - med_entite_maillage& anEntity = static_cast(aTimeStampInfo.myEntity); + med_entite_maillage& anEntity = (med_entite_maillage&)(aTimeStampInfo.myEntity); TMeshValue::iterator anIter = aMeshValue.begin(); for(; anIter != aMeshValue.end(); anIter++){ - med_geometrie_element& aGeom = static_cast(anIter->first); + med_geometrie_element& aGeom = (med_geometrie_element&)(anIter->first); TValue& aValue = aVal.myMeshValue[EGeometrieElement(aGeom)]; med_int iEnd = aValue.size(); med_int aNbVal = iEnd / aFieldInfo.myNbComp; diff --git a/src/MEDWrapper/V2_1/MEDdatasetNumEcrire.cxx b/src/MEDWrapper/V2_1/MEDdatasetNumEcrire.cxx index 85fb2a7b2..846ea206a 100644 --- a/src/MEDWrapper/V2_1/MEDdatasetNumEcrire.cxx +++ b/src/MEDWrapper/V2_1/MEDdatasetNumEcrire.cxx @@ -18,6 +18,7 @@ #include "med.hxx" #include "med_outils.hxx" +#include /* * - Nom de la fonction : _MEDdatasetNumEcrire diff --git a/src/MEDWrapper/V2_1/MEDdatasetNumLire.cxx b/src/MEDWrapper/V2_1/MEDdatasetNumLire.cxx index 8195e36a7..8eef19f6c 100644 --- a/src/MEDWrapper/V2_1/MEDdatasetNumLire.cxx +++ b/src/MEDWrapper/V2_1/MEDdatasetNumLire.cxx @@ -18,6 +18,7 @@ #include "med.hxx" #include "med_outils.hxx" +#include /* * - Nom de la fonction : _MEDdatasetNumLire diff --git a/src/MEDWrapper/V2_1/Makefile.in b/src/MEDWrapper/V2_1/Makefile.in index 3344a7b1e..778b27267 100644 --- a/src/MEDWrapper/V2_1/Makefile.in +++ b/src/MEDWrapper/V2_1/Makefile.in @@ -161,7 +161,7 @@ EXPORT_HEADERS = \ BIN = mdump_V2_1 test1_V2_1 BIN_SRC = -CPPFLAGS+= $(BOOST_CPPFLAGS) $(HDF5_INCLUDES) -DPCLINUX +CPPFLAGS+= -D@MACHINE@ $(BOOST_CPPFLAGS) $(HDF5_INCLUDES) LDFLAGS+= $(HDF5_LIBS) -lMEDWrapperBase diff --git a/src/MEDWrapper/V2_2/MED_V2_2_Wrapper.cxx b/src/MEDWrapper/V2_2/MED_V2_2_Wrapper.cxx index e744c183f..179bfa45c 100644 --- a/src/MEDWrapper/V2_2/MED_V2_2_Wrapper.cxx +++ b/src/MEDWrapper/V2_2/MED_V2_2_Wrapper.cxx @@ -133,12 +133,12 @@ namespace MED{ if(theErr && !*theErr) return; - med_maillage& aType = static_cast(theInfo.myType); + med_maillage& aType = (med_maillage&)(theInfo.myType); TErr aRet = MEDmaaInfo(myFile->Id(), theMeshId, &theInfo.myName[0], - &theInfo.myDim, + (med_int *)&theInfo.myDim, &aType, &theInfo.myDesc[0]); if(theErr) @@ -159,7 +159,7 @@ namespace MED{ MED::TMeshInfo& anInfo = const_cast(theInfo); - med_maillage& aType = static_cast(theInfo.myType); + med_maillage& aType = (med_maillage&)(theInfo.myType); TErr aRet = MEDmaaCr(myFile->Id(), &anInfo.myName[0], @@ -255,13 +255,13 @@ namespace MED{ &aMeshInfo.myName[0], theFamId, &theInfo.myName[0], - &theInfo.myId, - &theInfo.myAttrId[0], - &theInfo.myAttrVal[0], + (med_int *)&theInfo.myId, + (med_int *)&theInfo.myAttrId[0], + (med_int *)&theInfo.myAttrVal[0], &theInfo.myAttrDesc[0], - &theInfo.myNbAttr, + (med_int *)&theInfo.myNbAttr, &theInfo.myGroupNames[0], - &theInfo.myNbGroup); + (med_int *)&theInfo.myNbGroup); if(theErr) *theErr = aRet; @@ -296,8 +296,8 @@ namespace MED{ &aMeshInfo.myName[0], &anInfo.myName[0], anInfo.myId, - &anInfo.myAttrId[0], - &anInfo.myAttrVal[0], + (med_int*)&anInfo.myAttrId[0], + (med_int*)&anInfo.myAttrVal[0], &anInfo.myAttrDesc[0], anInfo.myNbAttr, &anInfo.myGroupNames[0], @@ -336,8 +336,8 @@ namespace MED{ MED::TMeshInfo& aMeshInfo = *theInfo.myMeshInfo; - med_entite_maillage& anEntity = static_cast(theTEntity); - med_geometrie_element& aGeom = static_cast(theTGeom); + med_entite_maillage& anEntity = (med_entite_maillage&)(theTEntity); + med_geometrie_element& aGeom = (med_geometrie_element&)(theTGeom); TErr aRet = MEDnomLire(myFile->Id(), &aMeshInfo.myName[0], @@ -367,12 +367,12 @@ namespace MED{ MED::TMeshInfo& aMeshInfo = *theInfo.myMeshInfo; - med_entite_maillage& anEntity = static_cast(theTEntity); - med_geometrie_element& aGeom = static_cast(theTGeom); + med_entite_maillage& anEntity = (med_entite_maillage&)(theTEntity); + med_geometrie_element& aGeom = (med_geometrie_element&)(theTGeom); TErr aRet = MEDnumLire(myFile->Id(), &aMeshInfo.myName[0], - &theInfo.myElemNum[0], + (med_int*)&theInfo.myElemNum[0], nb, anEntity, aGeom); @@ -398,12 +398,12 @@ namespace MED{ MED::TMeshInfo& aMeshInfo = *theInfo.myMeshInfo; - med_entite_maillage& anEntity = static_cast(theTEntity); - med_geometrie_element& aGeom = static_cast(theTGeom); + med_entite_maillage& anEntity = (med_entite_maillage&)(theTEntity); + med_geometrie_element& aGeom = (med_geometrie_element&)(theTGeom); TErr aRet = MEDfamLire(myFile->Id(), &aMeshInfo.myName[0], - &theInfo.myFamNum[0], + (med_int*)&theInfo.myFamNum[0], nb, anEntity, aGeom); @@ -436,9 +436,9 @@ namespace MED{ MED::TElemInfo& anInfo = const_cast(theInfo); MED::TMeshInfo& aMeshInfo = *anInfo.myMeshInfo; - med_booleen& anIsElemNames = static_cast(theInfo.myIsElemNames); - med_entite_maillage& anEntity = static_cast(theTEntity); - med_geometrie_element& aGeom = static_cast(theTGeom); + med_booleen& anIsElemNames = (med_booleen&)(theInfo.myIsElemNames); + med_entite_maillage& anEntity = (med_entite_maillage&)(theTEntity); + med_geometrie_element& aGeom = (med_geometrie_element&)(theTGeom); TErr aRet = 0; if (anIsElemNames){ @@ -477,15 +477,15 @@ namespace MED{ MED::TElemInfo& anInfo = const_cast(theInfo); MED::TMeshInfo& aMeshInfo = *anInfo.myMeshInfo; - med_booleen& anIsElemNum = static_cast(theInfo.myIsElemNum); - med_entite_maillage& anEntity = static_cast(theTEntity); - med_geometrie_element& aGeom = static_cast(theTGeom); + med_booleen& anIsElemNum = (med_booleen&)(theInfo.myIsElemNum); + med_entite_maillage& anEntity = (med_entite_maillage&)(theTEntity); + med_geometrie_element& aGeom = (med_geometrie_element&)(theTGeom); TErr aRet = 0; if (anIsElemNum){ aRet = MEDnumEcr(myFile->Id(), &aMeshInfo.myName[0], - &anInfo.myElemNum[0], + (med_int*)&anInfo.myElemNum[0], anInfo.myElemNum.size(), anEntity, aGeom); @@ -518,12 +518,12 @@ namespace MED{ MED::TElemInfo& anInfo = const_cast(theInfo); MED::TMeshInfo& aMeshInfo = *anInfo.myMeshInfo; - med_entite_maillage& anEntity = static_cast(theTEntity); - med_geometrie_element& aGeom = static_cast(theTGeom); + med_entite_maillage& anEntity = (med_entite_maillage&)(theTEntity); + med_geometrie_element& aGeom = (med_geometrie_element&)(theTGeom); TErr aRet = MEDfamEcr(myFile->Id(), &aMeshInfo.myName[0], - &anInfo.myFamNum[0], + (med_int *)&anInfo.myFamNum[0], anInfo.myFamNum.size(), anEntity, aGeom); @@ -564,9 +564,9 @@ namespace MED{ MED::TMeshInfo& aMeshInfo = *theInfo.myMeshInfo; - med_repere& aRepere = static_cast(theInfo.mySystem); - med_booleen& anIsElemNames = static_cast(theInfo.myIsElemNames); - med_booleen& anIsElemNum = static_cast(theInfo.myIsElemNum); + med_repere& aRepere = (med_repere&)(theInfo.mySystem); + med_booleen& anIsElemNames = (med_booleen&)(theInfo.myIsElemNames); + med_booleen& anIsElemNum = (med_booleen&)(theInfo.myIsElemNum); TErr aRet = MEDnoeudsLire(myFile->Id(), &aMeshInfo.myName[0], @@ -578,9 +578,9 @@ namespace MED{ &theInfo.myCoordUnits[0], &theInfo.myElemNames[0], &anIsElemNames, - &theInfo.myElemNum[0], + (med_int *)&theInfo.myElemNum[0], &anIsElemNum, - &theInfo.myFamNum[0], + (med_int *)&theInfo.myFamNum[0], theInfo.myNbElem); if(theErr) *theErr = aRet; @@ -601,9 +601,9 @@ namespace MED{ MED::TNodeInfo& anInfo = const_cast(theInfo); MED::TMeshInfo& aMeshInfo = *anInfo.myMeshInfo; - med_repere& aRepere = static_cast(theInfo.mySystem); - med_booleen& anIsElemNames = static_cast(theInfo.myIsElemNames); - med_booleen& anIsElemNum = static_cast(theInfo.myIsElemNum); + med_repere& aRepere = (med_repere&)(theInfo.mySystem); + med_booleen& anIsElemNames = (med_booleen&)(theInfo.myIsElemNames); + med_booleen& anIsElemNum = (med_booleen&)(theInfo.myIsElemNum); TErr aRet = MEDnoeudsEcr(myFile->Id(), &aMeshInfo.myName[0], @@ -615,9 +615,9 @@ namespace MED{ &anInfo.myCoordUnits[0], &anInfo.myElemNames[0], anIsElemNames, - &anInfo.myElemNum[0], + (med_int *)&anInfo.myElemNum[0], anIsElemNum, - &anInfo.myFamNum[0], + (med_int *)&anInfo.myFamNum[0], anInfo.myNbElem); if(theErr) *theErr = aRet; @@ -647,16 +647,16 @@ namespace MED{ MED::TMeshInfo& aMeshInfo = *theInfo.myMeshInfo; TInt aNbElem = theInfo.myElemNum.size(); - med_entite_maillage& anEntity = static_cast(theInfo.myTEntity); - med_connectivite& aConn = static_cast(theInfo.myTConn); + med_entite_maillage& anEntity = (med_entite_maillage&)(theInfo.myTEntity); + med_connectivite& aConn = (med_connectivite&)(theInfo.myTConn); TErr aRet = 0; aRet = MEDpolygoneConnLire(myFile->Id(), &aMeshInfo.myName[0], - &theInfo.myIndex[0], + (med_int *)&theInfo.myIndex[0], aNbElem+1, - &theInfo.myConn[0], + (med_int *)&theInfo.myConn[0], anEntity, aConn); @@ -697,14 +697,14 @@ namespace MED{ MED::TPolygoneInfo& anInfo = const_cast(theInfo); MED::TMeshInfo& aMeshInfo = *anInfo.myMeshInfo; - med_entite_maillage& anEntity = static_cast(theInfo.myTEntity); - med_connectivite& aConn = static_cast(theInfo.myTConn); + med_entite_maillage& anEntity = (med_entite_maillage&)(theInfo.myTEntity); + med_connectivite& aConn = (med_connectivite&)(theInfo.myTConn); TErr aRet = MEDpolygoneConnEcr(myFile->Id(), &aMeshInfo.myName[0], - &anInfo.myIndex[0], + (med_int *)&anInfo.myIndex[0], anInfo.myNbElem+1, - &anInfo.myConn[0], + (med_int *)&anInfo.myConn[0], anEntity, aConn); @@ -748,8 +748,8 @@ namespace MED{ MED::TMeshInfo& aMeshInfo = const_cast(theMeshInfo); - med_entite_maillage& anEntity = static_cast(theTEntity); - med_connectivite& aConn = static_cast(theTConn); + med_entite_maillage& anEntity = (med_entite_maillage&)(theTEntity); + med_connectivite& aConn = (med_connectivite&)(theTConn); med_int taille = 0; @@ -778,17 +778,17 @@ namespace MED{ MED::TMeshInfo& aMeshInfo = *theInfo.myMeshInfo; TInt aNbElem = theInfo.myElemNum.size(); - med_connectivite& aConn = static_cast(theInfo.myTConn); + med_connectivite& aConn = (med_connectivite&)(theInfo.myTConn); TErr aRet = 0; aRet = MEDpolyedreConnLire(myFile->Id(), &aMeshInfo.myName[0], - &theInfo.myIndex[0], + (med_int *)&theInfo.myIndex[0], aNbElem+1, - &theInfo.myFacesIndex[0], + (med_int *)&theInfo.myFacesIndex[0], theInfo.myNbFacesIndex, - &theInfo.myConn[0], + (med_int *)&theInfo.myConn[0], aConn); if(theErr) @@ -827,18 +827,18 @@ namespace MED{ MED::TPolyedreInfo& anInfo = const_cast(theInfo); MED::TMeshInfo& aMeshInfo = *anInfo.myMeshInfo; - med_booleen& anIsElemNames = static_cast(theInfo.myIsElemNames); - med_booleen& anIsElemNum = static_cast(theInfo.myIsElemNum); - med_entite_maillage& anEntity = static_cast(theInfo.myTEntity); - med_connectivite& aConn = static_cast(theInfo.myTConn); + med_booleen& anIsElemNames = (med_booleen&)(theInfo.myIsElemNames); + med_booleen& anIsElemNum = (med_booleen&)(theInfo.myIsElemNum); + med_entite_maillage& anEntity = (med_entite_maillage&)(theInfo.myTEntity); + med_connectivite& aConn = (med_connectivite&)(theInfo.myTConn); TErr aRet = MEDpolyedreConnEcr(myFile->Id(), &aMeshInfo.myName[0], - &anInfo.myIndex[0], + (med_int *)&anInfo.myIndex[0], anInfo.myNbElem+1, - &anInfo.myFacesIndex[0], + (med_int *)&anInfo.myFacesIndex[0], anInfo.myNbFacesIndex, - &anInfo.myConn[0], + (med_int *)&anInfo.myConn[0], aConn); if(theErr) @@ -862,7 +862,7 @@ namespace MED{ if (anIsElemNum){ aRet = MEDnumEcr(myFile->Id(), &aMeshInfo.myName[0], - &anInfo.myElemNum[0], + (med_int *)&anInfo.myElemNum[0], anInfo.myElemNum.size(), anEntity, MED_POLYEDRE); @@ -875,7 +875,7 @@ namespace MED{ aRet = MEDfamEcr(myFile->Id(), &aMeshInfo.myName[0], - &anInfo.myFamNum[0], + (med_int *)&anInfo.myFamNum[0], anInfo.myFamNum.size(), anEntity, MED_POLYEDRE); @@ -906,13 +906,13 @@ namespace MED{ if(theErr && !*theErr) EXCEPTION(runtime_error,"GetPolyedreInfo - (...)"); MED::TMeshInfo& aMeshInfo = const_cast(theMeshInfo); - med_connectivite& aConn = static_cast(theTConn); + med_connectivite& aConn = (med_connectivite&)(theTConn); TErr aRet = MEDpolyedreInfo(myFile->Id(), &aMeshInfo.myName[0], aConn, - &nf, - &nc); + (med_int *)&nf, + (med_int *)&nc); if(theErr) *theErr = aRet; @@ -992,22 +992,22 @@ namespace MED{ MED::TMeshInfo& aMeshInfo = *theInfo.myMeshInfo; TInt aNbElem = theInfo.myElemNum.size(); - med_booleen& anIsElemNames = static_cast(theInfo.myIsElemNames); - med_booleen& anIsElemNum = static_cast(theInfo.myIsElemNum); - med_entite_maillage& anEntity = static_cast(theInfo.myTEntity); - med_geometrie_element& aGeom = static_cast(theInfo.myTGeom); - med_connectivite& aConn = static_cast(theInfo.myTConn); + med_booleen& anIsElemNames = (med_booleen&)(theInfo.myIsElemNames); + med_booleen& anIsElemNum = (med_booleen&)(theInfo.myIsElemNum); + med_entite_maillage& anEntity = (med_entite_maillage&)(theInfo.myTEntity); + med_geometrie_element& aGeom = (med_geometrie_element&)(theInfo.myTGeom); + med_connectivite& aConn = (med_connectivite&)(theInfo.myTConn); TErr aRet = MEDelementsLire(myFile->Id(), &aMeshInfo.myName[0], aMeshInfo.myDim, - &theInfo.myConn[0], + (med_int *)&theInfo.myConn[0], MED_FULL_INTERLACE, &theInfo.myElemNames[0], &anIsElemNames, - &theInfo.myElemNum[0], + (med_int *)&theInfo.myElemNum[0], &anIsElemNum, - &theInfo.myFamNum[0], + (med_int *)&theInfo.myFamNum[0], aNbElem, anEntity, aGeom, @@ -1031,22 +1031,22 @@ namespace MED{ MED::TCellInfo& anInfo = const_cast(theInfo); MED::TMeshInfo& aMeshInfo = *anInfo.myMeshInfo; - med_booleen& anIsElemNames = static_cast(theInfo.myIsElemNames); - med_booleen& anIsElemNum = static_cast(theInfo.myIsElemNum); - med_entite_maillage& anEntity = static_cast(theInfo.myTEntity); - med_geometrie_element& aGeom = static_cast(theInfo.myTGeom); - med_connectivite& aConn = static_cast(theInfo.myTConn); + med_booleen& anIsElemNames = (med_booleen&)(theInfo.myIsElemNames); + med_booleen& anIsElemNum = (med_booleen&)(theInfo.myIsElemNum); + med_entite_maillage& anEntity = (med_entite_maillage&)(theInfo.myTEntity); + med_geometrie_element& aGeom = (med_geometrie_element&)(theInfo.myTGeom); + med_connectivite& aConn = (med_connectivite&)(theInfo.myTConn); TErr aRet = MEDelementsEcr(myFile->Id(), &aMeshInfo.myName[0], aMeshInfo.myDim, - &anInfo.myConn[0], + (med_int *)&anInfo.myConn[0], MED_FULL_INTERLACE, &anInfo.myElemNames[0], anIsElemNames, - &anInfo.myElemNum[0], + (med_int *)&anInfo.myElemNum[0], anIsElemNum, - &anInfo.myFamNum[0], + (med_int *)&anInfo.myFamNum[0], anInfo.myNbElem, anEntity, aGeom, @@ -1098,7 +1098,7 @@ namespace MED{ if(theErr && !*theErr) return; - med_type_champ& aType = static_cast(theInfo.myType); + med_type_champ& aType = (med_type_champ&)(theInfo.myType); TErr aRet = MEDchampInfo(myFile->Id(), theFieldId, @@ -1125,7 +1125,7 @@ namespace MED{ MED::TFieldInfo& anInfo = const_cast(theInfo); - med_type_champ& aType = static_cast(theInfo.myType); + med_type_champ& aType = (med_type_champ&)(theInfo.myType); TErr aRet = MEDchampCr(myFile->Id(), &anInfo.myName[0], @@ -1173,11 +1173,11 @@ namespace MED{ MED::TFieldInfo& anInfo = const_cast(theInfo); TEntityInfo::const_iterator anIter = theEntityInfo.begin(); for(; anIter != theEntityInfo.end(); anIter++){ - const med_entite_maillage& anEntity = static_cast(anIter->first); + const med_entite_maillage& anEntity = (const med_entite_maillage&)(anIter->first); const TGeom& aTGeom = anIter->second; TGeom::const_iterator anGeomIter = aTGeom.begin(); for(; anGeomIter != aTGeom.end(); anGeomIter++){ - const med_geometrie_element& aGeom = static_cast(anGeomIter->first); + const med_geometrie_element& aGeom = (const med_geometrie_element&)(anGeomIter->first); TInt aTmp = MEDnPasdetemps(myFile->Id(),&anInfo.myName[0],anEntity,aGeom); aNbTimeStamps = max(aTmp,aNbTimeStamps); if (aNbTimeStamps<1) @@ -1215,26 +1215,26 @@ namespace MED{ MED::TFieldInfo& aFieldInfo = *theInfo.myFieldInfo; MED::TMeshInfo& aMeshInfo = *aFieldInfo.myMeshInfo; - med_entite_maillage& anEntity = static_cast(theInfo.myEntity); + med_entite_maillage& anEntity = (med_entite_maillage&)(theInfo.myEntity); TGeom::iterator anIter = aTGeom.begin(); - med_geometrie_element& aGeom = static_cast(anIter->first); + med_geometrie_element& aGeom = (med_geometrie_element&)(anIter->first); - med_booleen& anIsLocal = static_cast(aFieldInfo.myIsLocal); + med_booleen& anIsLocal = (med_booleen&)(aFieldInfo.myIsLocal); TErr aRet = MEDpasdetempsInfo(myFile->Id(), &aFieldInfo.myName[0], anEntity, aGeom, theTimeStampId, - &theInfo.myNbGauss, - &theInfo.myNumDt, - &theInfo.myNumOrd, + (med_int *)&theInfo.myNbGauss, + (med_int *)&theInfo.myNumDt, + (med_int *)&theInfo.myNumOrd, &theInfo.myUnitDt[0], &theInfo.myDt, &aMeshInfo.myName[0], &anIsLocal, - &aFieldInfo.myNbRef); + (med_int *)&aFieldInfo.myNbRef); if(theErr) *theErr = aRet; else if(aRet < 0) @@ -1260,12 +1260,12 @@ namespace MED{ MED::TFieldInfo& aFieldInfo = *aTimeStampInfo.myFieldInfo; MED::TMeshInfo& aMeshInfo = *aFieldInfo.myMeshInfo; - med_entite_maillage& anEntity = static_cast(aTimeStampInfo.myEntity); - med_mode_profil& aPflMode = static_cast(theVal.myPflMode); + med_entite_maillage& anEntity = (med_entite_maillage&)(aTimeStampInfo.myEntity); + med_mode_profil& aPflMode = (med_mode_profil&)(theVal.myPflMode); TGeom& aTGeom = aTimeStampInfo.myGeom; TGeom::iterator anIter = aTGeom.begin(); for(; anIter != aTGeom.end(); anIter++){ - med_geometrie_element& aGeom = static_cast(anIter->first); + med_geometrie_element& aGeom = (med_geometrie_element&)(anIter->first); TInt aNbVal = MEDnVal(anId, &aFieldInfo.myName[0], anEntity, @@ -1369,11 +1369,11 @@ namespace MED{ MED::TMeshInfo& aMeshInfo = *aFieldInfo.myMeshInfo; MED::TMeshValue& aMeshValue = aVal.myMeshValue; - med_entite_maillage& anEntity = static_cast(aTimeStampInfo.myEntity); - med_mode_profil& aPflMode = static_cast(theVal.myPflMode); + med_entite_maillage& anEntity = (med_entite_maillage&)(aTimeStampInfo.myEntity); + med_mode_profil& aPflMode = (med_mode_profil&)(theVal.myPflMode); TMeshValue::iterator anIter = aMeshValue.begin(); for(; anIter != aMeshValue.end(); anIter++){ - med_geometrie_element& aGeom = static_cast(anIter->first); + med_geometrie_element& aGeom = (med_geometrie_element&)(anIter->first); TValue& aValue = aVal.myMeshValue[EGeometrieElement(aGeom)]; med_int iEnd = aValue.size(); med_int aNbVal = iEnd / aFieldInfo.myNbComp; diff --git a/src/MPILifeCycleCORBA/SALOME_MPILifeCycleCORBA.cxx b/src/MPILifeCycleCORBA/SALOME_MPILifeCycleCORBA.cxx index 9d342ca32..5dfe13fcb 100644 --- a/src/MPILifeCycleCORBA/SALOME_MPILifeCycleCORBA.cxx +++ b/src/MPILifeCycleCORBA/SALOME_MPILifeCycleCORBA.cxx @@ -337,7 +337,7 @@ Engines::Component_var SALOME_MPILifeCycleCORBA::FindOrLoad_MPIComponent { string instanceName = compo->instanceName(); } - catch (CORBA::COMM_FAILURE&) + catch (CORBA::SystemException&) { INFOS("Caught CORBA::SystemException CommFailure. Engine " << path << "does not respond" ); diff --git a/src/Makefile.in b/src/Makefile.in index c64ecb109..d0daa6ea2 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -48,7 +48,7 @@ endif ifeq (@WITHIHM@,no) SUBDIRS = MSG2QM SALOMELocalTrace SALOMETraceCollector Logger Utils CASCatch \ - GenericObj NamingService Registry \ + GenericObj MEDWrapper NamingService Registry \ ModuleCatalog DataTypeCatalog RessourcesCatalog \ ResourcesManager Notification NOTIFICATION_SWIG \ Container TestContainer LifeCycleCORBA HDFPersist Prs \ diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx index ad8cdd43d..f2176aa12 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx @@ -85,9 +85,9 @@ int main(int argc,char **argv) if(!CORBA::is_nil(orb)) theObj = orb->resolve_initial_references("NameService"); } - catch( CORBA::COMM_FAILURE& ) + catch( CORBA::SystemException& ) { - INFOS( "Module Catalog Server: CORBA::COMM_FAILURE: Unable to contact the Naming Service" ); + INFOS( "Module Catalog Server: CORBA::SystemException: Unable to contact the Naming Service" ); } if (!CORBA::is_nil(theObj)) { diff --git a/src/NamingService/NamingService_WaitForServerReadiness.cxx b/src/NamingService/NamingService_WaitForServerReadiness.cxx index 7cb1a6bce..fcdf75f13 100644 --- a/src/NamingService/NamingService_WaitForServerReadiness.cxx +++ b/src/NamingService/NamingService_WaitForServerReadiness.cxx @@ -66,7 +66,8 @@ void NamingService_WaitForServerReadiness(SALOME_NamingService* NS, { if (serverName.length() == 0) { - string curdir = NS->Current_Directory(); // to wait for naming service + //string curdir = NS->Current_Directory(); // to wait for naming service + string dummyadr = NS->getIORaddr(); // to wait for naming service found = 1; break; // naming service found } diff --git a/src/NamingService/SALOME_NamingService.cxx b/src/NamingService/SALOME_NamingService.cxx index e939d5341..4beb6d4e3 100644 --- a/src/NamingService/SALOME_NamingService.cxx +++ b/src/NamingService/SALOME_NamingService.cxx @@ -151,9 +151,9 @@ void SALOME_NamingService::Register(CORBA::Object_ptr ObjRef, { INFOS("!!!Register() : CosNaming::NamingContext::CannotProceed"); } - catch(CORBA::COMM_FAILURE&) + catch(CORBA::SystemException&) { - INFOS("!!!Register() : CORBA::COMM_FAILURE : unable to contact" + INFOS("!!!Register() : CORBA::SystemException : unable to contact" << " the naming service"); throw ServiceUnreachable(); } @@ -218,9 +218,9 @@ void SALOME_NamingService::Register(CORBA::Object_ptr ObjRef, { INFOS("!!!Register() : CosNaming::NamingContext::InvalidName"); } - catch(CORBA::COMM_FAILURE&) + catch(CORBA::SystemException&) { - INFOS("!!!Register() :CORBA::COMM_FAILURE : unable to contact" + INFOS("!!!Register() :CORBA::SystemException : unable to contact" << " the naming service"); throw ServiceUnreachable(); } @@ -270,9 +270,9 @@ void SALOME_NamingService::Register(CORBA::Object_ptr ObjRef, INFOS("!!!Register() : CosNaming::NamingContext::AlreadyBound, object will be rebind"); _current_context->rebind(_context_name, ObjRef); } - catch(CORBA::COMM_FAILURE&) + catch(CORBA::SystemException&) { - INFOS("!!!Register() :CORBA::COMM_FAILURE : unable to contact" + INFOS("!!!Register() :CORBA::SystemException : unable to contact" << " the naming service"); throw ServiceUnreachable(); } @@ -352,9 +352,9 @@ CORBA::Object_ptr SALOME_NamingService::Resolve(const char* Path) { INFOS("!!!Resolve() : CosNaming::NamingContext::InvalidName"); } - catch(CORBA::COMM_FAILURE&) + catch(CORBA::SystemException&) { - INFOS("!!!Resolve() :CORBA::COMM_FAILURE : unable to contact" + INFOS("!!!Resolve() :CORBA::SystemException : unable to contact" << "the naming service"); throw ServiceUnreachable(); } @@ -390,9 +390,9 @@ int SALOME_NamingService::Find(const char* name) { _Find(name,occurence_number); } - catch(CORBA::COMM_FAILURE&) + catch(CORBA::SystemException&) { - INFOS("!!!Find() : CORBA::COMM_FAILURE : unable to contact" + INFOS("!!!Find() : CORBA::SystemException : unable to contact" << " the naming service"); throw ServiceUnreachable(); } @@ -495,10 +495,10 @@ bool SALOME_NamingService::Create_Directory(const char* Path) _return_code = false; INFOS("!!!Create_Directory():CosNaming::NamingContext::InvalidName"); } - catch(CORBA::COMM_FAILURE&) + catch(CORBA::SystemException&) { _return_code = false; - INFOS("!!!Register() :CORBA::COMM_FAILURE : unable to contact" + INFOS("!!!Register() :CORBA::SystemException : unable to contact" << " the naming service"); throw ServiceUnreachable(); } @@ -588,10 +588,10 @@ bool SALOME_NamingService::Change_Directory(const char* Path) _return_code = false; INFOS( "!!!Change_Directory() : CosNaming::NamingContext::InvalidName" ) } - catch(CORBA::COMM_FAILURE&) + catch(CORBA::SystemException&) { _return_code = false; - INFOS( "!!!Change_Directory() :CORBA::COMM_FAILURE : unable to contact" + INFOS( "!!!Change_Directory() :CORBA::SystemException : unable to contact" << "the naming service") throw ServiceUnreachable(); } @@ -633,9 +633,9 @@ char* SALOME_NamingService::Current_Directory() { _current_directory(result_path,i,_ref_context,_continue ); } - catch(CORBA::COMM_FAILURE&) + catch(CORBA::SystemException&) { - INFOS("!!!Current_Directory(): CORBA::COMM_FAILURE : unable to contact" + INFOS("!!!Current_Directory(): CORBA::SystemException : unable to contact" << " the naming service" ) throw ServiceUnreachable(); } @@ -817,9 +817,9 @@ void SALOME_NamingService::Destroy_Name(const char* Path) { INFOS( "!!!Destroy_Name(): CosNaming::NamingContext::CannotProceed" ) } - catch(CORBA::COMM_FAILURE&) + catch(CORBA::SystemException&) { - INFOS( "!!!Destroy_Name() : CORBA::COMM_FAILURE : unable to contact" + INFOS( "!!!Destroy_Name() : CORBA::SystemException : unable to contact" << " the naming service") throw ServiceUnreachable(); } @@ -861,9 +861,9 @@ void SALOME_NamingService::Destroy_Name(const char* Path) { INFOS( "!!!Destroy_Name() : CosNaming::NamingContext::InvalidName") } - catch(CORBA::COMM_FAILURE&) + catch(CORBA::SystemException&) { - INFOS( "!!!Destroy_Name() :CORBA::COMM_FAILURE : unable to contact" + INFOS( "!!!Destroy_Name() :CORBA::SystemException : unable to contact" << " the naming service") throw ServiceUnreachable(); } @@ -940,9 +940,9 @@ void SALOME_NamingService::Destroy_Directory(const char* Path) { INFOS("!!!Destroy_Directory(): CosNaming::NamingContext::CannotProceed" ) } - catch(CORBA::COMM_FAILURE&) + catch(CORBA::SystemException&) { - INFOS( "!!!Destroy_Directory() : CORBA::COMM_FAILURE : unable to contact" + INFOS( "!!!Destroy_Directory() : CORBA::SystemException : unable to contact" << " the naming service" ) throw ServiceUnreachable(); } @@ -984,9 +984,9 @@ void SALOME_NamingService::Destroy_Directory(const char* Path) { INFOS( "!!!Destroy_Directory(): CosNaming::NamingContext::CannotProceed" ) } - catch(CORBA::COMM_FAILURE&) + catch(CORBA::SystemException&) { - INFOS( "!!!Destroy_Directory() : CORBA::COMM_FAILURE : unable to contact" + INFOS( "!!!Destroy_Directory() : CORBA::SystemException : unable to contact" << " the naming service" ) throw ServiceUnreachable(); } @@ -1003,9 +1003,9 @@ void SALOME_NamingService::Destroy_Directory(const char* Path) INFOS( "!!!Destroy_Directory() : CosNaming::NamingContext::NoEmpty " << Path << " is not empty" ) } - catch(CORBA::COMM_FAILURE&) + catch(CORBA::SystemException&) { - INFOS( "!!!Destroy_Directory() :CORBA::COMM_FAILURE : " + INFOS( "!!!Destroy_Directory() :CORBA::SystemException : " << "unable to contact the naming service") throw ServiceUnreachable(); } @@ -1039,9 +1039,9 @@ void SALOME_NamingService::Destroy_Directory(const char* Path) { INFOS( "!!!Destroy_Directory() : CosNaming::NamingContext::InvalidName") } - catch(CORBA::COMM_FAILURE&) + catch(CORBA::SystemException&) { - INFOS( "!!!Destroy_Directory() :CORBA::COMM_FAILURE : unable to contact" + INFOS( "!!!Destroy_Directory() :CORBA::SystemException : unable to contact" << " the naming service") throw ServiceUnreachable(); } @@ -1070,9 +1070,9 @@ void SALOME_NamingService::_initialize_root_context() ASSERT(!CORBA::is_nil(_root_context)); } - catch(CORBA::COMM_FAILURE&) + catch(CORBA::SystemException&) { - INFOS("CORBA::COMM_FAILURE: unable to contact the naming service"); + INFOS("CORBA::SystemException: unable to contact the naming service"); throw ServiceUnreachable(); } catch(...) diff --git a/src/NamingService/SALOME_NamingServicePy.py b/src/NamingService/SALOME_NamingServicePy.py index 2bc3c553c..ab7f2050d 100644 --- a/src/NamingService/SALOME_NamingServicePy.py +++ b/src/NamingService/SALOME_NamingServicePy.py @@ -64,7 +64,7 @@ class SALOME_NamingServicePy_i: MESSAGE(" Name service not found") else: ok = 1 - except CORBA.COMM_FAILURE, ex: + except (CORBA.TRANSIENT,CORBA.OBJECT_NOT_EXIST,CORBA.COMM_FAILURE): MESSAGE(" Name service not found") time.sleep(0.25) steps = steps - 1 @@ -100,8 +100,8 @@ class SALOME_NamingServicePy_i: MESSAGE ( "Register : CosNaming.NamingContext.InvalidName" ) except CosNaming.NamingContext.CannotProceed, ex: MESSAGE ( "Register : CosNaming.NamingContext.CannotProceed" ) - except CORBA.COMM_FAILURE, ex: - MESSAGE ( "Register : CORBA.COMM_FAILURE" ) + except (CORBA.TRANSIENT,CORBA.OBJECT_NOT_EXIST,CORBA.COMM_FAILURE): + MESSAGE ( "Register : CORBA.TRANSIENT,CORBA.OBJECT_NOT_EXIST,CORBA.COMM_FAILURE" ) if _not_exist: # at least one context of the complete path is not created, we had @@ -132,8 +132,8 @@ class SALOME_NamingServicePy_i: except CosNaming.NamingContext.AlreadyBound, ex: MESSAGE ( "Register : CosNaming.NamingContext.AlreadyBound, object will be rebind" ) self._current_context.rebind(_context_name,ObjRef) - except CORBA.COMM_FAILURE, ex: - MESSAGE ( "Register : CORBA.COMM_FAILURE" ) + except (CORBA.TRANSIENT,CORBA.OBJECT_NOT_EXIST,CORBA.COMM_FAILURE): + MESSAGE ( "Register : CORBA.TRANSIENT,CORBA.OBJECT_NOT_EXIST,CORBA.COMM_FAILURE" ) #------------------------------------------------------------------------- @@ -161,8 +161,8 @@ class SALOME_NamingServicePy_i: except CosNaming.NamingContext.CannotProceed, ex: MESSAGE ( "Resolve : CosNaming.NamingContext.CannotProceed" ) self._obj = None - except CORBA.COMM_FAILURE, ex: - MESSAGE ( "Resolve : CORBA.COMM_FAILURE" ) + except (CORBA.TRANSIENT,CORBA.OBJECT_NOT_EXIST,CORBA.COMM_FAILURE): + MESSAGE ( "Resolve : CORBA.TRANSIENT,CORBA.OBJECT_NOT_EXIST,CORBA.COMM_FAILURE" ) self._obj = None return self._obj @@ -191,8 +191,8 @@ class SALOME_NamingServicePy_i: MESSAGE ( "Create_Directory : CosNaming.NamingContext.InvalidName" ) except CosNaming.NamingContext.CannotProceed, ex: MESSAGE ( "Create_Directory : CosNaming.NamingContext.CannotProceed" ) - except CORBA.COMM_FAILURE, ex: - MESSAGE ( "Create_Directory : CORBA.COMM_FAILURE" ) + except (CORBA.TRANSIENT,CORBA.OBJECT_NOT_EXIST,CORBA.COMM_FAILURE): + MESSAGE ( "Create_Directory : CORBA.TRANSIENT,CORBA.OBJECT_NOT_EXIST,CORBA.COMM_FAILURE" ) diff --git a/src/Notification/NOTIFICATION.cxx b/src/Notification/NOTIFICATION.cxx index bbbb92294..e55d0abc7 100644 --- a/src/Notification/NOTIFICATION.cxx +++ b/src/Notification/NOTIFICATION.cxx @@ -50,7 +50,7 @@ CosNA_EventChannel_ptr NOTIFICATION_channel() { } catch(CORBA::ORB::InvalidName& ex) { MESSAGE("NOTIFICATION Error : service required is invalid [does not exist]"); return(channel); - } catch (CORBA::COMM_FAILURE& ex) { + } catch (CORBA::SystemException& ex) { MESSAGE("NOTIFICATION Error : caught system exception COMM_FAILURE"); return(channel); } catch (...) { @@ -70,7 +70,7 @@ CosNA_EventChannel_ptr NOTIFICATION_channel() { }; } catch(CORBA::ORB::InvalidName& ex) { MESSAGE("NOTIFICATION Error : invalid name"); - } catch (CORBA::COMM_FAILURE& ex) { + } catch (CORBA::SystemException& ex) { MESSAGE("NOTIFICATION Error : caught system exception COMM_FAILURE while resolving event channel name"); } catch (...) { MESSAGE("NOTIFICATION Error : caught exception while resolving event channel name"); diff --git a/src/PatchQt/Makefile.in b/src/PatchQt/Makefile.in index d916a9a7a..7909f104a 100644 --- a/src/PatchQt/Makefile.in +++ b/src/PatchQt/Makefile.in @@ -38,13 +38,18 @@ EXPORT_HEADERS = \ qfiledialogP.h # Libraries targets +ifeq ($(QT_VERS),v3_3_3) + LIB_SRC = qsplitterP.cxx qsplitterP_moc.cxx +else + LIB_SRC = qsplitterP.cxx qsplitterP_moc.cxx qworkspaceP.cxx qworkspaceP_moc.cxx qactionP.cxx qactionP_moc.cxx qfiledialogP.cxx qfiledialogP_moc.cxx +endif LIB = libqsplitterP.la -LIB_SRC = qsplitterP.cxx qsplitterP_moc.cxx qworkspaceP.cxx qworkspaceP_moc.cxx qactionP.cxx qactionP_moc.cxx qfiledialogP.cxx qfiledialogP_moc.cxx + qsplitterP_moc.cxx: $(inc_builddir)/qsplitterP.h $(MOC) $(inc_builddir)/qsplitterP.h -o qsplitterP_moc.cxx -qworkspaceP_moc.cxx: $(inc_builddir)/qworkspaceP.h +qworkspaceP_moc.cxx: $(inc_builddir)/qworkspaceP.h $(MOC) $(inc_builddir)/qworkspaceP.h -o qworkspaceP_moc.cxx qactionP_moc.cxx: $(inc_builddir)/qactionP.h @@ -53,7 +58,7 @@ qactionP_moc.cxx: $(inc_builddir)/qactionP.h qfiledialogP_moc.cxx: $(inc_builddir)/qfiledialogP.h $(MOC) $(inc_builddir)/qfiledialogP.h -o qfiledialogP_moc.cxx -CPPFLAGS+=$(QT_INCLUDES) -I${QTDIR}/src/kernel -I$(QTDIR)/mkspecs/linux-g++ +CPPFLAGS+=$(QT_INCLUDES) -I${QTDIR}/src/kernel -I$(QTDIR)/mkspecs/linux-g++ -I/usr/share/qt3/mkspecs/linux-g++ CXXFLAGS+= LDFLAGS+=$(QT_MT_LIBS) diff --git a/src/PatchQt/qactionP.h b/src/PatchQt/qactionP.h index 1fcf05053..160324087 100644 --- a/src/PatchQt/qactionP.h +++ b/src/PatchQt/qactionP.h @@ -53,6 +53,12 @@ #ifndef QT_NO_ACTION +#if QT_VERSION > 0x030005 +#include +#define QActionP QAction +#define QActionPGroup QActionGroup +#else + class QActionPPrivate; class QActionPGroupPrivate; class QStatusBar; @@ -184,4 +190,6 @@ public: #endif +#endif // QT_VERSION + #endif diff --git a/src/PatchQt/qfiledialogP.h b/src/PatchQt/qfiledialogP.h index f7355a193..ab615b753 100644 --- a/src/PatchQt/qfiledialogP.h +++ b/src/PatchQt/qfiledialogP.h @@ -68,6 +68,11 @@ class QFileDialogQFileListView; #include "qlineedit.h" #endif // QT_H +#if QT_VERSION > 0x030005 +#include +#define QFileDialogP QFileDialog +#else + #ifndef QT_NO_FILEDIALOG class Q_EXPORT QFileIconProviderP : public QObject @@ -525,4 +530,6 @@ private: #endif +#endif // QT_VERSION + #endif // QFILEDIALOG_H diff --git a/src/PatchQt/qsplitterP.cxx b/src/PatchQt/qsplitterP.cxx index 3983746b2..15d5ed2aa 100644 --- a/src/PatchQt/qsplitterP.cxx +++ b/src/PatchQt/qsplitterP.cxx @@ -48,6 +48,7 @@ #include #include #include +#include #include #if QT_VERSION < 300 #include diff --git a/src/PatchQt/qworkspaceP.h b/src/PatchQt/qworkspaceP.h index fb1523735..2197da251 100644 --- a/src/PatchQt/qworkspaceP.h +++ b/src/PatchQt/qworkspaceP.h @@ -54,6 +54,11 @@ #include #endif // QT_H +#if QT_VERSION > 0x030005 +#include +#define QWorkspaceP QWorkspace +#else + class QWorkspacePChild; class QShowEvent; class QWorkspacePPrivate; @@ -350,5 +355,5 @@ private: QTitleBarPPrivate *d; }; - +#endif // QT_VERSION #endif // QWORKSPACEP_H diff --git a/src/Registry/SALOME_Registry_Server.cxx b/src/Registry/SALOME_Registry_Server.cxx index d47523a93..0756e2b70 100644 --- a/src/Registry/SALOME_Registry_Server.cxx +++ b/src/Registry/SALOME_Registry_Server.cxx @@ -118,9 +118,9 @@ int main( int argc , char **argv ) if (!CORBA::is_nil(theObj)) inc = CosNaming::NamingContext::_narrow(theObj); } - catch( CORBA::COMM_FAILURE& ) + catch( CORBA::SystemException& ) { - MESSAGE( "Registry Server: CORBA::COMM_FAILURE: Unable to contact the Naming Service" ); + MESSAGE( "Registry Server: CORBA::SystemException: Unable to contact the Naming Service" ); } if(!CORBA::is_nil(inc)) { diff --git a/src/ResourcesManager/SALOME_ResourcesManager.cxx b/src/ResourcesManager/SALOME_ResourcesManager.cxx index f84a35867..da3c89977 100644 --- a/src/ResourcesManager/SALOME_ResourcesManager.cxx +++ b/src/ResourcesManager/SALOME_ResourcesManager.cxx @@ -11,6 +11,7 @@ #include #include #include +#include #include #include diff --git a/src/RessourcesCatalog/SALOME_RessourcesCatalog_Server.cxx b/src/RessourcesCatalog/SALOME_RessourcesCatalog_Server.cxx index b52c63b67..9625d3a0a 100644 --- a/src/RessourcesCatalog/SALOME_RessourcesCatalog_Server.cxx +++ b/src/RessourcesCatalog/SALOME_RessourcesCatalog_Server.cxx @@ -85,9 +85,9 @@ int main(int argc,char **argv) if (!CORBA::is_nil(theObj)) inc = CosNaming::NamingContext::_narrow(theObj); } - catch( CORBA::COMM_FAILURE& ) + catch( CORBA::SystemException& ) { - INFOS( "Ressources Catalog: CORBA::COMM_FAILURE: Unable to contact the Naming Service" ); + INFOS( "Ressources Catalog: CORBA::SystemException: Unable to contact the Naming Service" ); } if(!CORBA::is_nil(inc)) { diff --git a/src/SALOMEDS/Makefile.in b/src/SALOMEDS/Makefile.in index 5a4adbf4e..fd05d197c 100644 --- a/src/SALOMEDS/Makefile.in +++ b/src/SALOMEDS/Makefile.in @@ -42,6 +42,7 @@ EXPORT_HEADERS= \ LIB = libSalomeDS.la LIB_SRC = \ + SALOMEDS.cxx \ SALOMEDS_StudyManager_i.cxx \ SALOMEDS_UseCaseBuilder_i.cxx \ SALOMEDS_UseCaseIterator_i.cxx \ diff --git a/src/SALOMEDS/SALOMEDS.cxx b/src/SALOMEDS/SALOMEDS.cxx new file mode 100644 index 000000000..1cebce2ed --- /dev/null +++ b/src/SALOMEDS/SALOMEDS.cxx @@ -0,0 +1,53 @@ +// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SALOMEDS.cxx +// Author : Sergey ANIKIN +// Module : SALOME +// $Header$ + + +#include + +using namespace SALOMEDS; + +// PAL8065: san -- Global recursive mutex for SALOMEDS methods +Utils_Mutex Locker::MutexDS; + +// PAL8065: san -- Global SALOMEDS locker +Locker::Locker() +: Utils_Locker( &MutexDS ) +{} + +Locker::~Locker() +{} + +void SALOMEDS::lock() +{ + Locker::MutexDS.lock(); +} + +void SALOMEDS::unlock() +{ + Locker::MutexDS.unlock(); +} diff --git a/src/SALOMEDS/SALOMEDS.hxx b/src/SALOMEDS/SALOMEDS.hxx new file mode 100644 index 000000000..06ee1825e --- /dev/null +++ b/src/SALOMEDS/SALOMEDS.hxx @@ -0,0 +1,67 @@ +// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SALOMEDS.hxx +// Author : Sergey ANIKIN +// Module : SALOME +// $Header$ + + +#ifndef SALOMEDS_HeaderFile +#define SALOMEDS_HeaderFile + +#include + +namespace SALOMEDS +{ + // PAL8065: san -- Implementation of convenient locker based on simple recursive + // mutex for POSIX platforms. + // This class is to protect SALOMEDS CORBA methods which deal with OCC calls from + // parallel access by several threads + // To protect some method, an instance of Locker class should be created + // on the stack at the beginning of guarded code: + // + // Locker lock; + // + class Locker : public Utils_Locker + { + public: + Locker(); + virtual ~Locker(); + + private: + static Utils_Mutex MutexDS; + + friend void lock(); + friend void unlock(); + }; + + // Convenient functions to lock/unlock the global SALOMEDS mutex temporarily. + // In particular, "unlock-dosomething-lock" scheme should be used, when some non-SALOMEDS + // CORBA interface is called (component's engine), to avoid deadlocks in case of + // indirect recursion. + void lock(); + void unlock(); +}; + +#endif diff --git a/src/SALOMEDS/SALOMEDS_AttributeComment_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeComment_i.cxx index d84186658..0719f3337 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeComment_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeComment_i.cxx @@ -30,11 +30,14 @@ #include #include "SALOMEDS_AttributeComment_i.hxx" +#include "SALOMEDS.hxx" using namespace std; char* SALOMEDS_AttributeComment_i::Value() { + SALOMEDS::Locker lock; + TCollection_ExtendedString S = Handle(TDataStd_Comment)::DownCast(_myAttr)->Get(); CORBA::String_var c_s = CORBA::string_dup(TCollection_AsciiString(S).ToCString()); return c_s._retn(); @@ -42,15 +45,21 @@ char* SALOMEDS_AttributeComment_i::Value() void SALOMEDS_AttributeComment_i::SetValue(const char* value) { + SALOMEDS::Locker lock; + CheckLocked(); CORBA::String_var Str = CORBA::string_dup(value); Handle(TDataStd_Comment)::DownCast(_myAttr)->Set(TCollection_ExtendedString(Str)); } char* SALOMEDS_AttributeComment_i::Store() { + SALOMEDS::Locker lock; + return Value(); } void SALOMEDS_AttributeComment_i::Restore(const char* value) { + SALOMEDS::Locker lock; + SetValue(value); } diff --git a/src/SALOMEDS/SALOMEDS_AttributeDrawable_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeDrawable_i.cxx index 26f657821..3a9f5f1d5 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeDrawable_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeDrawable_i.cxx @@ -27,14 +27,19 @@ // $Header$ #include "SALOMEDS_AttributeDrawable_i.hxx" +#include "SALOMEDS.hxx" using namespace std; CORBA::Boolean SALOMEDS_AttributeDrawable_i::IsDrawable() { + SALOMEDS::Locker lock; + return (Handle(SALOMEDS_DrawableAttribute)::DownCast(_myAttr)->Get() == 1); } void SALOMEDS_AttributeDrawable_i::SetDrawable(CORBA::Boolean value) { + SALOMEDS::Locker lock; + CheckLocked(); Standard_Integer val = 0; if (value != 0) val = 1; @@ -42,9 +47,13 @@ void SALOMEDS_AttributeDrawable_i::SetDrawable(CORBA::Boolean value) { } char* SALOMEDS_AttributeDrawable_i::Store() { + SALOMEDS::Locker lock; + return CORBA::string_dup(IsDrawable()?"1":"0"); } void SALOMEDS_AttributeDrawable_i::Restore(const char* value) { + SALOMEDS::Locker lock; + SetDrawable(value[0] == '1'); } diff --git a/src/SALOMEDS/SALOMEDS_AttributeExpandable_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeExpandable_i.cxx index 70601d33f..4487afc14 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeExpandable_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeExpandable_i.cxx @@ -27,23 +27,32 @@ // $Header$ #include "SALOMEDS_AttributeExpandable_i.hxx" +#include "SALOMEDS.hxx" using namespace std; CORBA::Boolean SALOMEDS_AttributeExpandable_i::IsExpandable() { + SALOMEDS::Locker lock; + return (Handle(SALOMEDS_ExpandableAttribute)::DownCast(_myAttr)->Get() == 1); } void SALOMEDS_AttributeExpandable_i::SetExpandable(CORBA::Boolean value) { + SALOMEDS::Locker lock; + Standard_Integer val = 0; if (value != 0) val = 1; Handle(TDataStd_Integer)::DownCast(_myAttr)->Set(val); } char* SALOMEDS_AttributeExpandable_i::Store() { + SALOMEDS::Locker lock; + return CORBA::string_dup(IsExpandable()?"1":"0"); } void SALOMEDS_AttributeExpandable_i::Restore(const char* value) { + SALOMEDS::Locker lock; + SetExpandable(value[0] == '1'); } diff --git a/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.cxx index 9c60c8886..1dd93ea10 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.cxx @@ -27,6 +27,7 @@ // $Header$ #include "SALOMEDS_AttributeExternalFileDef_i.hxx" +#include "SALOMEDS.hxx" #include #include @@ -35,6 +36,8 @@ using namespace std; char* SALOMEDS_AttributeExternalFileDef_i::Value() { + SALOMEDS::Locker lock; + TCollection_ExtendedString S = Handle(SALOMEDS_ExternalFileDef)::DownCast(_myAttr)->Get(); CORBA::String_var c_s = CORBA::string_dup(TCollection_AsciiString(S).ToCString()); return c_s._retn(); @@ -42,6 +45,8 @@ char* SALOMEDS_AttributeExternalFileDef_i::Value() void SALOMEDS_AttributeExternalFileDef_i::SetValue(const char* value) { + SALOMEDS::Locker lock; + CheckLocked(); CORBA::String_var Str = CORBA::string_dup(value); // Handle(SALOMEDS_ExternalFileDef)::DownCast(_myAttr)->Set(TCollection_ExtendedString(Str)); diff --git a/src/SALOMEDS/SALOMEDS_AttributeFileType_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeFileType_i.cxx index b6237f309..c41320e90 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeFileType_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeFileType_i.cxx @@ -27,6 +27,8 @@ // $Header$ #include "SALOMEDS_AttributeFileType_i.hxx" +#include "SALOMEDS.hxx" + #include #include @@ -34,6 +36,8 @@ using namespace std; char* SALOMEDS_AttributeFileType_i::Value() { + SALOMEDS::Locker lock; + TCollection_ExtendedString S = Handle(SALOMEDS_FileType)::DownCast(_myAttr)->Get(); CORBA::String_var c_s = CORBA::string_dup(TCollection_AsciiString(S).ToCString()); return c_s._retn(); @@ -41,6 +45,8 @@ char* SALOMEDS_AttributeFileType_i::Value() void SALOMEDS_AttributeFileType_i::SetValue(const char* value) { + SALOMEDS::Locker lock; + CheckLocked(); CORBA::String_var Str = CORBA::string_dup(value); // Handle(SALOMEDS_FileType)::DownCast(_myAttr)->Set(TCollection_ExtendedString(Str)); diff --git a/src/SALOMEDS/SALOMEDS_AttributeFlags_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeFlags_i.cxx index 43f2fd947..3e1f37267 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeFlags_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeFlags_i.cxx @@ -27,6 +27,7 @@ // $Header$ #include "SALOMEDS_AttributeFlags_i.hxx" +#include "SALOMEDS.hxx" using namespace std; @@ -36,6 +37,8 @@ using namespace std; //======================================================================= CORBA::Long SALOMEDS_AttributeFlags_i::GetFlags() { + SALOMEDS::Locker lock; + return Handle(SALOMEDS_FlagsAttribute)::DownCast( _myAttr )->Get(); } @@ -45,6 +48,8 @@ CORBA::Long SALOMEDS_AttributeFlags_i::GetFlags() //======================================================================= void SALOMEDS_AttributeFlags_i::SetFlags( CORBA::Long theFlags ) { + SALOMEDS::Locker lock; + Handle(SALOMEDS_FlagsAttribute)::DownCast( _myAttr )->Set( theFlags ); } @@ -54,6 +59,8 @@ void SALOMEDS_AttributeFlags_i::SetFlags( CORBA::Long theFlags ) //======================================================================= CORBA::Boolean SALOMEDS_AttributeFlags_i::Get( CORBA::Long theFlag ) { + SALOMEDS::Locker lock; + return Handle(SALOMEDS_FlagsAttribute)::DownCast( _myAttr )->Get() & theFlag ? true : false; } @@ -63,6 +70,8 @@ CORBA::Boolean SALOMEDS_AttributeFlags_i::Get( CORBA::Long theFlag ) //======================================================================= void SALOMEDS_AttributeFlags_i::Set( CORBA::Long theFlag, CORBA::Boolean theValue ) { + SALOMEDS::Locker lock; + Handle(SALOMEDS_FlagsAttribute) anAttr = Handle(SALOMEDS_FlagsAttribute)::DownCast( _myAttr ); if ( theValue ) diff --git a/src/SALOMEDS/SALOMEDS_AttributeGraphic_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeGraphic_i.cxx index 7865b2501..3af2425ed 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeGraphic_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeGraphic_i.cxx @@ -27,6 +27,7 @@ // $Header$ #include "SALOMEDS_AttributeGraphic_i.hxx" +#include "SALOMEDS.hxx" using namespace std; @@ -37,6 +38,8 @@ using namespace std; void SALOMEDS_AttributeGraphic_i::SetVisibility( CORBA::Long theViewId, CORBA::Boolean theValue ) { + SALOMEDS::Locker lock; + Handle(SALOMEDS_GraphicAttribute) anAttr = Handle(SALOMEDS_GraphicAttribute)::DownCast( _myAttr ); if ( !anAttr.IsNull() ) @@ -49,6 +52,8 @@ void SALOMEDS_AttributeGraphic_i::SetVisibility( CORBA::Long theViewId, //======================================================================= CORBA::Boolean SALOMEDS_AttributeGraphic_i::GetVisibility( CORBA::Long theViewId ) { + SALOMEDS::Locker lock; + Handle(SALOMEDS_GraphicAttribute) anAttr = Handle(SALOMEDS_GraphicAttribute)::DownCast( _myAttr ); return !anAttr.IsNull() ? anAttr->GetVisibility( theViewId ) : false; diff --git a/src/SALOMEDS/SALOMEDS_AttributeIOR_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeIOR_i.cxx index dec61d358..d9b905bd0 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeIOR_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeIOR_i.cxx @@ -27,6 +27,7 @@ // $Header$ #include "SALOMEDS_AttributeIOR_i.hxx" +#include "SALOMEDS.hxx" #include #include "SALOMEDS_SObject_i.hxx" @@ -36,6 +37,8 @@ using namespace std; char* SALOMEDS_AttributeIOR_i::Value() { + SALOMEDS::Locker lock; + TCollection_ExtendedString S = Handle(SALOMEDS_IORAttribute)::DownCast(_myAttr)->Get(); CORBA::String_var c_s = CORBA::string_dup(TCollection_AsciiString(S).ToCString()); return c_s._retn(); @@ -43,6 +46,8 @@ char* SALOMEDS_AttributeIOR_i::Value() void SALOMEDS_AttributeIOR_i::SetValue(const char* value) { + SALOMEDS::Locker lock; + CheckLocked(); SALOMEDS_Study_i* aStudy = _mySObject->GetStudyServant(); diff --git a/src/SALOMEDS/SALOMEDS_AttributeInteger_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeInteger_i.cxx index 8e40d8590..7244bef05 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeInteger_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeInteger_i.cxx @@ -27,25 +27,34 @@ // $Header$ #include "SALOMEDS_AttributeInteger_i.hxx" +#include "SALOMEDS.hxx" using namespace std; CORBA::Long SALOMEDS_AttributeInteger_i::Value() { + SALOMEDS::Locker lock; + return Handle(TDataStd_Integer)::DownCast(_myAttr)->Get(); } void SALOMEDS_AttributeInteger_i::SetValue(CORBA::Long value) { + SALOMEDS::Locker lock; + CheckLocked(); Handle(TDataStd_Integer)::DownCast(_myAttr)->Set(value); } char* SALOMEDS_AttributeInteger_i::Store() { + SALOMEDS::Locker lock; + char* IntVal = new char[25]; sprintf(IntVal, "%d", Value()); return IntVal; } void SALOMEDS_AttributeInteger_i::Restore(const char* value) { + SALOMEDS::Locker lock; + char *err = NULL; CORBA::Long l = atol(value); SetValue(l); diff --git a/src/SALOMEDS/SALOMEDS_AttributeLocalID_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeLocalID_i.cxx index 77cef4678..b8e95836c 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeLocalID_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeLocalID_i.cxx @@ -27,25 +27,34 @@ // $Header$ #include "SALOMEDS_AttributeLocalID_i.hxx" +#include "SALOMEDS.hxx" using namespace std; CORBA::Long SALOMEDS_AttributeLocalID_i::Value() { + SALOMEDS::Locker lock; + return Handle(SALOMEDS_LocalIDAttribute)::DownCast(_myAttr)->Get(); } void SALOMEDS_AttributeLocalID_i::SetValue(CORBA::Long value) { + SALOMEDS::Locker lock; + CheckLocked(); Handle(TDataStd_Integer)::DownCast(_myAttr)->Set(value); } char* SALOMEDS_AttributeLocalID_i::Store() { + SALOMEDS::Locker lock; + char* IntVal = new char[25]; sprintf(IntVal, "%d", Value()); return IntVal; } void SALOMEDS_AttributeLocalID_i::Restore(const char* value) { + SALOMEDS::Locker lock; + char *err = NULL; CORBA::Long l = atol(value); SetValue(l); diff --git a/src/SALOMEDS/SALOMEDS_AttributeName_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeName_i.cxx index b495f26bf..8b37f454e 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeName_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeName_i.cxx @@ -27,26 +27,36 @@ // $Header$ #include "SALOMEDS_AttributeName_i.hxx" +#include "SALOMEDS.hxx" + #include #include using namespace std; char* SALOMEDS_AttributeName_i::Value() { + SALOMEDS::Locker lock; + TCollection_ExtendedString S = Handle(TDataStd_Name)::DownCast(_myAttr)->Get(); CORBA::String_var c_s = CORBA::string_dup(TCollection_AsciiString(S).ToCString()); return c_s._retn(); } void SALOMEDS_AttributeName_i::SetValue(const char* theValue) { + SALOMEDS::Locker lock; + CheckLocked(); Handle(TDataStd_Name)::DownCast(_myAttr)->Set(TCollection_ExtendedString((char*)theValue)); } char* SALOMEDS_AttributeName_i::Store() { + SALOMEDS::Locker lock; + return Value(); } void SALOMEDS_AttributeName_i::Restore(const char* value) { + SALOMEDS::Locker lock; + SetValue(value); } diff --git a/src/SALOMEDS/SALOMEDS_AttributeOpened_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeOpened_i.cxx index 5471006e5..e324dd61a 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeOpened_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeOpened_i.cxx @@ -27,23 +27,32 @@ // $Header$ #include "SALOMEDS_AttributeOpened_i.hxx" +#include "SALOMEDS.hxx" using namespace std; CORBA::Boolean SALOMEDS_AttributeOpened_i::IsOpened() { + SALOMEDS::Locker lock; + return (Handle(SALOMEDS_OpenedAttribute)::DownCast(_myAttr)->Get() == 1); } void SALOMEDS_AttributeOpened_i::SetOpened(CORBA::Boolean value) { + SALOMEDS::Locker lock; + Standard_Integer val = 0; if (value != 0) val = 1; Handle(TDataStd_Integer)::DownCast(_myAttr)->Set(val); } char* SALOMEDS_AttributeOpened_i::Store() { + SALOMEDS::Locker lock; + return CORBA::string_dup(IsOpened()?"1":"0"); } void SALOMEDS_AttributeOpened_i::Restore(const char* value) { + SALOMEDS::Locker lock; + SetOpened(value[0] == '1'); } diff --git a/src/SALOMEDS/SALOMEDS_AttributePersistentRef_i.cxx b/src/SALOMEDS/SALOMEDS_AttributePersistentRef_i.cxx index 67281220b..53b9eefa1 100644 --- a/src/SALOMEDS/SALOMEDS_AttributePersistentRef_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributePersistentRef_i.cxx @@ -27,6 +27,8 @@ // $Header$ #include "SALOMEDS_AttributePersistentRef_i.hxx" +#include "SALOMEDS.hxx" + #include #include @@ -34,6 +36,8 @@ using namespace std; char* SALOMEDS_AttributePersistentRef_i::Value() { + SALOMEDS::Locker lock; + TCollection_ExtendedString S = Handle(SALOMEDS_PersRefAttribute)::DownCast(_myAttr)->Get(); CORBA::String_var c_s = CORBA::string_dup(TCollection_AsciiString(S).ToCString()); return c_s._retn(); @@ -41,15 +45,21 @@ char* SALOMEDS_AttributePersistentRef_i::Value() void SALOMEDS_AttributePersistentRef_i::SetValue(const char* value) { + SALOMEDS::Locker lock; + CheckLocked(); CORBA::String_var Str = CORBA::string_dup(value); Handle(TDataStd_Comment)::DownCast(_myAttr)->Set(TCollection_ExtendedString(Str)); } char* SALOMEDS_AttributePersistentRef_i::Store() { + SALOMEDS::Locker lock; + return Value(); } void SALOMEDS_AttributePersistentRef_i::Restore(const char* value) { + SALOMEDS::Locker lock; + SetValue(value); } diff --git a/src/SALOMEDS/SALOMEDS_AttributePixMap_i.cxx b/src/SALOMEDS/SALOMEDS_AttributePixMap_i.cxx index 8fc0f2be1..e2d8fa104 100644 --- a/src/SALOMEDS/SALOMEDS_AttributePixMap_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributePixMap_i.cxx @@ -27,28 +27,38 @@ // $Header$ #include "SALOMEDS_AttributePixMap_i.hxx" +#include "SALOMEDS.hxx" + #include using namespace std; CORBA::Boolean SALOMEDS_AttributePixMap_i::HasPixMap() { + SALOMEDS::Locker lock; + TCollection_ExtendedString S = Handle(SALOMEDS_PixMapAttribute)::DownCast(_myAttr)->Get(); if (strcmp(TCollection_AsciiString(S).ToCString(), "None") == 0) return Standard_False; return Standard_True; } char* SALOMEDS_AttributePixMap_i::GetPixMap() { - CORBA::String_var S = CORBA::string_dup(TCollection_AsciiString(Handle(SALOMEDS_PixMapAttribute)::DownCast(_myAttr)->Get()).ToCString()); - return S._retn(); + SALOMEDS::Locker lock; + + CORBA::String_var S = CORBA::string_dup(TCollection_AsciiString(Handle(SALOMEDS_PixMapAttribute)::DownCast(_myAttr)->Get()).ToCString()); + return S._retn(); } void SALOMEDS_AttributePixMap_i::SetPixMap(const char* value) { + SALOMEDS::Locker lock; + CheckLocked(); CORBA::String_var Str = CORBA::string_dup(value); Handle(TDataStd_Comment)::DownCast(_myAttr)->Set(TCollection_ExtendedString(Str)); } char* SALOMEDS_AttributePixMap_i::Store() { + SALOMEDS::Locker lock; + return GetPixMap(); } diff --git a/src/SALOMEDS/SALOMEDS_AttributePythonObject_i.cxx b/src/SALOMEDS/SALOMEDS_AttributePythonObject_i.cxx index 2faab629d..4c552be88 100644 --- a/src/SALOMEDS/SALOMEDS_AttributePythonObject_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributePythonObject_i.cxx @@ -10,27 +10,37 @@ // $Header$ #include "SALOMEDS_AttributePythonObject_i.hxx" +#include "SALOMEDS.hxx" + #include #include using namespace std; void SALOMEDS_AttributePythonObject_i::SetObject(const char* theSequence, CORBA::Boolean IsScript) { + SALOMEDS::Locker lock; + CheckLocked(); Handle(SALOMEDS_PythonObjectAttribute)::DownCast(_myAttr)->SetObject(const_cast(theSequence), IsScript); } char* SALOMEDS_AttributePythonObject_i::GetObject() { + SALOMEDS::Locker lock; + char* aSeq = Handle(SALOMEDS_PythonObjectAttribute)::DownCast(_myAttr)->GetObject(); CORBA::String_var aStr = CORBA::string_dup(aSeq); return aStr._retn(); } CORBA::Boolean SALOMEDS_AttributePythonObject_i::IsScript() { + SALOMEDS::Locker lock; + return Handle(SALOMEDS_PythonObjectAttribute)::DownCast(_myAttr)->IsScript(); } char* SALOMEDS_AttributePythonObject_i::Store() { + SALOMEDS::Locker lock; + CORBA::String_var aString = GetObject(); char* aResult = new char[strlen(aString) + 2]; aResult[0] = IsScript()?'s':'n'; @@ -39,5 +49,7 @@ char* SALOMEDS_AttributePythonObject_i::Store() { } void SALOMEDS_AttributePythonObject_i::Restore(const char* theValue) { + SALOMEDS::Locker lock; + SetObject(&theValue[1], theValue[0]=='s'); } diff --git a/src/SALOMEDS/SALOMEDS_AttributeReal_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeReal_i.cxx index ca74454ee..54d642f7c 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeReal_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeReal_i.cxx @@ -27,6 +27,8 @@ // $Header$ #include "SALOMEDS_AttributeReal_i.hxx" +#include "SALOMEDS.hxx" + #include using namespace std; @@ -56,15 +58,21 @@ static double read_double(const char* str) } CORBA::Double SALOMEDS_AttributeReal_i::Value() { + SALOMEDS::Locker lock; + return Handle(TDataStd_Real)::DownCast(_myAttr)->Get(); } void SALOMEDS_AttributeReal_i::SetValue(CORBA::Double value) { + SALOMEDS::Locker lock; + CheckLocked(); Handle(TDataStd_Real)::DownCast(_myAttr)->Set(value); } char* SALOMEDS_AttributeReal_i::Store() { + SALOMEDS::Locker lock; + // char* RealVal = new char[35]; // sprintf(RealVal, "%.20f", Value()); //return RealVal; @@ -72,6 +80,8 @@ char* SALOMEDS_AttributeReal_i::Store() { } void SALOMEDS_AttributeReal_i::Restore(const char* value) { + SALOMEDS::Locker lock; + //char *err = NULL; //CORBA::Double r = strtod(value, &err); //if (err != value) SetValue(r); diff --git a/src/SALOMEDS/SALOMEDS_AttributeSelectable_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeSelectable_i.cxx index 1ae041186..59d3d8e6e 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeSelectable_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeSelectable_i.cxx @@ -27,23 +27,32 @@ // $Header$ #include "SALOMEDS_AttributeSelectable_i.hxx" +#include "SALOMEDS.hxx" using namespace std; CORBA::Boolean SALOMEDS_AttributeSelectable_i::IsSelectable() { + SALOMEDS::Locker lock; + return (Handle(SALOMEDS_SelectableAttribute)::DownCast(_myAttr)->Get() == 1); } void SALOMEDS_AttributeSelectable_i::SetSelectable(CORBA::Boolean value) { + SALOMEDS::Locker lock; + Standard_Integer val = 0; if (value != 0) val = 1; Handle(TDataStd_Integer)::DownCast(_myAttr)->Set(val); } char* SALOMEDS_AttributeSelectable_i::Store() { + SALOMEDS::Locker lock; + return CORBA::string_dup(IsSelectable()?"1":"0"); } void SALOMEDS_AttributeSelectable_i::Restore(const char* value) { + SALOMEDS::Locker lock; + SetSelectable(value[0] == '1'); } diff --git a/src/SALOMEDS/SALOMEDS_AttributeSequenceOfInteger_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeSequenceOfInteger_i.cxx index 33b8fbd1e..1de8087bd 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeSequenceOfInteger_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeSequenceOfInteger_i.cxx @@ -27,12 +27,16 @@ // $Header$ #include "SALOMEDS_AttributeSequenceOfInteger_i.hxx" +#include "SALOMEDS.hxx" + #include using namespace std; void SALOMEDS_AttributeSequenceOfInteger_i::Assign(const SALOMEDS::LongSeq& other) { + SALOMEDS::Locker lock; + CheckLocked(); Handle(TColStd_HSequenceOfInteger) CasCadeSeq = new TColStd_HSequenceOfInteger; for (int i = 0; i < other.length(); i++) { @@ -43,6 +47,8 @@ void SALOMEDS_AttributeSequenceOfInteger_i::Assign(const SALOMEDS::LongSeq& othe SALOMEDS::LongSeq* SALOMEDS_AttributeSequenceOfInteger_i::CorbaSequence() { + SALOMEDS::Locker lock; + SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq; Handle(SALOMEDS_SequenceOfIntegerAttribute) CasCadeSeq = Handle(SALOMEDS_SequenceOfIntegerAttribute)::DownCast(_myAttr); CorbaSeq->length(CasCadeSeq->Length()); @@ -54,33 +60,45 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeSequenceOfInteger_i::CorbaSequence() void SALOMEDS_AttributeSequenceOfInteger_i::Add(CORBA::Long value) { + SALOMEDS::Locker lock; + CheckLocked(); Handle(SALOMEDS_SequenceOfIntegerAttribute)::DownCast(_myAttr)->Add(value); } void SALOMEDS_AttributeSequenceOfInteger_i::Remove(CORBA::Long index) { + SALOMEDS::Locker lock; + CheckLocked(); Handle(SALOMEDS_SequenceOfIntegerAttribute)::DownCast(_myAttr)->Remove(index); } void SALOMEDS_AttributeSequenceOfInteger_i::ChangeValue(CORBA::Long index, CORBA::Long value) { + SALOMEDS::Locker lock; + CheckLocked(); Handle(SALOMEDS_SequenceOfIntegerAttribute)::DownCast(_myAttr)->ChangeValue(index, value); } CORBA::Long SALOMEDS_AttributeSequenceOfInteger_i::Value(CORBA::Short index) { + SALOMEDS::Locker lock; + return Handle(SALOMEDS_SequenceOfIntegerAttribute)::DownCast(_myAttr)->Value(index); } CORBA::Long SALOMEDS_AttributeSequenceOfInteger_i::Length() { + SALOMEDS::Locker lock; + return Handle(SALOMEDS_SequenceOfIntegerAttribute)::DownCast(_myAttr)->Length(); } char* SALOMEDS_AttributeSequenceOfInteger_i::Store() { + SALOMEDS::Locker lock; + Handle(SALOMEDS_SequenceOfIntegerAttribute) CasCadeSeq = Handle(SALOMEDS_SequenceOfIntegerAttribute)::DownCast(_myAttr); Standard_Integer aLength = CasCadeSeq->Length(); char* aResult = new char[aLength * 25]; @@ -94,6 +112,8 @@ char* SALOMEDS_AttributeSequenceOfInteger_i::Store() { } void SALOMEDS_AttributeSequenceOfInteger_i::Restore(const char* value) { + SALOMEDS::Locker lock; + Handle(TColStd_HSequenceOfInteger) CasCadeSeq = new TColStd_HSequenceOfInteger; char* aCopy = strdup(value); diff --git a/src/SALOMEDS/SALOMEDS_AttributeSequenceOfReal_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeSequenceOfReal_i.cxx index 308ec01c0..45e7664f5 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeSequenceOfReal_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeSequenceOfReal_i.cxx @@ -27,12 +27,16 @@ // $Header$ #include "SALOMEDS_AttributeSequenceOfReal_i.hxx" +#include "SALOMEDS.hxx" + #include using namespace std; void SALOMEDS_AttributeSequenceOfReal_i::Assign(const SALOMEDS::DoubleSeq& other) { + SALOMEDS::Locker lock; + CheckLocked(); Handle(TColStd_HSequenceOfReal) CasCadeSeq = new TColStd_HSequenceOfReal; for (int i = 0; i < other.length(); i++) { @@ -43,6 +47,8 @@ void SALOMEDS_AttributeSequenceOfReal_i::Assign(const SALOMEDS::DoubleSeq& other SALOMEDS::DoubleSeq* SALOMEDS_AttributeSequenceOfReal_i::CorbaSequence() { + SALOMEDS::Locker lock; + SALOMEDS::DoubleSeq_var CorbaSeq = new SALOMEDS::DoubleSeq; Handle(SALOMEDS_SequenceOfRealAttribute) CasCadeSeq = Handle(SALOMEDS_SequenceOfRealAttribute)::DownCast(_myAttr); CorbaSeq->length(CasCadeSeq->Length()); @@ -54,33 +60,45 @@ SALOMEDS::DoubleSeq* SALOMEDS_AttributeSequenceOfReal_i::CorbaSequence() void SALOMEDS_AttributeSequenceOfReal_i::Add(CORBA::Double value) { + SALOMEDS::Locker lock; + CheckLocked(); Handle(SALOMEDS_SequenceOfRealAttribute)::DownCast(_myAttr)->Add(value); } void SALOMEDS_AttributeSequenceOfReal_i::Remove(CORBA::Long index) { + SALOMEDS::Locker lock; + CheckLocked(); Handle(SALOMEDS_SequenceOfRealAttribute)::DownCast(_myAttr)->Remove(index); } void SALOMEDS_AttributeSequenceOfReal_i::ChangeValue(CORBA::Long index, CORBA::Double value) { + SALOMEDS::Locker lock; + CheckLocked(); Handle(SALOMEDS_SequenceOfRealAttribute)::DownCast(_myAttr)->ChangeValue(index, value); } CORBA::Double SALOMEDS_AttributeSequenceOfReal_i::Value(CORBA::Short index) { + SALOMEDS::Locker lock; + return Handle(SALOMEDS_SequenceOfRealAttribute)::DownCast(_myAttr)->Value(index); } CORBA::Long SALOMEDS_AttributeSequenceOfReal_i::Length() { + SALOMEDS::Locker lock; + return Handle(SALOMEDS_SequenceOfRealAttribute)::DownCast(_myAttr)->Length(); } char* SALOMEDS_AttributeSequenceOfReal_i::Store() { + SALOMEDS::Locker lock; + Handle(SALOMEDS_SequenceOfRealAttribute) CasCadeSeq = Handle(SALOMEDS_SequenceOfRealAttribute)::DownCast(_myAttr); Standard_Integer aLength = CasCadeSeq->Length(); char* aResult = new char[aLength * 25]; @@ -94,6 +112,8 @@ char* SALOMEDS_AttributeSequenceOfReal_i::Store() { } void SALOMEDS_AttributeSequenceOfReal_i::Restore(const char* value) { + SALOMEDS::Locker lock; + Handle(TColStd_HSequenceOfReal) CasCadeSeq = new TColStd_HSequenceOfReal; char* aCopy = strdup(value); diff --git a/src/SALOMEDS/SALOMEDS_AttributeStudyProperties_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeStudyProperties_i.cxx index b08b9d5c4..bf96a068c 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeStudyProperties_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeStudyProperties_i.cxx @@ -15,6 +15,7 @@ #include #include "SALOMEDS_AttributeStudyProperties_i.hxx" +#include "SALOMEDS.hxx" #define CREATION_MODE_NOTDEFINED 0 #define CREATION_MODE_SCRATCH 1 @@ -23,12 +24,16 @@ using namespace std; void SALOMEDS_AttributeStudyProperties_i::SetUserName(const char* theName) { + SALOMEDS::Locker lock; + CheckLocked(); Handle(SALOMEDS_StudyPropertiesAttribute) aProp = Handle(SALOMEDS_StudyPropertiesAttribute)::DownCast(_myAttr); aProp->SetFirstName(const_cast(theName)); } char* SALOMEDS_AttributeStudyProperties_i::GetUserName() { + SALOMEDS::Locker lock; + TCollection_ExtendedString S = Handle(SALOMEDS_StudyPropertiesAttribute)::DownCast(_myAttr)->GetCreatorName(); CORBA::String_var c_s = CORBA::string_dup(TCollection_AsciiString(S).ToCString()); return c_s._retn(); @@ -39,6 +44,8 @@ void SALOMEDS_AttributeStudyProperties_i::SetCreationDate(CORBA::Long theMinute, CORBA::Long theDay, CORBA::Long theMonth, CORBA::Long theYear) { + SALOMEDS::Locker lock; + CheckLocked(); Handle(SALOMEDS_StudyPropertiesAttribute) aProp = Handle(SALOMEDS_StudyPropertiesAttribute)::DownCast(_myAttr); int aTmp; @@ -51,6 +58,8 @@ CORBA::Boolean SALOMEDS_AttributeStudyProperties_i::GetCreationDate(CORBA::Long& CORBA::Long& theDay, CORBA::Long& theMonth, CORBA::Long& theYear) { + SALOMEDS::Locker lock; + Standard_Integer aMinute; Standard_Integer aHour; Standard_Integer aDay; @@ -69,6 +78,8 @@ CORBA::Boolean SALOMEDS_AttributeStudyProperties_i::GetCreationDate(CORBA::Long& } void SALOMEDS_AttributeStudyProperties_i::SetCreationMode(const char* theMode) { + SALOMEDS::Locker lock; + CheckLocked(); Handle(SALOMEDS_StudyPropertiesAttribute) aProp = Handle(SALOMEDS_StudyPropertiesAttribute)::DownCast(_myAttr); if (strcmp(theMode,"from scratch")==0) aProp->SetCreationMode(CREATION_MODE_SCRATCH); @@ -77,6 +88,8 @@ void SALOMEDS_AttributeStudyProperties_i::SetCreationMode(const char* theMode) { } char* SALOMEDS_AttributeStudyProperties_i::GetCreationMode() { + SALOMEDS::Locker lock; + CORBA::String_var c_s; switch (Handle(SALOMEDS_StudyPropertiesAttribute)::DownCast(_myAttr)->GetCreationMode()) { case CREATION_MODE_SCRATCH: c_s = "from scratch"; break; @@ -87,22 +100,32 @@ char* SALOMEDS_AttributeStudyProperties_i::GetCreationMode() { } void SALOMEDS_AttributeStudyProperties_i::SetModified(CORBA::Long theModified) { + SALOMEDS::Locker lock; + Handle(SALOMEDS_StudyPropertiesAttribute)::DownCast(_myAttr)->SetModified(theModified); } CORBA::Boolean SALOMEDS_AttributeStudyProperties_i::IsModified() { + SALOMEDS::Locker lock; + return Handle(SALOMEDS_StudyPropertiesAttribute)::DownCast(_myAttr)->IsModified(); } CORBA::Long SALOMEDS_AttributeStudyProperties_i::GetModified() { + SALOMEDS::Locker lock; + return Handle(SALOMEDS_StudyPropertiesAttribute)::DownCast(_myAttr)->GetModified(); } void SALOMEDS_AttributeStudyProperties_i::SetLocked(CORBA::Boolean theLocked) { + SALOMEDS::Locker lock; + Handle(SALOMEDS_StudyPropertiesAttribute)::DownCast(_myAttr)->SetLocked(theLocked); } CORBA::Boolean SALOMEDS_AttributeStudyProperties_i::IsLocked() { + SALOMEDS::Locker lock; + return Handle(SALOMEDS_StudyPropertiesAttribute)::DownCast(_myAttr)->IsLocked(); } @@ -112,6 +135,8 @@ void SALOMEDS_AttributeStudyProperties_i::SetModification(const char* theName, CORBA::Long theDay, CORBA::Long theMonth, CORBA::Long theYear) { + SALOMEDS::Locker lock; + CheckLocked(); Handle(SALOMEDS_StudyPropertiesAttribute) aProp = Handle(SALOMEDS_StudyPropertiesAttribute)::DownCast(_myAttr); aProp->SetUserName(const_cast(theName)); @@ -124,6 +149,8 @@ void SALOMEDS_AttributeStudyProperties_i::GetModificationsList(SALOMEDS::StringS SALOMEDS::LongSeq_out theMonths, SALOMEDS::LongSeq_out theYears, CORBA::Boolean theWithCreator) { + SALOMEDS::Locker lock; + Handle(TColStd_HSequenceOfExtendedString) aNames; Handle(TColStd_HSequenceOfInteger) aMinutes, aHours, aDays, aMonths, aYears; Handle(SALOMEDS_StudyPropertiesAttribute) aProp = Handle(SALOMEDS_StudyPropertiesAttribute)::DownCast(_myAttr); @@ -157,6 +184,8 @@ void SALOMEDS_AttributeStudyProperties_i::GetModificationsList(SALOMEDS::StringS } char* SALOMEDS_AttributeStudyProperties_i::Store() { + SALOMEDS::Locker lock; + Handle(TColStd_HSequenceOfExtendedString) aNames; Handle(TColStd_HSequenceOfInteger) aMinutes, aHours, aDays, aMonths, aYears; Handle(SALOMEDS_StudyPropertiesAttribute) aProp = Handle(SALOMEDS_StudyPropertiesAttribute)::DownCast(_myAttr); @@ -188,6 +217,8 @@ char* SALOMEDS_AttributeStudyProperties_i::Store() { } void SALOMEDS_AttributeStudyProperties_i::Restore(const char* value) { + SALOMEDS::Locker lock; + char* aCopy = strdup(value); if (aCopy[0] == 'f') SetCreationMode("from scratch"); else if (aCopy[0] == 'c') SetCreationMode("copy from"); diff --git a/src/SALOMEDS/SALOMEDS_AttributeTableOfInteger_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeTableOfInteger_i.cxx index 380741f49..ba6c5914e 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTableOfInteger_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTableOfInteger_i.cxx @@ -12,9 +12,9 @@ #include #include #include -#include #include "SALOMEDS_AttributeTableOfInteger_i.hxx" +#include "SALOMEDS.hxx" #include "Utils_ExceptHandlers.hxx" #include @@ -47,6 +47,8 @@ static TCollection_ExtendedString getTitle(TCollection_ExtendedString theString) } void SALOMEDS_AttributeTableOfInteger_i::SetTitle(const char* theTitle) { + SALOMEDS::Locker lock; + CheckLocked(); Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr); CORBA::String_var aStr = CORBA::string_dup(theTitle); @@ -54,6 +56,8 @@ void SALOMEDS_AttributeTableOfInteger_i::SetTitle(const char* theTitle) { } char* SALOMEDS_AttributeTableOfInteger_i::GetTitle() { + SALOMEDS::Locker lock; + Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr); CORBA::String_var c_s = CORBA::string_dup(TCollection_AsciiString(aTable->GetTitle()).ToCString()); return c_s._retn(); @@ -62,6 +66,8 @@ char* SALOMEDS_AttributeTableOfInteger_i::GetTitle() { void SALOMEDS_AttributeTableOfInteger_i::SetRowTitle(CORBA::Long theIndex, const char* theTitle) throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex) { + SALOMEDS::Locker lock; + Unexpect aCatch (ATI_IncorrectIndex); CheckLocked(); Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr); @@ -80,6 +86,8 @@ void SALOMEDS_AttributeTableOfInteger_i::SetRowTitle(CORBA::Long theIndex, const void SALOMEDS_AttributeTableOfInteger_i::SetRowTitles(const SALOMEDS::StringSeq& theTitles) throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength) { + SALOMEDS::Locker lock; + Unexpect aCatch (ATI_IncorrectArgumentLength); CheckLocked(); Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr); @@ -90,6 +98,8 @@ void SALOMEDS_AttributeTableOfInteger_i::SetRowTitles(const SALOMEDS::StringSeq& } SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfInteger_i::GetRowTitles() { + SALOMEDS::Locker lock; + Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr); SALOMEDS::StringSeq_var aTitles = new SALOMEDS::StringSeq; aTitles->length(aTable->GetNbRows()); @@ -101,6 +111,8 @@ SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfInteger_i::GetRowTitles() { void SALOMEDS_AttributeTableOfInteger_i::SetColumnTitle(CORBA::Long theIndex, const char* theTitle) throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex) { + SALOMEDS::Locker lock; + Unexpect aCatch (ATI_IncorrectIndex); CheckLocked(); Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr); @@ -112,6 +124,8 @@ void SALOMEDS_AttributeTableOfInteger_i::SetColumnTitle(CORBA::Long theIndex, co void SALOMEDS_AttributeTableOfInteger_i::SetColumnTitles(const SALOMEDS::StringSeq& theTitles) throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength) { + SALOMEDS::Locker lock; + Unexpect aCatch(ATI_IncorrectArgumentLength); CheckLocked(); Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr); @@ -122,6 +136,8 @@ void SALOMEDS_AttributeTableOfInteger_i::SetColumnTitles(const SALOMEDS::StringS } SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfInteger_i::GetColumnTitles() { + SALOMEDS::Locker lock; + Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr); SALOMEDS::StringSeq_var aTitles = new SALOMEDS::StringSeq; aTitles->length(aTable->GetNbColumns()); @@ -134,7 +150,9 @@ SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfInteger_i::GetColumnTitles() { void SALOMEDS_AttributeTableOfInteger_i::SetRowUnit(CORBA::Long theIndex, const char* theUnit) throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex) { - Unexpect aCatch (ATI_IncorrectIndex); + SALOMEDS::Locker lock; + + Unexpect aCatch (ATI_IncorrectIndex); CheckLocked(); Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr); if (theIndex <= 0 || theIndex > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex(); @@ -149,6 +167,8 @@ void SALOMEDS_AttributeTableOfInteger_i::SetRowUnit(CORBA::Long theIndex, const void SALOMEDS_AttributeTableOfInteger_i::SetRowUnits(const SALOMEDS::StringSeq& theUnits) throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength) { + SALOMEDS::Locker lock; + Unexpect aCatch (ATI_IncorrectArgumentLength); CheckLocked(); Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr); @@ -159,6 +179,8 @@ void SALOMEDS_AttributeTableOfInteger_i::SetRowUnits(const SALOMEDS::StringSeq& } SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfInteger_i::GetRowUnits() { + SALOMEDS::Locker lock; + Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr); SALOMEDS::StringSeq_var aUnits = new SALOMEDS::StringSeq; aUnits->length(aTable->GetNbRows()); @@ -168,15 +190,21 @@ SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfInteger_i::GetRowUnits() { } CORBA::Long SALOMEDS_AttributeTableOfInteger_i::GetNbRows() { + SALOMEDS::Locker lock; + return Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr)->GetNbRows(); } CORBA::Long SALOMEDS_AttributeTableOfInteger_i::GetNbColumns() { + SALOMEDS::Locker lock; + return Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr)->GetNbColumns(); } void SALOMEDS_AttributeTableOfInteger_i::AddRow(const SALOMEDS::LongSeq& theData) throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength) { + SALOMEDS::Locker lock; + Unexpect aCatch(ATI_IncorrectArgumentLength); CheckLocked(); Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr); @@ -194,6 +222,8 @@ void SALOMEDS_AttributeTableOfInteger_i::AddRow(const SALOMEDS::LongSeq& theData void SALOMEDS_AttributeTableOfInteger_i::SetRow(CORBA::Long theRow, const SALOMEDS::LongSeq& theData) throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength, SALOMEDS::AttributeTableOfInteger::IncorrectIndex) { + SALOMEDS::Locker lock; + Unexpect aCatch(ATI_IncorrectArgumentLength); CheckLocked(); Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr); @@ -211,6 +241,8 @@ void SALOMEDS_AttributeTableOfInteger_i::SetRow(CORBA::Long theRow, const SALOME SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::GetRow(CORBA::Long theRow) throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex) { + SALOMEDS::Locker lock; + Unexpect aCatch(ATI_IncorrectIndex); Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr); if (theRow <= 0 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex(); @@ -227,6 +259,8 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::GetRow(CORBA::Long theRow void SALOMEDS_AttributeTableOfInteger_i::AddColumn(const SALOMEDS::LongSeq& theData) throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength) { + SALOMEDS::Locker lock; + Unexpect aCatch(ATI_IncorrectArgumentLength); CheckLocked(); Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr); @@ -244,6 +278,8 @@ void SALOMEDS_AttributeTableOfInteger_i::AddColumn(const SALOMEDS::LongSeq& theD void SALOMEDS_AttributeTableOfInteger_i::SetColumn(CORBA::Long theColumn, const SALOMEDS::LongSeq& theData) throw (SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength, SALOMEDS::AttributeTableOfInteger::IncorrectIndex) { + SALOMEDS::Locker lock; + Unexpect aCatch(ATI_IncorrectArgumentLength); CheckLocked(); Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr); @@ -261,6 +297,8 @@ void SALOMEDS_AttributeTableOfInteger_i::SetColumn(CORBA::Long theColumn, const SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::GetColumn(CORBA::Long theColumn) throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex) { + SALOMEDS::Locker lock; + Unexpect aCatch(ATI_IncorrectIndex); Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr); if (theColumn <= 0 || theColumn > aTable->GetNbColumns()) throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex(); @@ -277,6 +315,8 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::GetColumn(CORBA::Long the void SALOMEDS_AttributeTableOfInteger_i::PutValue(CORBA::Long theValue, CORBA::Long theRow, CORBA::Long theColumn) throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex) { + SALOMEDS::Locker lock; + Unexpect aCatch(ATI_IncorrectIndex); CheckLocked(); Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr); @@ -290,12 +330,16 @@ void SALOMEDS_AttributeTableOfInteger_i::PutValue(CORBA::Long theValue, CORBA::L } CORBA::Boolean SALOMEDS_AttributeTableOfInteger_i::HasValue(CORBA::Long theRow, CORBA::Long theColumn) { + SALOMEDS::Locker lock; + return Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr)->HasValue(theRow, theColumn); } CORBA::Long SALOMEDS_AttributeTableOfInteger_i::GetValue(CORBA::Long theRow, CORBA::Long theColumn) throw (SALOMEDS::AttributeTableOfInteger::IncorrectIndex) { + SALOMEDS::Locker lock; + Unexpect aCatch(ATI_IncorrectIndex); Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr); if (theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex(); @@ -312,6 +356,8 @@ CORBA::Long SALOMEDS_AttributeTableOfInteger_i::GetValue(CORBA::Long theRow, COR SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::GetRowSetIndices(CORBA::Long theRow) { + SALOMEDS::Locker lock; + Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr); if(theRow <= 0 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex(); @@ -328,12 +374,16 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::GetRowSetIndices(CORBA::L void SALOMEDS_AttributeTableOfInteger_i::SetNbColumns(CORBA::Long theNbColumns) { + SALOMEDS::Locker lock; + Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr); aTable->SetNbColumns(theNbColumns); } bool SALOMEDS_AttributeTableOfInteger_i::ReadFromFile(const SALOMEDS::TMPFile& theStream) { + SALOMEDS::Locker lock; + Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr); istrstream aStream((char*)&theStream[0], theStream.length()); @@ -342,6 +392,8 @@ bool SALOMEDS_AttributeTableOfInteger_i::ReadFromFile(const SALOMEDS::TMPFile& t SALOMEDS::TMPFile* SALOMEDS_AttributeTableOfInteger_i::SaveToFile() { + SALOMEDS::Locker lock; + Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr); ostrstream ostr; @@ -361,6 +413,8 @@ SALOMEDS::TMPFile* SALOMEDS_AttributeTableOfInteger_i::SaveToFile() } char* SALOMEDS_AttributeTableOfInteger_i::Store() { + SALOMEDS::Locker lock; + Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr); ostrstream ostr; @@ -372,6 +426,8 @@ char* SALOMEDS_AttributeTableOfInteger_i::Store() { } void SALOMEDS_AttributeTableOfInteger_i::Restore(const char* value) { + SALOMEDS::Locker lock; + Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(_myAttr); istrstream aStream(value, strlen(value)); diff --git a/src/SALOMEDS/SALOMEDS_AttributeTableOfReal_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeTableOfReal_i.cxx index c550cf38b..89f0c2f95 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTableOfReal_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTableOfReal_i.cxx @@ -10,11 +10,11 @@ // $Header$ #include "SALOMEDS_AttributeTableOfReal_i.hxx" +#include "SALOMEDS.hxx" #include #include #include -#include #include #include @@ -46,6 +46,8 @@ static TCollection_ExtendedString getTitle(TCollection_ExtendedString theString) } void SALOMEDS_AttributeTableOfReal_i::SetTitle(const char* theTitle) { + SALOMEDS::Locker lock; + CheckLocked(); Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr); CORBA::String_var aStr = CORBA::string_dup(theTitle); @@ -53,6 +55,8 @@ void SALOMEDS_AttributeTableOfReal_i::SetTitle(const char* theTitle) { } char* SALOMEDS_AttributeTableOfReal_i::GetTitle() { + SALOMEDS::Locker lock; + Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr); CORBA::String_var c_s = CORBA::string_dup(TCollection_AsciiString(aTable->GetTitle()).ToCString()); return c_s._retn(); @@ -61,6 +65,8 @@ char* SALOMEDS_AttributeTableOfReal_i::GetTitle() { void SALOMEDS_AttributeTableOfReal_i::SetRowTitle(CORBA::Long theIndex, const char* theTitle) throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex) { + SALOMEDS::Locker lock; + Unexpect aCatch (ATR_IncorrectIndex); CheckLocked(); Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr); @@ -79,6 +85,8 @@ void SALOMEDS_AttributeTableOfReal_i::SetRowTitle(CORBA::Long theIndex, const ch void SALOMEDS_AttributeTableOfReal_i::SetRowTitles(const SALOMEDS::StringSeq& theTitles) throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength) { + SALOMEDS::Locker lock; + Unexpect aCatch (ATR_IncorrectArgumentLength); CheckLocked(); Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr); @@ -89,6 +97,8 @@ void SALOMEDS_AttributeTableOfReal_i::SetRowTitles(const SALOMEDS::StringSeq& th } SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfReal_i::GetRowTitles() { + SALOMEDS::Locker lock; + Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr); SALOMEDS::StringSeq_var aTitles = new SALOMEDS::StringSeq; aTitles->length(aTable->GetNbRows()); @@ -100,6 +110,8 @@ SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfReal_i::GetRowTitles() { void SALOMEDS_AttributeTableOfReal_i::SetColumnTitle(CORBA::Long theIndex, const char* theTitle) throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex) { + SALOMEDS::Locker lock; + Unexpect aCatch (ATR_IncorrectIndex); CheckLocked(); Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr); @@ -111,6 +123,8 @@ void SALOMEDS_AttributeTableOfReal_i::SetColumnTitle(CORBA::Long theIndex, const void SALOMEDS_AttributeTableOfReal_i::SetColumnTitles(const SALOMEDS::StringSeq& theTitles) throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength) { + SALOMEDS::Locker lock; + Unexpect aCatch(ATR_IncorrectArgumentLength); CheckLocked(); Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr); @@ -121,6 +135,8 @@ void SALOMEDS_AttributeTableOfReal_i::SetColumnTitles(const SALOMEDS::StringSeq& } SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfReal_i::GetColumnTitles() { + SALOMEDS::Locker lock; + Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr); SALOMEDS::StringSeq_var aTitles = new SALOMEDS::StringSeq; aTitles->length(aTable->GetNbColumns()); @@ -133,6 +149,8 @@ SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfReal_i::GetColumnTitles() { void SALOMEDS_AttributeTableOfReal_i::SetRowUnit(CORBA::Long theIndex, const char* theUnit) throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex) { + SALOMEDS::Locker lock; + Unexpect aCatch (ATR_IncorrectIndex); CheckLocked(); Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr); @@ -148,6 +166,8 @@ void SALOMEDS_AttributeTableOfReal_i::SetRowUnit(CORBA::Long theIndex, const cha void SALOMEDS_AttributeTableOfReal_i::SetRowUnits(const SALOMEDS::StringSeq& theUnits) throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength) { + SALOMEDS::Locker lock; + Unexpect aCatch (ATR_IncorrectArgumentLength); CheckLocked(); Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr); @@ -158,6 +178,8 @@ void SALOMEDS_AttributeTableOfReal_i::SetRowUnits(const SALOMEDS::StringSeq& the } SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfReal_i::GetRowUnits() { + SALOMEDS::Locker lock; + Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr); SALOMEDS::StringSeq_var aUnits = new SALOMEDS::StringSeq; aUnits->length(aTable->GetNbRows()); @@ -168,15 +190,21 @@ SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfReal_i::GetRowUnits() { CORBA::Long SALOMEDS_AttributeTableOfReal_i::GetNbRows() { + SALOMEDS::Locker lock; + return Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr)->GetNbRows(); } CORBA::Long SALOMEDS_AttributeTableOfReal_i::GetNbColumns() { + SALOMEDS::Locker lock; + return Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr)->GetNbColumns(); } void SALOMEDS_AttributeTableOfReal_i::AddRow(const SALOMEDS::DoubleSeq& theData) throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength) { + SALOMEDS::Locker lock; + Unexpect aCatch(ATR_IncorrectArgumentLength); CheckLocked(); Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr); @@ -189,6 +217,8 @@ void SALOMEDS_AttributeTableOfReal_i::AddRow(const SALOMEDS::DoubleSeq& theData) void SALOMEDS_AttributeTableOfReal_i::SetRow(CORBA::Long theRow, const SALOMEDS::DoubleSeq& theData) throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength, SALOMEDS::AttributeTableOfReal::IncorrectIndex) { + SALOMEDS::Locker lock; + Unexpect aCatch(ATR_IncorrectArgumentLength); CheckLocked(); Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr); @@ -201,6 +231,8 @@ void SALOMEDS_AttributeTableOfReal_i::SetRow(CORBA::Long theRow, const SALOMEDS: SALOMEDS::DoubleSeq* SALOMEDS_AttributeTableOfReal_i::GetRow(CORBA::Long theRow) throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex) { + SALOMEDS::Locker lock; + Unexpect aCatch(ATR_IncorrectIndex); Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr); if (theRow <= 0 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfReal::IncorrectIndex(); @@ -217,6 +249,8 @@ SALOMEDS::DoubleSeq* SALOMEDS_AttributeTableOfReal_i::GetRow(CORBA::Long theRow) void SALOMEDS_AttributeTableOfReal_i::AddColumn(const SALOMEDS::DoubleSeq& theData) throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength) { + SALOMEDS::Locker lock; + Unexpect aCatch(ATR_IncorrectArgumentLength); CheckLocked(); Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr); @@ -229,6 +263,8 @@ void SALOMEDS_AttributeTableOfReal_i::AddColumn(const SALOMEDS::DoubleSeq& theDa void SALOMEDS_AttributeTableOfReal_i::SetColumn(CORBA::Long theColumn, const SALOMEDS::DoubleSeq& theData) throw (SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength, SALOMEDS::AttributeTableOfReal::IncorrectIndex) { + SALOMEDS::Locker lock; + Unexpect aCatch(ATR_IncorrectArgumentLength); CheckLocked(); Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr); @@ -241,6 +277,8 @@ void SALOMEDS_AttributeTableOfReal_i::SetColumn(CORBA::Long theColumn, const SAL SALOMEDS::DoubleSeq* SALOMEDS_AttributeTableOfReal_i::GetColumn(CORBA::Long theColumn) throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex) { + SALOMEDS::Locker lock; + Unexpect aCatch(ATR_IncorrectIndex); Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr); if (theColumn <= 0 || theColumn > aTable->GetNbColumns()) throw SALOMEDS::AttributeTableOfReal::IncorrectIndex(); @@ -257,6 +295,8 @@ SALOMEDS::DoubleSeq* SALOMEDS_AttributeTableOfReal_i::GetColumn(CORBA::Long theC void SALOMEDS_AttributeTableOfReal_i::PutValue(CORBA::Double theValue, CORBA::Long theRow, CORBA::Long theColumn) throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex) { + SALOMEDS::Locker lock; + Unexpect aCatch(ATR_IncorrectIndex); CheckLocked(); Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr); @@ -265,12 +305,16 @@ void SALOMEDS_AttributeTableOfReal_i::PutValue(CORBA::Double theValue, CORBA::Lo } CORBA::Boolean SALOMEDS_AttributeTableOfReal_i::HasValue(CORBA::Long theRow, CORBA::Long theColumn) { + SALOMEDS::Locker lock; + return Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr)->HasValue(theRow, theColumn); } CORBA::Double SALOMEDS_AttributeTableOfReal_i::GetValue(CORBA::Long theRow, CORBA::Long theColumn) throw (SALOMEDS::AttributeTableOfReal::IncorrectIndex) { + SALOMEDS::Locker lock; + Unexpect aCatch(ATR_IncorrectIndex); Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr); if (theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfReal::IncorrectIndex(); @@ -290,6 +334,8 @@ CORBA::Double SALOMEDS_AttributeTableOfReal_i::GetValue(CORBA::Long theRow, CORB SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfReal_i::GetRowSetIndices(CORBA::Long theRow) { + SALOMEDS::Locker lock; + Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr); if(theRow <= 0 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfReal::IncorrectIndex(); @@ -306,12 +352,16 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfReal_i::GetRowSetIndices(CORBA::Long void SALOMEDS_AttributeTableOfReal_i::SetNbColumns(CORBA::Long theNbColumns) { + SALOMEDS::Locker lock; + Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr); aTable->SetNbColumns(theNbColumns); } bool SALOMEDS_AttributeTableOfReal_i::ReadFromFile(const SALOMEDS::TMPFile& theStream) { + SALOMEDS::Locker lock; + Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr); istrstream aStream((char*)&theStream[0], theStream.length()); @@ -320,6 +370,8 @@ bool SALOMEDS_AttributeTableOfReal_i::ReadFromFile(const SALOMEDS::TMPFile& theS SALOMEDS::TMPFile* SALOMEDS_AttributeTableOfReal_i::SaveToFile() { + SALOMEDS::Locker lock; + Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr); ostrstream ostr; @@ -339,6 +391,8 @@ SALOMEDS::TMPFile* SALOMEDS_AttributeTableOfReal_i::SaveToFile() } char* SALOMEDS_AttributeTableOfReal_i::Store() { + SALOMEDS::Locker lock; + Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr); ostrstream ostr; @@ -350,6 +404,8 @@ char* SALOMEDS_AttributeTableOfReal_i::Store() { } void SALOMEDS_AttributeTableOfReal_i::Restore(const char* value) { + SALOMEDS::Locker lock; + Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(_myAttr); istrstream aStream(value, strlen(value)); diff --git a/src/SALOMEDS/SALOMEDS_AttributeTableOfString_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeTableOfString_i.cxx index 8527cf8db..d127ceb2d 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTableOfString_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTableOfString_i.cxx @@ -13,12 +13,12 @@ #include #include -#include #include #include #include "SALOMEDS_AttributeTableOfString_i.hxx" +#include "SALOMEDS.hxx" #include "Utils_ExceptHandlers.hxx" @@ -47,6 +47,8 @@ static TCollection_ExtendedString getTitle(TCollection_ExtendedString theString) } void SALOMEDS_AttributeTableOfString_i::SetTitle(const char* theTitle) { + SALOMEDS::Locker lock; + CheckLocked(); Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr); CORBA::String_var aStr = CORBA::string_dup(theTitle); @@ -54,6 +56,8 @@ void SALOMEDS_AttributeTableOfString_i::SetTitle(const char* theTitle) { } char* SALOMEDS_AttributeTableOfString_i::GetTitle() { + SALOMEDS::Locker lock; + Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr); CORBA::String_var c_s = CORBA::string_dup(TCollection_AsciiString(aTable->GetTitle()).ToCString()); return c_s._retn(); @@ -62,6 +66,8 @@ char* SALOMEDS_AttributeTableOfString_i::GetTitle() { void SALOMEDS_AttributeTableOfString_i::SetRowTitle(CORBA::Long theIndex, const char* theTitle) throw (SALOMEDS::AttributeTableOfString::IncorrectIndex) { + SALOMEDS::Locker lock; + Unexpect aCatch(ATS_IncorrectIndex); CheckLocked(); Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr); @@ -80,6 +86,8 @@ void SALOMEDS_AttributeTableOfString_i::SetRowTitle(CORBA::Long theIndex, const void SALOMEDS_AttributeTableOfString_i::SetRowTitles(const SALOMEDS::StringSeq& theTitles) throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength) { + SALOMEDS::Locker lock; + Unexpect aCatch(ATS_IncorrectArgumentLength); CheckLocked(); Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr); @@ -90,6 +98,8 @@ void SALOMEDS_AttributeTableOfString_i::SetRowTitles(const SALOMEDS::StringSeq& } SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfString_i::GetRowTitles() { + SALOMEDS::Locker lock; + Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr); SALOMEDS::StringSeq_var aTitles = new SALOMEDS::StringSeq; aTitles->length(aTable->GetNbRows()); @@ -101,6 +111,8 @@ SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfString_i::GetRowTitles() { void SALOMEDS_AttributeTableOfString_i::SetColumnTitle(CORBA::Long theIndex, const char* theTitle) throw (SALOMEDS::AttributeTableOfString::IncorrectIndex) { + SALOMEDS::Locker lock; + Unexpect aCatch(ATS_IncorrectIndex); CheckLocked(); Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr); @@ -112,6 +124,8 @@ void SALOMEDS_AttributeTableOfString_i::SetColumnTitle(CORBA::Long theIndex, con void SALOMEDS_AttributeTableOfString_i::SetColumnTitles(const SALOMEDS::StringSeq& theTitles) throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength) { + SALOMEDS::Locker lock; + Unexpect aCatch(ATS_IncorrectArgumentLength); CheckLocked(); Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr); @@ -122,6 +136,8 @@ void SALOMEDS_AttributeTableOfString_i::SetColumnTitles(const SALOMEDS::StringSe } SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfString_i::GetColumnTitles() { + SALOMEDS::Locker lock; + Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr); SALOMEDS::StringSeq_var aTitles = new SALOMEDS::StringSeq; aTitles->length(aTable->GetNbColumns()); @@ -134,6 +150,8 @@ SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfString_i::GetColumnTitles() { void SALOMEDS_AttributeTableOfString_i::SetRowUnit(CORBA::Long theIndex, const char* theUnit) throw (SALOMEDS::AttributeTableOfString::IncorrectIndex) { + SALOMEDS::Locker lock; + Unexpect aCatch(ATS_IncorrectIndex); CheckLocked(); Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr); @@ -149,6 +167,8 @@ void SALOMEDS_AttributeTableOfString_i::SetRowUnit(CORBA::Long theIndex, const c void SALOMEDS_AttributeTableOfString_i::SetRowUnits(const SALOMEDS::StringSeq& theUnits) throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength) { + SALOMEDS::Locker lock; + Unexpect aCatch(ATS_IncorrectArgumentLength); CheckLocked(); Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr); @@ -159,6 +179,8 @@ void SALOMEDS_AttributeTableOfString_i::SetRowUnits(const SALOMEDS::StringSeq& t } SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfString_i::GetRowUnits() { + SALOMEDS::Locker lock; + Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr); SALOMEDS::StringSeq_var aUnits = new SALOMEDS::StringSeq; aUnits->length(aTable->GetNbRows()); @@ -169,15 +191,21 @@ SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfString_i::GetRowUnits() { CORBA::Long SALOMEDS_AttributeTableOfString_i::GetNbRows() { + SALOMEDS::Locker lock; + return Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr)->GetNbRows(); } CORBA::Long SALOMEDS_AttributeTableOfString_i::GetNbColumns() { + SALOMEDS::Locker lock; + return Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr)->GetNbColumns(); } void SALOMEDS_AttributeTableOfString_i::AddRow(const SALOMEDS::StringSeq& theData) throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength) { + SALOMEDS::Locker lock; + Unexpect aCatch(ATS_IncorrectArgumentLength); CheckLocked(); Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr); @@ -190,6 +218,8 @@ void SALOMEDS_AttributeTableOfString_i::AddRow(const SALOMEDS::StringSeq& theDat void SALOMEDS_AttributeTableOfString_i::SetRow(CORBA::Long theRow, const SALOMEDS::StringSeq& theData) throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength, SALOMEDS::AttributeTableOfString::IncorrectIndex) { + SALOMEDS::Locker lock; + Unexpect aCatch(ATS_IncorrectArgumentLength); CheckLocked(); Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr); @@ -202,6 +232,8 @@ void SALOMEDS_AttributeTableOfString_i::SetRow(CORBA::Long theRow, const SALOMED SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfString_i::GetRow(CORBA::Long theRow) throw (SALOMEDS::AttributeTableOfString::IncorrectIndex) { + SALOMEDS::Locker lock; + Unexpect aCatch(ATS_IncorrectIndex); Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr); if (theRow <= 0 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfString::IncorrectIndex(); @@ -218,6 +250,8 @@ SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfString_i::GetRow(CORBA::Long theRo void SALOMEDS_AttributeTableOfString_i::AddColumn(const SALOMEDS::StringSeq& theData) throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength) { + SALOMEDS::Locker lock; + Unexpect aCatch(ATS_IncorrectArgumentLength); CheckLocked(); Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr); @@ -230,6 +264,8 @@ void SALOMEDS_AttributeTableOfString_i::AddColumn(const SALOMEDS::StringSeq& the void SALOMEDS_AttributeTableOfString_i::SetColumn(CORBA::Long theColumn, const SALOMEDS::StringSeq& theData) throw (SALOMEDS::AttributeTableOfString::IncorrectArgumentLength, SALOMEDS::AttributeTableOfString::IncorrectIndex) { + SALOMEDS::Locker lock; + Unexpect aCatch(ATS_IncorrectArgumentLength); CheckLocked(); Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr); @@ -242,6 +278,8 @@ void SALOMEDS_AttributeTableOfString_i::SetColumn(CORBA::Long theColumn, const S SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfString_i::GetColumn(CORBA::Long theColumn) throw (SALOMEDS::AttributeTableOfString::IncorrectIndex) { + SALOMEDS::Locker lock; + Unexpect aCatch(ATS_IncorrectIndex); Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr); if (theColumn <= 0 || theColumn > aTable->GetNbColumns()) throw SALOMEDS::AttributeTableOfString::IncorrectIndex(); @@ -258,6 +296,8 @@ SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfString_i::GetColumn(CORBA::Long th void SALOMEDS_AttributeTableOfString_i::PutValue(const char* theValue, CORBA::Long theRow, CORBA::Long theColumn) throw (SALOMEDS::AttributeTableOfString::IncorrectIndex) { + SALOMEDS::Locker lock; + Unexpect aCatch(ATS_IncorrectIndex); CheckLocked(); Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr); @@ -267,12 +307,16 @@ void SALOMEDS_AttributeTableOfString_i::PutValue(const char* theValue, CORBA::Lo } CORBA::Boolean SALOMEDS_AttributeTableOfString_i::HasValue(CORBA::Long theRow, CORBA::Long theColumn) { + SALOMEDS::Locker lock; + return Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr)->HasValue(theRow, theColumn); } char* SALOMEDS_AttributeTableOfString_i::GetValue(CORBA::Long theRow, CORBA::Long theColumn) throw (SALOMEDS::AttributeTableOfString::IncorrectIndex) { + SALOMEDS::Locker lock; + Unexpect aCatch(ATS_IncorrectIndex); Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr); if (theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfString::IncorrectIndex(); @@ -292,6 +336,8 @@ char* SALOMEDS_AttributeTableOfString_i::GetValue(CORBA::Long theRow, CORBA::Lon SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfString_i::GetRowSetIndices(CORBA::Long theRow) { + SALOMEDS::Locker lock; + Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr); if(theRow <= 0 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfString::IncorrectIndex(); @@ -308,12 +354,16 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfString_i::GetRowSetIndices(CORBA::Lo void SALOMEDS_AttributeTableOfString_i::SetNbColumns(CORBA::Long theNbColumns) { + SALOMEDS::Locker lock; + Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr); aTable->SetNbColumns(theNbColumns); } bool SALOMEDS_AttributeTableOfString_i::ReadFromFile(const SALOMEDS::TMPFile& theStream) { + SALOMEDS::Locker lock; + Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr); istrstream aStream((char*)&theStream[0], theStream.length()); @@ -322,6 +372,8 @@ bool SALOMEDS_AttributeTableOfString_i::ReadFromFile(const SALOMEDS::TMPFile& th SALOMEDS::TMPFile* SALOMEDS_AttributeTableOfString_i::SaveToFile() { + SALOMEDS::Locker lock; + Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr); ostrstream ostr; @@ -333,6 +385,8 @@ SALOMEDS::TMPFile* SALOMEDS_AttributeTableOfString_i::SaveToFile() } char* SALOMEDS_AttributeTableOfString_i::Store() { + SALOMEDS::Locker lock; + Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr); ostrstream ostr; @@ -344,6 +398,8 @@ char* SALOMEDS_AttributeTableOfString_i::Store() { } void SALOMEDS_AttributeTableOfString_i::Restore(const char* value) { + SALOMEDS::Locker lock; + Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(_myAttr); istrstream aStream(value, strlen(value)); diff --git a/src/SALOMEDS/SALOMEDS_AttributeTarget_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeTarget_i.cxx index 70f7b81b9..0f44433b9 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTarget_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTarget_i.cxx @@ -33,17 +33,22 @@ #include "SALOMEDS_AttributeTarget_i.hxx" #include "SALOMEDS_SObject_i.hxx" +#include "SALOMEDS.hxx" using namespace std; void SALOMEDS_AttributeTarget_i::Add(SALOMEDS::SObject_ptr anObject) { + SALOMEDS::Locker lock; + TDF_Label aLabel; TDF_Tool::Label(_myAttr->Label().Data(),anObject->GetID(),aLabel,1); _myAttr->Append(aLabel); } SALOMEDS::Study::ListOfSObject* SALOMEDS_AttributeTarget_i::Get() { + SALOMEDS::Locker lock; + TDF_LabelList aLList; _myAttr->Get(aLList); @@ -63,6 +68,8 @@ SALOMEDS::Study::ListOfSObject* SALOMEDS_AttributeTarget_i::Get() { } void SALOMEDS_AttributeTarget_i::Remove(SALOMEDS::SObject_ptr anObject) { + SALOMEDS::Locker lock; + TDF_Label aLabel; CORBA::String_var anID = anObject->GetID(); TDF_Tool::Label(_myAttr->Label().Data(),anID.inout(),aLabel,1); diff --git a/src/SALOMEDS/SALOMEDS_AttributeTextColor_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeTextColor_i.cxx index 32a79e68c..74135d0ab 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTextColor_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTextColor_i.cxx @@ -27,11 +27,15 @@ // $Header$ #include "SALOMEDS_AttributeTextColor_i.hxx" +#include "SALOMEDS.hxx" + #include using namespace std; SALOMEDS::Color SALOMEDS_AttributeTextColor_i::TextColor() { + SALOMEDS::Locker lock; + SALOMEDS::Color TextColor; Handle(TColStd_HArray1OfReal) anArray = Handle(SALOMEDS_TextColorAttribute)::DownCast(_myAttr)->Array(); if (anArray.IsNull() || anArray->Length()!=3) { @@ -48,6 +52,8 @@ SALOMEDS::Color SALOMEDS_AttributeTextColor_i::TextColor() { } void SALOMEDS_AttributeTextColor_i::SetTextColor(const SALOMEDS::Color& value) { + SALOMEDS::Locker lock; + CheckLocked(); Handle(TColStd_HArray1OfReal) anArray = new TColStd_HArray1OfReal(1,3); anArray->SetValue(1, value.R); @@ -57,6 +63,8 @@ void SALOMEDS_AttributeTextColor_i::SetTextColor(const SALOMEDS::Color& value) { } char* SALOMEDS_AttributeTextColor_i::Store() { + SALOMEDS::Locker lock; + SALOMEDS::Color aColor = TextColor(); char *Val = new char[75]; sprintf(Val, "%f %f %f", (float)aColor.R, (float)aColor.G, (float)aColor.B); @@ -64,6 +72,8 @@ char* SALOMEDS_AttributeTextColor_i::Store() { } void SALOMEDS_AttributeTextColor_i::Restore(const char* value) { + SALOMEDS::Locker lock; + SALOMEDS::Color aColor; float r, g, b; sscanf(value, "%f %f %f", &r, &g, &b); diff --git a/src/SALOMEDS/SALOMEDS_AttributeTextHighlightColor_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeTextHighlightColor_i.cxx index 672d81c45..d447ee516 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTextHighlightColor_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTextHighlightColor_i.cxx @@ -27,11 +27,15 @@ // $Header$ #include "SALOMEDS_AttributeTextHighlightColor_i.hxx" +#include "SALOMEDS.hxx" + #include using namespace std; SALOMEDS::Color SALOMEDS_AttributeTextHighlightColor_i::TextHighlightColor() { + SALOMEDS::Locker lock; + SALOMEDS::Color TextHighlightColor; Handle(TColStd_HArray1OfReal) anArray = Handle(SALOMEDS_TextHighlightColorAttribute)::DownCast(_myAttr)->Array(); if (anArray.IsNull() || anArray->Length()!=3) { @@ -48,6 +52,8 @@ SALOMEDS::Color SALOMEDS_AttributeTextHighlightColor_i::TextHighlightColor() { } void SALOMEDS_AttributeTextHighlightColor_i::SetTextHighlightColor(const SALOMEDS::Color& value) { + SALOMEDS::Locker lock; + CheckLocked(); Handle(TColStd_HArray1OfReal) anArray = new TColStd_HArray1OfReal(1,3); anArray->SetValue(1, value.R); @@ -57,6 +63,8 @@ void SALOMEDS_AttributeTextHighlightColor_i::SetTextHighlightColor(const SALOMED } char* SALOMEDS_AttributeTextHighlightColor_i::Store() { + SALOMEDS::Locker lock; + SALOMEDS::Color aColor = TextHighlightColor(); char *Val = new char[75]; sprintf(Val, "%f %f %f", (float)aColor.R, (float)aColor.G, (float)aColor.B); @@ -64,6 +72,8 @@ char* SALOMEDS_AttributeTextHighlightColor_i::Store() { } void SALOMEDS_AttributeTextHighlightColor_i::Restore(const char* value) { + SALOMEDS::Locker lock; + SALOMEDS::Color aColor; float r, g, b; sscanf(value, "%f %f %f", &r, &g, &b); diff --git a/src/SALOMEDS/SALOMEDS_AttributeTreeNode_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeTreeNode_i.cxx index 15449d603..81c00aaf2 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTreeNode_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTreeNode_i.cxx @@ -30,6 +30,7 @@ #include #include "SALOMEDS_AttributeTreeNode_i.hxx" +#include "SALOMEDS.hxx" #include "utilities.h" @@ -55,118 +56,166 @@ static Handle(TDataStd_TreeNode) GetNode(SALOMEDS::AttributeTreeNode_ptr value, } void SALOMEDS_AttributeTreeNode_i::SetFather(SALOMEDS::AttributeTreeNode_ptr theValue) { + SALOMEDS::Locker lock; + CheckLocked(); _myAttr->SetFather(GetNode(theValue,_myAttr)); } CORBA::Boolean SALOMEDS_AttributeTreeNode_i::HasFather() { + SALOMEDS::Locker lock; + return _myAttr->HasFather(); } SALOMEDS::AttributeTreeNode_ptr SALOMEDS_AttributeTreeNode_i::GetFather() { + SALOMEDS::Locker lock; + SALOMEDS_AttributeTreeNode_i* aTreeNode = new SALOMEDS_AttributeTreeNode_i(_myAttr->Father(),_mySObject); return aTreeNode->_this(); } void SALOMEDS_AttributeTreeNode_i::SetPrevious(SALOMEDS::AttributeTreeNode_ptr theValue) { + SALOMEDS::Locker lock; + CheckLocked(); _myAttr->SetPrevious(GetNode(theValue,_myAttr)); } CORBA::Boolean SALOMEDS_AttributeTreeNode_i::HasPrevious() { + SALOMEDS::Locker lock; + return _myAttr->HasPrevious(); } SALOMEDS::AttributeTreeNode_ptr SALOMEDS_AttributeTreeNode_i::GetPrevious() { + SALOMEDS::Locker lock; + SALOMEDS_AttributeTreeNode_i* aTreeNode = new SALOMEDS_AttributeTreeNode_i(_myAttr->Previous(),_mySObject); return aTreeNode->_this(); } void SALOMEDS_AttributeTreeNode_i::SetNext(SALOMEDS::AttributeTreeNode_ptr theValue) { + SALOMEDS::Locker lock; + CheckLocked(); _myAttr->SetNext(GetNode(theValue,_myAttr)); } CORBA::Boolean SALOMEDS_AttributeTreeNode_i::HasNext() { + SALOMEDS::Locker lock; + return _myAttr->HasNext(); } SALOMEDS::AttributeTreeNode_ptr SALOMEDS_AttributeTreeNode_i::GetNext() { + SALOMEDS::Locker lock; + SALOMEDS_AttributeTreeNode_i* aTreeNode = new SALOMEDS_AttributeTreeNode_i(_myAttr->Next(),_mySObject); return aTreeNode->_this(); } void SALOMEDS_AttributeTreeNode_i::SetFirst(SALOMEDS::AttributeTreeNode_ptr theValue) { + SALOMEDS::Locker lock; + CheckLocked(); _myAttr->SetFirst(GetNode(theValue,_myAttr)); } CORBA::Boolean SALOMEDS_AttributeTreeNode_i::HasFirst() { + SALOMEDS::Locker lock; + return _myAttr->HasFirst(); } SALOMEDS::AttributeTreeNode_ptr SALOMEDS_AttributeTreeNode_i::GetFirst() { + SALOMEDS::Locker lock; + SALOMEDS_AttributeTreeNode_i* aTreeNode = new SALOMEDS_AttributeTreeNode_i(_myAttr->First(),_mySObject); return aTreeNode->_this(); } void SALOMEDS_AttributeTreeNode_i::SetTreeID(const char* value) { + SALOMEDS::Locker lock; + CheckLocked(); _myAttr->SetTreeID(Standard_GUID(_myAttr->ID())); } char* SALOMEDS_AttributeTreeNode_i::GetTreeID() { + SALOMEDS::Locker lock; + char aGUID[40]; _myAttr->ID().ToCString(aGUID); return CORBA::string_dup(aGUID); } void SALOMEDS_AttributeTreeNode_i::Append(SALOMEDS::AttributeTreeNode_ptr theValue) { + SALOMEDS::Locker lock; + CheckLocked(); _myAttr->Append(GetNode(theValue,_myAttr)); } void SALOMEDS_AttributeTreeNode_i::Prepend(SALOMEDS::AttributeTreeNode_ptr theValue) { + SALOMEDS::Locker lock; + CheckLocked(); _myAttr->Prepend(GetNode(theValue,_myAttr)); } void SALOMEDS_AttributeTreeNode_i::InsertBefore(SALOMEDS::AttributeTreeNode_ptr theValue) { + SALOMEDS::Locker lock; + CheckLocked(); _myAttr->InsertBefore(GetNode(theValue,_myAttr)); } void SALOMEDS_AttributeTreeNode_i::InsertAfter(SALOMEDS::AttributeTreeNode_ptr theValue) { + SALOMEDS::Locker lock; + CheckLocked(); _myAttr->InsertAfter(GetNode(theValue,_myAttr)); } void SALOMEDS_AttributeTreeNode_i::Remove() { + SALOMEDS::Locker lock; + CheckLocked(); _myAttr->Remove(); } CORBA::Long SALOMEDS_AttributeTreeNode_i::Depth() { + SALOMEDS::Locker lock; + return _myAttr->Depth(); } CORBA::Boolean SALOMEDS_AttributeTreeNode_i::IsRoot() { + SALOMEDS::Locker lock; + return _myAttr->IsRoot(); } CORBA::Boolean SALOMEDS_AttributeTreeNode_i::IsDescendant(SALOMEDS::AttributeTreeNode_ptr theValue) { + SALOMEDS::Locker lock; + return _myAttr->IsDescendant(GetNode(theValue,_myAttr)); } CORBA::Boolean SALOMEDS_AttributeTreeNode_i::IsFather(SALOMEDS::AttributeTreeNode_ptr theValue) { + SALOMEDS::Locker lock; + return _myAttr->IsFather(GetNode(theValue,_myAttr)); } CORBA::Boolean SALOMEDS_AttributeTreeNode_i::IsChild(SALOMEDS::AttributeTreeNode_ptr theValue) { + SALOMEDS::Locker lock; + return _myAttr->IsChild(GetNode(theValue,_myAttr)); } @@ -177,6 +226,8 @@ char* SALOMEDS_AttributeTreeNode_i::Label() { } char* SALOMEDS_AttributeTreeNode_i::Store() { + SALOMEDS::Locker lock; + char* aStr[4]; if (HasFather()) aStr[0] = GetFather()->Label(); else aStr[0] = "!"; @@ -192,6 +243,8 @@ char* SALOMEDS_AttributeTreeNode_i::Store() { } void SALOMEDS_AttributeTreeNode_i::Restore(const char* value) { + SALOMEDS::Locker lock; + Handle(TDataStd_TreeNode) aNode = Handle(TDataStd_TreeNode)::DownCast(_myAttr); Handle(TDF_Data) DF = TDocStd_Document::Get(_myAttr->Label())->GetData(); diff --git a/src/SALOMEDS/SALOMEDS_AttributeUserID_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeUserID_i.cxx index 6a3d2d3cd..738365319 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeUserID_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeUserID_i.cxx @@ -27,11 +27,15 @@ // $Header$ #include "SALOMEDS_AttributeUserID_i.hxx" +#include "SALOMEDS.hxx" + #include using namespace std; char* SALOMEDS_AttributeUserID_i::Value() { + SALOMEDS::Locker lock; + char aGUID[40]; Handle(TDataStd_UAttribute)::DownCast(_myAttr)->ID().ToCString(aGUID); CORBA::String_var c_s = CORBA::string_dup(aGUID); @@ -39,6 +43,8 @@ char* SALOMEDS_AttributeUserID_i::Value() { } void SALOMEDS_AttributeUserID_i::SetValue(const char* value) { + SALOMEDS::Locker lock; + CheckLocked(); CORBA::String_var Str = CORBA::string_dup(value); Handle(TDataStd_UAttribute)::DownCast(_myAttr)->SetID(Standard_GUID(Standard_CString(Str))); diff --git a/src/SALOMEDS/SALOMEDS_ChildIterator_i.cxx b/src/SALOMEDS/SALOMEDS_ChildIterator_i.cxx index d256bb669..6bf85d269 100644 --- a/src/SALOMEDS/SALOMEDS_ChildIterator_i.cxx +++ b/src/SALOMEDS/SALOMEDS_ChildIterator_i.cxx @@ -28,6 +28,7 @@ #include +#include "SALOMEDS.hxx" #include "SALOMEDS_ChildIterator_i.hxx" #include "SALOMEDS_SObject_i.hxx" #include "utilities.h" @@ -64,6 +65,8 @@ SALOMEDS_ChildIterator_i::~SALOMEDS_ChildIterator_i() //============================================================================ void SALOMEDS_ChildIterator_i::Init() { + SALOMEDS::Locker lock; + _it.Initialize(_lab); } @@ -74,6 +77,8 @@ void SALOMEDS_ChildIterator_i::Init() //============================================================================ void SALOMEDS_ChildIterator_i::InitEx(CORBA::Boolean theIsAllLevels) { + SALOMEDS::Locker lock; + _it.Initialize(_lab,theIsAllLevels); } @@ -84,6 +89,8 @@ void SALOMEDS_ChildIterator_i::InitEx(CORBA::Boolean theIsAllLevels) //============================================================================ CORBA::Boolean SALOMEDS_ChildIterator_i::More() { + SALOMEDS::Locker lock; + return _it.More(); } @@ -94,6 +101,8 @@ CORBA::Boolean SALOMEDS_ChildIterator_i::More() //============================================================================ void SALOMEDS_ChildIterator_i::Next() { + SALOMEDS::Locker lock; + _it.Next(); } @@ -106,6 +115,8 @@ void SALOMEDS_ChildIterator_i::Next() SALOMEDS::SObject_ptr SALOMEDS_ChildIterator_i::Value() { + SALOMEDS::Locker lock; + return SALOMEDS_SObject_i::NewRef(_study,_it.Value())._retn(); } diff --git a/src/SALOMEDS/SALOMEDS_GenericAttribute_i.cxx b/src/SALOMEDS/SALOMEDS_GenericAttribute_i.cxx index b9a24946a..5e18368b6 100644 --- a/src/SALOMEDS/SALOMEDS_GenericAttribute_i.cxx +++ b/src/SALOMEDS/SALOMEDS_GenericAttribute_i.cxx @@ -12,6 +12,7 @@ #include "SALOMEDS_GenericAttribute_i.hxx" #include "SALOMEDS_SObject_i.hxx" #include "SALOMEDS_Study_i.hxx" +#include "SALOMEDS.hxx" using namespace std; @@ -42,18 +43,24 @@ void SALOMEDS_GenericAttribute_i::Restore(const char*) char* SALOMEDS_GenericAttribute_i::Type() { + SALOMEDS::Locker lock; + return CORBA::string_dup(SALOMEDS::GetType(_myBasicAttr).c_str()); } SALOMEDS::SObject_ptr SALOMEDS_GenericAttribute_i::GetSObject() { - return _mySObject->_this();; + SALOMEDS::Locker lock; + + return _mySObject->_this(); } void SALOMEDS_GenericAttribute_i::CheckLocked() throw (SALOMEDS::GenericAttribute::LockProtection) { + SALOMEDS::Locker lock; + _mySObject->GetStudyServant()->CheckLocked(); } diff --git a/src/SALOMEDS/SALOMEDS_SComponentIterator_i.cxx b/src/SALOMEDS/SALOMEDS_SComponentIterator_i.cxx index adf77476a..61d750cd1 100644 --- a/src/SALOMEDS/SALOMEDS_SComponentIterator_i.cxx +++ b/src/SALOMEDS/SALOMEDS_SComponentIterator_i.cxx @@ -28,6 +28,7 @@ #include "SALOMEDS_SComponentIterator_i.hxx" #include "SALOMEDS_SComponent_i.hxx" +#include "SALOMEDS.hxx" using namespace std; @@ -61,6 +62,8 @@ SALOMEDS_SComponentIterator_i::~SALOMEDS_SComponentIterator_i() //============================================================================ void SALOMEDS_SComponentIterator_i::Init() { + SALOMEDS::Locker lock; + _it.Initialize (_lab); } @@ -71,6 +74,8 @@ void SALOMEDS_SComponentIterator_i::Init() //============================================================================ CORBA::Boolean SALOMEDS_SComponentIterator_i::More() { + SALOMEDS::Locker lock; + if (!_it.More()) return false; TDF_Label L = _it.Value(); @@ -86,6 +91,8 @@ CORBA::Boolean SALOMEDS_SComponentIterator_i::More() //============================================================================ void SALOMEDS_SComponentIterator_i::Next() { + SALOMEDS::Locker lock; + _it.Next(); } @@ -97,6 +104,8 @@ void SALOMEDS_SComponentIterator_i::Next() //============================================================================ SALOMEDS::SComponent_ptr SALOMEDS_SComponentIterator_i::Value() { + SALOMEDS::Locker lock; + return SALOMEDS_SComponent_i::NewRef(_study,_it.Value())._retn(); } diff --git a/src/SALOMEDS/SALOMEDS_SComponent_i.cxx b/src/SALOMEDS/SALOMEDS_SComponent_i.cxx index c9cc82ac6..abb002152 100644 --- a/src/SALOMEDS/SALOMEDS_SComponent_i.cxx +++ b/src/SALOMEDS/SALOMEDS_SComponent_i.cxx @@ -28,6 +28,7 @@ #include "SALOMEDS_SComponent_i.hxx" #include "SALOMEDS_Study_i.hxx" +#include "SALOMEDS.hxx" #include "utilities.h" @@ -98,6 +99,8 @@ SALOMEDS_SComponent_i::~SALOMEDS_SComponent_i() //============================================================================ char* SALOMEDS_SComponent_i::ComponentDataType() { + SALOMEDS::Locker lock; + //DEB // MESSAGE("In SALOMEDS_SComponent_i::ComponentDataType"); // TCollection_AsciiString anEntry; @@ -123,6 +126,8 @@ char* SALOMEDS_SComponent_i::ComponentDataType() //============================================================================ CORBA::Boolean SALOMEDS_SComponent_i::ComponentIOR(CORBA::String_out IOR) { + SALOMEDS::Locker lock; + Handle(SALOMEDS_IORAttribute) ior; if (!_lab.FindAttribute(SALOMEDS_IORAttribute::GetID(),ior) ) return false; diff --git a/src/SALOMEDS/SALOMEDS_SObject_i.cxx b/src/SALOMEDS/SALOMEDS_SObject_i.cxx index 35c5087af..198e1e79e 100644 --- a/src/SALOMEDS/SALOMEDS_SObject_i.cxx +++ b/src/SALOMEDS/SALOMEDS_SObject_i.cxx @@ -44,6 +44,7 @@ #include "SALOMEDS_SObject_i.hxx" //SALOMEDS Headers +#include #include "SALOMEDS_Study_i.hxx" #include "SALOMEDS_StudyManager_i.hxx" #include "SALOMEDS_SComponent_i.hxx" @@ -102,7 +103,6 @@ inline bool operator<(const Standard_GUID& theLeft, const Standard_GUID& theRigh namespace SALOMEDS{ - const char* Str(const TCollection_ExtendedString& theString) { return TCollection_AsciiString(theString).ToCString(); @@ -274,6 +274,8 @@ namespace SALOMEDS{ } } + +//static SALOMEDS::Mutex SObjMutex; //============================================================================ SALOMEDS_Study_i::TSObjectHolder @@ -355,6 +357,8 @@ PortableServer::POA_var SALOMEDS_SObject_i::GetPOA() const //============================================================================ char* SALOMEDS_SObject_i::GetID() { + Locker lock; + TCollection_AsciiString anEntry; TDF_Tool::Entry(_lab,anEntry); return CORBA::string_dup(anEntry.ToCString()); @@ -376,6 +380,8 @@ TDF_Label SALOMEDS_SObject_i::GetFatherComponentLabel() SALOMEDS::SComponent_ptr SALOMEDS_SObject_i::GetFatherComponent() { + Locker lock; + TDF_Label aSCompLabel = GetFatherComponentLabel(); return SALOMEDS_SComponent_i::NewRef(_study,aSCompLabel)._retn(); @@ -388,6 +394,8 @@ SALOMEDS::SComponent_ptr SALOMEDS_SObject_i::GetFatherComponent() //============================================================================ SALOMEDS::SObject_ptr SALOMEDS_SObject_i::GetFather() { + Locker lock; + return SALOMEDS_SObject_i::NewRef(_study,_lab.Father())._retn(); } @@ -408,6 +416,8 @@ SALOMEDS::Study_ptr SALOMEDS_SObject_i::GetStudy() //============================================================================ CORBA::Boolean SALOMEDS_SObject_i::ReferencedObject(SALOMEDS::SObject_out theSObject) { + Locker lock; + Handle(TDF_Reference) aRef; if (!_lab.FindAttribute(TDF_Reference::GetID(),aRef)) return false; @@ -423,6 +433,8 @@ CORBA::Boolean SALOMEDS_SObject_i::ReferencedObject(SALOMEDS::SObject_out theSOb //============================================================================ CORBA::Boolean SALOMEDS_SObject_i::FindSubObject(CORBA::Long theTag, SALOMEDS::SObject_out theSObject) { + Locker lock; + TDF_Label aLabel = _lab.FindChild(theTag,false); if(aLabel.IsNull()) return false; @@ -438,6 +450,8 @@ CORBA::Boolean SALOMEDS_SObject_i::FindSubObject(CORBA::Long theTag, SALOMEDS::S //============================================================================ char* SALOMEDS_SObject_i::Name() { + Locker lock; + return CORBA::string_dup(_name.c_str()); } @@ -448,6 +462,8 @@ char* SALOMEDS_SObject_i::Name() //============================================================================ void SALOMEDS_SObject_i::Name(const char* theName) { + Locker lock; + _name = theName; } @@ -458,6 +474,8 @@ void SALOMEDS_SObject_i::Name(const char* theName) //============================================================================ CORBA::Short SALOMEDS_SObject_i::Tag() { + Locker lock; + return _lab.Tag(); } @@ -468,6 +486,8 @@ CORBA::Short SALOMEDS_SObject_i::Tag() //============================================================================ CORBA::Short SALOMEDS_SObject_i::Depth() { + Locker lock; + return _lab.Depth(); } @@ -478,6 +498,8 @@ CORBA::Short SALOMEDS_SObject_i::Depth() //============================================================================ CORBA::Object_ptr SALOMEDS_SObject_i::GetObject() { + Locker lock; + try { Handle(SALOMEDS_IORAttribute) anAttr; if(_lab.FindAttribute(SALOMEDS_IORAttribute::GetID(),anAttr)){ @@ -495,6 +517,8 @@ CORBA::Object_ptr SALOMEDS_SObject_i::GetObject() */ //============================================================================ char* SALOMEDS_SObject_i::GetName() { + Locker lock; + Handle(TDataStd_Name) anAttr; if(_lab.FindAttribute(TDataStd_Name::GetID(),anAttr)) return CORBA::string_dup(Str(anAttr->Get())); @@ -508,6 +532,8 @@ char* SALOMEDS_SObject_i::GetName() { */ //============================================================================ char* SALOMEDS_SObject_i::GetComment() { + Locker lock; + Handle(TDataStd_Comment) anAttr; if(_lab.FindAttribute(TDataStd_Comment::GetID(), anAttr)) return CORBA::string_dup(Str(anAttr->Get())); @@ -521,6 +547,8 @@ char* SALOMEDS_SObject_i::GetComment() { */ //============================================================================ char* SALOMEDS_SObject_i::GetIOR() { + Locker lock; + Handle(SALOMEDS_IORAttribute) anAttr; if(_lab.FindAttribute(SALOMEDS_IORAttribute::GetID(),anAttr)) return CORBA::string_dup(Str(anAttr->Get())); @@ -544,6 +572,8 @@ SALOMEDS_SObject_i::_FindGenAttribute(const Handle(TDF_Attribute)& theAttr) SALOMEDS::ListOfAttributes* SALOMEDS_SObject_i::GetAllAttributes() { + Locker lock; + SALOMEDS::ListOfAttributes_var aSeqOfAttr = new SALOMEDS::ListOfAttributes; if(_lab.NbAttributes() > 0){ Standard_Integer i = 0; @@ -635,6 +665,8 @@ CORBA::Boolean SALOMEDS_SObject_i::FindAttribute(SALOMEDS::GenericAttribute_out theAttribute, const char* theType) { + Locker lock; + TAttrHolder anAttr = _FindGenAttribute(theType); SALOMEDS::GenericAttribute_var anGenAttr = anAttr.second; if(!CORBA::is_nil(anGenAttr)){ @@ -699,6 +731,8 @@ Handle(TDF_Attribute) SALOMEDS::GenericAttribute_ptr SALOMEDS_SObject_i::FindOrCreateAttribute(const char* theType) { + Locker lock; + TAttrHolder anAttrHolder = _FindGenAttribute(theType); SALOMEDS::GenericAttribute_var anGenAttr = anAttrHolder.second; if(!anGenAttr->_is_nil()) @@ -723,6 +757,8 @@ SALOMEDS_SObject_i::FindOrCreateAttribute(const char* theType) //============================================================================ void SALOMEDS_SObject_i::RemoveAttribute(const char* theType) { + Locker lock; + _study->CheckLocked(); if(strcmp(theType, "AttributeIOR") == 0) { // postponed removing of CORBA objects Handle(SALOMEDS_IORAttribute) anAttr; diff --git a/src/SALOMEDS/SALOMEDS_Server.cxx b/src/SALOMEDS/SALOMEDS_Server.cxx index 70919bba0..ff40576da 100644 --- a/src/SALOMEDS/SALOMEDS_Server.cxx +++ b/src/SALOMEDS/SALOMEDS_Server.cxx @@ -53,9 +53,13 @@ int main(int argc, char** argv) try { // Initialise the ORB. +#if OMNIORB_VERSION >= 4 + const char* options[][2] = { { "giopMaxMsgSize", "104857600" }, { 0, 0 } }; + CORBA::ORB_var orb = CORBA::ORB_init( argc , argv , "omniORB4", options) ; +#else CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, "omniORB3"); omniORB::MaxMessageSize(100 * 1024 * 1024); - // Obtain a reference to the root POA. +#endif // Obtain a reference to the root POA. // long TIMESleep = 500000000; int NumberOfTries = 40; diff --git a/src/SALOMEDS/SALOMEDS_StudyBuilder_i.cxx b/src/SALOMEDS/SALOMEDS_StudyBuilder_i.cxx index 42aefe220..63b5b8bc0 100644 --- a/src/SALOMEDS/SALOMEDS_StudyBuilder_i.cxx +++ b/src/SALOMEDS/SALOMEDS_StudyBuilder_i.cxx @@ -41,6 +41,7 @@ #include "SALOMEDS_StudyPropertiesAttribute.hxx" #include "SALOMEDS_Tool.hxx" +#include "SALOMEDS.hxx" #include "Utils_CorbaException.hxx" #include "Utils_ExceptHandlers.hxx" @@ -115,6 +116,8 @@ PortableServer::POA_var SALOMEDS_StudyBuilder_i::GetPOA() const SALOMEDS::SComponent_ptr SALOMEDS_StudyBuilder_i::NewComponent(const char* DataType) { + SALOMEDS::Locker lock; + CheckLocked(); //Always create component under main label. TDF_Label L = _doc->Main(); @@ -147,6 +150,8 @@ SALOMEDS_StudyBuilder_i::NewComponent(const char* DataType) void SALOMEDS_StudyBuilder_i::DefineComponentInstance(SALOMEDS::SComponent_ptr theComponent, CORBA::Object_ptr theObject) { + SALOMEDS::Locker lock; + CheckLocked(); if(CORBA::is_nil(theComponent) || CORBA::is_nil(theObject)) @@ -170,6 +175,8 @@ void SALOMEDS_StudyBuilder_i::DefineComponentInstance(SALOMEDS::SComponent_ptr t void SALOMEDS_StudyBuilder_i::RemoveComponent(SALOMEDS::SComponent_ptr theComponent) { + SALOMEDS::Locker lock; + CheckLocked(); RemoveObject(theComponent); } @@ -182,6 +189,8 @@ SALOMEDS_StudyBuilder_i::RemoveComponent(SALOMEDS::SComponent_ptr theComponent) SALOMEDS::SObject_ptr SALOMEDS_StudyBuilder_i::NewObject(SALOMEDS::SObject_ptr theFatherObject) { + SALOMEDS::Locker lock; + CheckLocked(); if(CORBA::is_nil(theFatherObject)) @@ -220,6 +229,8 @@ SALOMEDS::SObject_ptr SALOMEDS_StudyBuilder_i::NewObjectToTag(SALOMEDS::SObject_ptr theFatherObject, CORBA::Long theTag) { + SALOMEDS::Locker lock; + CheckLocked(); if(CORBA::is_nil(theFatherObject)) @@ -247,6 +258,8 @@ SALOMEDS_StudyBuilder_i::NewObjectToTag(SALOMEDS::SObject_ptr theFatherObject, //============================================================================ void SALOMEDS_StudyBuilder_i::RemoveObject(SALOMEDS::SObject_ptr theSObject) { + SALOMEDS::Locker lock; + RemoveSObject(theSObject); } @@ -276,6 +289,8 @@ SALOMEDS_StudyBuilder_i::RemoveSObject(SALOMEDS::SObject_ptr theSObject, //============================================================================ void SALOMEDS_StudyBuilder_i::RemoveObjectWithChildren(SALOMEDS::SObject_ptr theSObject) { + SALOMEDS::Locker lock; + if(SALOMEDS_SObject_i* aSObject = RemoveSObject(theSObject,false)){ SALOMEDS_ChildIterator_i aChildIter(_study,aSObject->GetLabel(),true); for(; aChildIter.More(); aChildIter.Next()){ @@ -313,9 +328,14 @@ static void Translate_persistentID_to_IOR(TDF_Label theLabel, TCollection_AsciiString ch(res); SALOMEDS::SObject_var aSObject = SALOMEDS_SObject_i::NewRef(theStudy,aCurrentLabel); - + + // PAL8065: san - Translate_persistentID_to_IOR() should always be called from some CORBA method + // protected with a lock + SALOMEDS::unlock(); CORBA::String_var anIOR = theDriver->LocalPersistentIDToIOR(aSObject,ch.ToCString(),theIsMultiFile,theIsASCII); + SALOMEDS::lock(); + SALOMEDS_IORAttribute::Set(aCurrentLabel,const_cast(anIOR.in()),theStudy); } @@ -334,6 +354,8 @@ void SALOMEDS_StudyBuilder_i::LoadWith(SALOMEDS::SComponent_ptr theSComponent, SALOMEDS::Driver_ptr theDriver) throw(SALOME::SALOME_Exception) { + SALOMEDS::Locker lock; + Unexpect aCatch(SBSalomeException); if(CORBA::is_nil(theSComponent)) @@ -414,9 +436,12 @@ void SALOMEDS_StudyBuilder_i::LoadWith(SALOMEDS::SComponent_ptr theSComponent, std::string aDir(aHDFPath.ToCString()); aDir = aDir.substr(0,aDir.rfind('/') + 1); + SALOMEDS::unlock(); CORBA::Boolean aResult = (ASCIIfileState[0]=='A')? theDriver->LoadASCII(theSComponent, aStreamFile.in(), aDir.c_str(), aMultifileState[0]=='M'): theDriver->Load(theSComponent, aStreamFile.in(), aDir.c_str(), aMultifileState[0]=='M'); + SALOMEDS::lock(); + if(!aResult) { RemoveAttribute( theSComponent, "AttributeIOR" ); if (isASCII) { @@ -498,6 +523,8 @@ SALOMEDS::GenericAttribute_ptr SALOMEDS_StudyBuilder_i::FindOrCreateAttribute(SALOMEDS::SObject_ptr theObject, const char* theTypeOfAttribute) { + SALOMEDS::Locker lock; + if(SALOMEDS_SObject_i* aSObject = _study->DownCast(theObject)) return aSObject->FindOrCreateAttribute(theTypeOfAttribute); @@ -514,6 +541,8 @@ CORBA::Boolean SALOMEDS_StudyBuilder_i::FindAttribute(SALOMEDS::SObject_ptr theO SALOMEDS::GenericAttribute_out theAttr, const char* theTypeOfAttribute) { + SALOMEDS::Locker lock; + if(SALOMEDS_SObject_i* aSObject = _study->DownCast(theObject)) return aSObject->FindAttribute(theAttr,theTypeOfAttribute); @@ -529,6 +558,8 @@ CORBA::Boolean SALOMEDS_StudyBuilder_i::FindAttribute(SALOMEDS::SObject_ptr theO void SALOMEDS_StudyBuilder_i::RemoveAttribute(SALOMEDS::SObject_ptr theSObject, const char* aTypeOfAttribute) { + SALOMEDS::Locker lock; + CheckLocked(); if(CORBA::is_nil(theSObject)) @@ -558,6 +589,8 @@ void SALOMEDS_StudyBuilder_i::Addreference(SALOMEDS::SObject_ptr me, SALOMEDS::SObject_ptr theReferencedObject) { + SALOMEDS::Locker lock; + CheckLocked(); if(CORBA::is_nil(me) || CORBA::is_nil(theReferencedObject)) return; @@ -584,6 +617,8 @@ SALOMEDS_StudyBuilder_i::Addreference(SALOMEDS::SObject_ptr me, //============================================================================ void SALOMEDS_StudyBuilder_i::RemoveReference(SALOMEDS::SObject_ptr me) { + SALOMEDS::Locker lock; + SALOMEDS::SObject_var theReferencedObject; if(!me->ReferencedObject(theReferencedObject)) return; //No reference is found @@ -613,6 +648,8 @@ void SALOMEDS_StudyBuilder_i::RemoveReference(SALOMEDS::SObject_ptr me) //============================================================================ void SALOMEDS_StudyBuilder_i::AddDirectory(const char* thePath) { + SALOMEDS::Locker lock; + CheckLocked(); if(thePath == NULL || strlen(thePath) == 0) throw SALOMEDS::Study::StudyInvalidDirectory(); @@ -679,6 +716,8 @@ void SALOMEDS_StudyBuilder_i::AddDirectory(const char* thePath) //============================================================================ void SALOMEDS_StudyBuilder_i::SetGUID(SALOMEDS::SObject_ptr anObject, const char* theGUID) { + SALOMEDS::Locker lock; + CheckLocked(); if(CORBA::is_nil(anObject)) @@ -697,6 +736,8 @@ void SALOMEDS_StudyBuilder_i::SetGUID(SALOMEDS::SObject_ptr anObject, const char //============================================================================ bool SALOMEDS_StudyBuilder_i::IsGUID(SALOMEDS::SObject_ptr anObject, const char* theGUID) { + SALOMEDS::Locker lock; + if(CORBA::is_nil(anObject)) return false; @@ -714,6 +755,8 @@ bool SALOMEDS_StudyBuilder_i::IsGUID(SALOMEDS::SObject_ptr anObject, const char* //============================================================================ void SALOMEDS_StudyBuilder_i::NewCommand() { + SALOMEDS::Locker lock; + // mpv: for SAL2114 - unset "lock changed" flag at the operation start Handle(SALOMEDS_StudyPropertiesAttribute) anAttr; if (!_doc->Main().FindAttribute(SALOMEDS_StudyPropertiesAttribute::GetID(), anAttr)) { @@ -732,6 +775,8 @@ void SALOMEDS_StudyBuilder_i::NewCommand() //============================================================================ void SALOMEDS_StudyBuilder_i::CommitCommand() throw (SALOMEDS::StudyBuilder::LockProtection) { + SALOMEDS::Locker lock; + Unexpect aCatch(SBLockProtection); Handle(SALOMEDS_StudyPropertiesAttribute) anAttr; if (!_doc->Main().FindAttribute(SALOMEDS_StudyPropertiesAttribute::GetID(), anAttr)) { @@ -759,6 +804,8 @@ void SALOMEDS_StudyBuilder_i::CommitCommand() throw (SALOMEDS::StudyBuilder::Loc //============================================================================ CORBA::Boolean SALOMEDS_StudyBuilder_i::HasOpenCommand() { + SALOMEDS::Locker lock; + return _doc->HasOpenCommand(); } @@ -769,6 +816,8 @@ CORBA::Boolean SALOMEDS_StudyBuilder_i::HasOpenCommand() //============================================================================ void SALOMEDS_StudyBuilder_i::AbortCommand() { + SALOMEDS::Locker lock; + _study->UndoPostponed(0); _doc->AbortCommand(); @@ -781,6 +830,8 @@ void SALOMEDS_StudyBuilder_i::AbortCommand() //============================================================================ void SALOMEDS_StudyBuilder_i::Undo() throw (SALOMEDS::StudyBuilder::LockProtection) { + SALOMEDS::Locker lock; + Unexpect aCatch(SBLockProtection); Handle(SALOMEDS_StudyPropertiesAttribute) anAttr; if (!_doc->Main().FindAttribute(SALOMEDS_StudyPropertiesAttribute::GetID(), anAttr)) { @@ -803,7 +854,9 @@ void SALOMEDS_StudyBuilder_i::Undo() throw (SALOMEDS::StudyBuilder::LockProtecti */ //============================================================================ void SALOMEDS_StudyBuilder_i::Redo() throw (SALOMEDS::StudyBuilder::LockProtection) -{ +{ + SALOMEDS::Locker lock; + Unexpect aCatch(SBLockProtection); Handle(SALOMEDS_StudyPropertiesAttribute) anAttr; if (!_doc->Main().FindAttribute(SALOMEDS_StudyPropertiesAttribute::GetID(), anAttr)) { @@ -828,6 +881,8 @@ void SALOMEDS_StudyBuilder_i::Redo() throw (SALOMEDS::StudyBuilder::LockProtecti //============================================================================ CORBA::Boolean SALOMEDS_StudyBuilder_i::GetAvailableUndos() { + SALOMEDS::Locker lock; + return _doc->GetAvailableUndos(); } @@ -838,6 +893,8 @@ CORBA::Boolean SALOMEDS_StudyBuilder_i::GetAvailableUndos() //============================================================================ CORBA::Boolean SALOMEDS_StudyBuilder_i::GetAvailableRedos() { + SALOMEDS::Locker lock; + return _doc->GetAvailableRedos(); } @@ -848,6 +905,8 @@ CORBA::Boolean SALOMEDS_StudyBuilder_i::GetAvailableRedos() //============================================================================ CORBA::Long SALOMEDS_StudyBuilder_i::UndoLimit() { + SALOMEDS::Locker lock; + return _doc->GetUndoLimit(); } @@ -858,6 +917,8 @@ CORBA::Long SALOMEDS_StudyBuilder_i::UndoLimit() //============================================================================ void SALOMEDS_StudyBuilder_i::UndoLimit(CORBA::Long n) { + SALOMEDS::Locker lock; + CheckLocked(); _doc->SetUndoLimit (n); } @@ -909,6 +970,8 @@ void SALOMEDS_StudyBuilder_i::CheckLocked() throw (SALOMEDS::StudyBuilder::LockP void SALOMEDS_StudyBuilder_i::SetName(SALOMEDS::SObject_ptr theSO, const char* theValue) throw(SALOMEDS::StudyBuilder::LockProtection) { + SALOMEDS::Locker lock; + Unexpect aCatch(SBLockProtection); CheckLocked(); @@ -930,6 +993,8 @@ void SALOMEDS_StudyBuilder_i::SetName(SALOMEDS::SObject_ptr theSO, const char* t void SALOMEDS_StudyBuilder_i::SetComment(SALOMEDS::SObject_ptr theSO, const char* theValue) throw(SALOMEDS::StudyBuilder::LockProtection) { + SALOMEDS::Locker lock; + Unexpect aCatch(SBLockProtection); CheckLocked(); @@ -951,6 +1016,8 @@ void SALOMEDS_StudyBuilder_i::SetComment(SALOMEDS::SObject_ptr theSO, const char void SALOMEDS_StudyBuilder_i::SetIOR(SALOMEDS::SObject_ptr theSO, const char* theValue) throw(SALOMEDS::StudyBuilder::LockProtection) { + SALOMEDS::Locker lock; + Unexpect aCatch(SBLockProtection); CheckLocked(); diff --git a/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx b/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx index 588019be2..d0464d63f 100644 --- a/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx +++ b/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx @@ -47,6 +47,7 @@ #include #include +#include "SALOMEDS.hxx" #include "SALOMEDS_StudyManager_i.hxx" #include "SALOME_LifeCycleCORBA.hxx" @@ -284,6 +285,8 @@ void SALOMEDS_StudyManager_i::register_name(char * theName) { //============================================================================ SALOMEDS::Study_ptr SALOMEDS_StudyManager_i::NewStudy(const char* theStudyName) { + SALOMEDS::Locker lock; + Handle(TDocStd_Document) aDocument; _OCAFApp->NewDocument("SALOME_STUDY",aDocument); @@ -331,6 +334,8 @@ SALOMEDS::Study_ptr SALOMEDS_StudyManager_i::NewStudy(const char* theStudyName) SALOMEDS::Study_ptr SALOMEDS_StudyManager_i::Open(const char* theURL) throw(SALOME::SALOME_Exception) { + SALOMEDS::Locker lock; + Unexpect aCatch(SalomeException); MESSAGE("Begin of SALOMEDS_StudyManager_i::Open"); @@ -433,6 +438,8 @@ SALOMEDS::Study_ptr SALOMEDS_StudyManager_i::Open(const char* theURL) //============================================================================ void SALOMEDS_StudyManager_i::Close(SALOMEDS::Study_ptr aStudy) { + SALOMEDS::Locker lock; + if(aStudy->_is_nil()) return; aStudy->RemovePostponed(-1); @@ -453,6 +460,8 @@ void SALOMEDS_StudyManager_i::Close(SALOMEDS::Study_ptr aStudy) //============================================================================ void SALOMEDS_StudyManager_i::Save(SALOMEDS::Study_ptr theStudy, CORBA::Boolean theMultiFile) { + SALOMEDS::Locker lock; + CORBA::String_var anURL = theStudy->URL(); if(strcmp(anURL.in(),"") == 0){ MESSAGE( "No path specified to save the study. Nothing done"); @@ -463,6 +472,8 @@ void SALOMEDS_StudyManager_i::Save(SALOMEDS::Study_ptr theStudy, CORBA::Boolean void SALOMEDS_StudyManager_i::SaveASCII(SALOMEDS::Study_ptr theStudy, CORBA::Boolean theMultiFile) { + SALOMEDS::Locker lock; + CORBA::String_var anURL = theStudy->URL(); if(strcmp(anURL.in(),"") == 0){ MESSAGE( "No path specified to save the study. Nothing done"); @@ -478,12 +489,16 @@ void SALOMEDS_StudyManager_i::SaveASCII(SALOMEDS::Study_ptr theStudy, CORBA::Boo //============================================================================ void SALOMEDS_StudyManager_i::SaveAs(const char* aUrl, SALOMEDS::Study_ptr theStudy, CORBA::Boolean theMultiFile) { + SALOMEDS::Locker lock; + _SaveAs(aUrl,theStudy,theMultiFile, false); } void SALOMEDS_StudyManager_i::SaveAsASCII(const char* aUrl, SALOMEDS::Study_ptr theStudy, CORBA::Boolean theMultiFile) { + SALOMEDS::Locker lock; + _SaveAs(aUrl,theStudy,theMultiFile, true); } @@ -726,7 +741,10 @@ void SALOMEDS_StudyManager_i::_SaveAs(const char* aUrl, if(!aComp->_is_nil()){ SALOMEDS::Driver_var aDriver = SALOMEDS::Driver::_narrow(aComp); if (!CORBA::is_nil(aDriver)) { + // PAL8065: san - _SaveAs() should always be called from some CORBA method protected with a lock + SALOMEDS::unlock(); SB->LoadWith(sco, aDriver); + SALOMEDS::lock(); } } } @@ -1007,23 +1025,27 @@ std::string SALOMEDS_StudyManager_i::_SubstituteSlash(const char *theUrl) */ //============================================================================ CORBA::Boolean SALOMEDS_StudyManager_i::CanCopy(SALOMEDS::SObject_ptr theObject) { - SALOMEDS::SComponent_var aComponent = theObject->GetFatherComponent(); + SALOMEDS::Driver_var Engine; + { // Guarded block of code + SALOMEDS::Locker lock; - if(aComponent->_is_nil()) - return false; + SALOMEDS::SComponent_var aComponent = theObject->GetFatherComponent(); - if(aComponent == theObject) - return false; + if(aComponent->_is_nil()) + return false; - CORBA::String_var IOREngine; - if(!aComponent->ComponentIOR(IOREngine)) - return false; + if(aComponent == theObject) + return false; - CORBA::Object_var obj = _orb->string_to_object(IOREngine); - SALOMEDS::Driver_var Engine = SALOMEDS::Driver::_narrow(obj) ; - if (CORBA::is_nil(Engine)) - return false; + CORBA::String_var IOREngine; + if(!aComponent->ComponentIOR(IOREngine)) + return false; + CORBA::Object_var obj = _orb->string_to_object(IOREngine); + Engine = SALOMEDS::Driver::_narrow(obj); + if (CORBA::is_nil(Engine)) + return false; + } // End of guarded block of code return Engine->CanCopy(theObject); } @@ -1069,24 +1091,31 @@ void SALOMEDS_StudyManager_i::CopyLabel(SALOMEDS_Study_i* theSourceStudy, continue; } - if (!Handle(SALOMEDS_IORAttribute)::DownCast(anAttr).IsNull()) { // IOR => ID and TMPFile of Engine - TCollection_AsciiString anEntry; - TDF_Tool::Entry(theSource, anEntry); - SALOMEDS::SObject_var aSO = theSourceStudy->FindObjectID(anEntry.ToCString()); - CORBA::Long anObjID; - SALOMEDS::TMPFile_var aStream = theEngine->CopyFrom(aSO, anObjID); - int aLen = aStream->length(); - TCollection_ExtendedString aResStr(""); - for(a = 0; a < aLen; a++) { - aResStr += TCollection_ExtendedString(ToExtCharacter((Standard_Character)aStream[a])); - } - TDataStd_Integer::Set(aAuxTargetLabel, anObjID); - TDataStd_Name::Set(aAuxTargetLabel, aResStr); + if (Handle(SALOMEDS_IORAttribute)::DownCast(anAttr).IsNull()) { // IOR => ID and TMPFile of Engine + Handle(TDF_Attribute) aNewAttribute = anAttr->NewEmpty(); + aTargetLabel.AddAttribute(aNewAttribute); + anAttr->Paste(aNewAttribute, aRT); continue; } - Handle(TDF_Attribute) aNewAttribute = anAttr->NewEmpty(); - aTargetLabel.AddAttribute(aNewAttribute); - anAttr->Paste(aNewAttribute, aRT); + + TCollection_AsciiString anEntry; + TDF_Tool::Entry(theSource, anEntry); + SALOMEDS::SObject_var aSO = theSourceStudy->FindObjectID(anEntry.ToCString()); + CORBA::Long anObjID; + + // PAL8065: san - CopyLabel() should always be called from some CORBA method protected with a lock + SALOMEDS::unlock(); + SALOMEDS::TMPFile_var aStream = theEngine->CopyFrom(aSO, anObjID); + SALOMEDS::lock(); + + int aLen = aStream->length(); + TCollection_ExtendedString aResStr(""); + for(a = 0; a < aLen; a++) { + aResStr += TCollection_ExtendedString(ToExtCharacter((Standard_Character)aStream[a])); + } + TDataStd_Integer::Set(aAuxTargetLabel, anObjID); + TDataStd_Name::Set(aAuxTargetLabel, aResStr); + // aRT->SetRelocation(anAttr, aNewAttribute); } } @@ -1097,6 +1126,8 @@ void SALOMEDS_StudyManager_i::CopyLabel(SALOMEDS_Study_i* theSourceStudy, */ //============================================================================ CORBA::Boolean SALOMEDS_StudyManager_i::Copy(SALOMEDS::SObject_ptr theObject) { + SALOMEDS::Locker lock; + // adoptation for alliances datamodel copy: without IOR attributes !!! // copy only SObjects and attributes without component help SALOMEDS::GenericAttribute_var anAttribute; @@ -1170,28 +1201,37 @@ CORBA::Boolean SALOMEDS_StudyManager_i::Copy(SALOMEDS::SObject_ptr theObject) { */ //============================================================================ CORBA::Boolean SALOMEDS_StudyManager_i::CanPaste(SALOMEDS::SObject_ptr theObject) { - if (_clipboard.IsNull()) return false; + CORBA::String_var aName; + Standard_Integer anID; + SALOMEDS::Driver_var Engine; + { // Guarded block of code + SALOMEDS::Locker lock; - Handle(TDataStd_Comment) aCompName; - if (!_clipboard->Main().Root().FindAttribute(TDataStd_Comment::GetID(), aCompName)) return false; - Handle(TDataStd_Integer) anObjID; - if (!_clipboard->Main().Father().FindChild(2).FindAttribute(TDataStd_Integer::GetID(), anObjID)) - return false; + if (_clipboard.IsNull()) return false; - SALOMEDS::SComponent_var aComponent = theObject->GetFatherComponent(); - if(aComponent->_is_nil()) - return false; + Handle(TDataStd_Comment) aCompName; + if (!_clipboard->Main().Root().FindAttribute(TDataStd_Comment::GetID(), aCompName)) return false; + Handle(TDataStd_Integer) anObjID; + if (!_clipboard->Main().Father().FindChild(2).FindAttribute(TDataStd_Integer::GetID(), anObjID)) + return false; + + SALOMEDS::SComponent_var aComponent = theObject->GetFatherComponent(); + if(aComponent->_is_nil()) + return false; - CORBA::String_var IOREngine; - if(!aComponent->ComponentIOR(IOREngine)) - return false; + CORBA::String_var IOREngine; + if(!aComponent->ComponentIOR(IOREngine)) + return false; - CORBA::Object_var obj = _orb->string_to_object(IOREngine); - SALOMEDS::Driver_var Engine = SALOMEDS::Driver::_narrow(obj) ; - if (CORBA::is_nil(Engine)) - return false; + CORBA::Object_var obj = _orb->string_to_object(IOREngine); + Engine = SALOMEDS::Driver::_narrow(obj) ; + if (CORBA::is_nil(Engine)) + return false; - return Engine->CanPaste(TCollection_AsciiString(aCompName->Get()).ToCString(),anObjID->Get()); + aName = CORBA::string_dup( TCollection_AsciiString(aCompName->Get()).ToCString() ); + anID = anObjID->Get(); + } // End of guarded block of code + return Engine->CanPaste(aName.in(),anID); } //============================================================================ /*! Function : PasteLabel @@ -1241,13 +1281,19 @@ TDF_Label SALOMEDS_StudyManager_i::PasteLabel(SALOMEDS_Study_i* theDestinationSt TDF_Tool::Entry(aTargetLabel, anEntry); SALOMEDS::SObject_var aPastedSO = theDestinationStudy->FindObjectID(anEntry.ToCString()); if(isFirstElement){ + // PAL8065: san - PasteLabel() should always be called from some CORBA method protected with a lock + SALOMEDS::unlock(); SALOMEDS::SObject_var aDestSO = theEngine->PasteInto(aTMPFil.in(), anObjID->Get(), aPastedSO->GetFatherComponent()); + SALOMEDS::lock(); TDF_Tool::Label(theDestinationStart.Data(), aDestSO->GetID(), aTargetLabel); }else + // PAL8065: san - PasteLabel() should always be called from some CORBA method protected with a lock + SALOMEDS::unlock(); theEngine->PasteInto(aTMPFil.in(),anObjID->Get(),aPastedSO); + SALOMEDS::lock(); } } @@ -1299,6 +1345,8 @@ TDF_Label SALOMEDS_StudyManager_i::PasteLabel(SALOMEDS_Study_i* theDestinationSt SALOMEDS::SObject_ptr SALOMEDS_StudyManager_i::Paste(SALOMEDS::SObject_ptr theObject) throw(SALOMEDS::StudyBuilder::LockProtection) { + SALOMEDS::Locker lock; + Unexpect aCatch(LockProtection); PortableServer::ServantBase_var aServant = GetServant(theObject,_poa); diff --git a/src/SALOMEDS/SALOMEDS_Study_i.cxx b/src/SALOMEDS/SALOMEDS_Study_i.cxx index 1f8e0aa75..3b4d5e087 100644 --- a/src/SALOMEDS/SALOMEDS_Study_i.cxx +++ b/src/SALOMEDS/SALOMEDS_Study_i.cxx @@ -40,6 +40,7 @@ #include #include +#include "SALOMEDS.hxx" #include "SALOMEDS_Study_i.hxx" #include "SALOMEDS_StudyManager_i.hxx" @@ -216,6 +217,8 @@ void SALOMEDS_Study_i::OnRemoveSObject(SALOMEDS::SObject_ptr theObject) //============================================================================ void SALOMEDS_Study_i::CheckLocked() { + SALOMEDS::Locker lock; + if(_doc->HasOpenCommand()) return; @@ -247,6 +250,8 @@ CORBA::Object_ptr SALOMEDS_Study_i::ConvertIORToObject(const char* theIOR) //============================================================================ char* SALOMEDS_Study_i::GetPersistentReference() { + SALOMEDS::Locker lock; + return URL(); } //============================================================================ @@ -256,6 +261,8 @@ char* SALOMEDS_Study_i::GetPersistentReference() //============================================================================ char* SALOMEDS_Study_i::GetTransientReference() { + SALOMEDS::Locker lock; + CORBA::String_var IOR; Handle(SALOMEDS_IORAttribute) Att; @@ -277,6 +284,8 @@ char* SALOMEDS_Study_i::GetTransientReference() //============================================================================ CORBA::Boolean SALOMEDS_Study_i::IsEmpty() { + SALOMEDS::Locker lock; + if (_doc.IsNull()) return true; return _doc->IsEmpty(); } @@ -289,6 +298,8 @@ CORBA::Boolean SALOMEDS_Study_i::IsEmpty() SALOMEDS::SComponent_ptr SALOMEDS_Study_i::FindComponent(const char* theComponentName) { + SALOMEDS::Locker lock; + bool anIsFound = false; SALOMEDS::SComponent_var aSComponent; SALOMEDS_SComponentIterator_i aComponentIter(this,_doc); @@ -310,6 +321,8 @@ SALOMEDS_Study_i::FindComponent(const char* theComponentName) //============================================================================ SALOMEDS::SComponent_ptr SALOMEDS_Study_i::FindComponentID(const char* aComponentID) { + SALOMEDS::Locker lock; + // Iterate on each components defined in the study // Get the component ID and compare with aComponentID bool _find = false; @@ -341,6 +354,8 @@ SALOMEDS::SComponent_ptr SALOMEDS_Study_i::FindComponentID(const char* aComponen //============================================================================ SALOMEDS::SObject_ptr SALOMEDS_Study_i::FindObject(const char* theObjectName) { + SALOMEDS::Locker lock; + // Iterate to all components defined in the study // After testing the component name, iterate in all objects defined under // components (function _FindObject) @@ -371,6 +386,8 @@ SALOMEDS::SObject_ptr SALOMEDS_Study_i::FindObject(const char* theObjectName) //============================================================================ SALOMEDS::SObject_ptr SALOMEDS_Study_i::FindObjectID(const char* anObjectID) { + SALOMEDS::Locker lock; + // Convert aSO->GetID in TDF_Label. TDF_Label Lab; TDF_Tool::Label(_doc->GetData(), (char*)anObjectID, Lab); @@ -389,6 +406,8 @@ SALOMEDS::SObject_ptr SALOMEDS_Study_i::FindObjectID(const char* anObjectID) //============================================================================ SALOMEDS::SObject_ptr SALOMEDS_Study_i::CreateObjectID(const char* anObjectID) { + SALOMEDS::Locker lock; + // Convert aSO->GetID in TDF_Label. TDF_Label Lab; TDF_Tool::Label(_doc->GetData(), (char*)anObjectID, Lab, Standard_True); @@ -409,6 +428,8 @@ SALOMEDS::Study::ListOfSObject* SALOMEDS_Study_i::FindObjectByName(const char* theObjectName, const char* theComponentName) { + SALOMEDS::Locker lock; + SALOMEDS::Study::ListOfSObject_var aListOfSObj = new SALOMEDS::Study::ListOfSObject ; aListOfSObj->length(0); @@ -454,6 +475,8 @@ SALOMEDS_Study_i::FindObjectByName(const char* theObjectName, //============================================================================ SALOMEDS::SObject_ptr SALOMEDS_Study_i::FindObjectIOR(const char* theObjectIOR) { + SALOMEDS::Locker lock; + // firstly searching in the datamap for optimization char* anIOR = const_cast(theObjectIOR); if(myIORLabels.IsBound(anIOR)){ @@ -503,6 +526,8 @@ SALOMEDS::SObject_ptr SALOMEDS_Study_i::FindObjectIOR(const char* theObjectIOR) //============================================================================ SALOMEDS::SObject_ptr SALOMEDS_Study_i::FindObjectByPath(const char* thePath) { + SALOMEDS::Locker lock; + TCollection_AsciiString aPath(CORBA::string_dup(thePath)), aToken; SALOMEDS::SObject_var aSO = SALOMEDS::SObject::_nil(); int i = 1, aLength = aPath.Length(); @@ -563,6 +588,8 @@ SALOMEDS::SObject_ptr SALOMEDS_Study_i::FindObjectByPath(const char* thePath) //============================================================================ char* SALOMEDS_Study_i::GetObjectPath(CORBA::Object_ptr theObject) { + SALOMEDS::Locker lock; + TCollection_AsciiString aPath(""); if(CORBA::is_nil(theObject)) return CORBA::string_dup(aPath.ToCString()); @@ -607,6 +634,8 @@ char* SALOMEDS_Study_i::GetObjectPath(CORBA::Object_ptr theObject) //============================================================================ void SALOMEDS_Study_i::SetContext(const char* thePath) { + SALOMEDS::Locker lock; + if(thePath == NULL || strlen(thePath) == 0) throw SALOMEDS::Study::StudyInvalidDirectory(); TCollection_AsciiString aPath(CORBA::string_dup(thePath)), aContext(""); bool isInvalid = false; @@ -644,6 +673,8 @@ void SALOMEDS_Study_i::SetContext(const char* thePath) //============================================================================ char* SALOMEDS_Study_i::GetContext() { + SALOMEDS::Locker lock; + if(_current.IsNull()) throw SALOMEDS::Study::StudyInvalidContext(); @@ -657,6 +688,8 @@ char* SALOMEDS_Study_i::GetContext() */ //============================================================================ SALOMEDS::ListOfStrings* SALOMEDS_Study_i::GetObjectNames(const char* theContext) { + SALOMEDS::Locker lock; + TColStd_SequenceOfExtendedString aResultSeq; SALOMEDS::ListOfStrings_var aResult = new SALOMEDS::ListOfStrings; TDF_Label aLabel; @@ -694,6 +727,8 @@ SALOMEDS::ListOfStrings* SALOMEDS_Study_i::GetObjectNames(const char* theContext */ //============================================================================ SALOMEDS::ListOfStrings* SALOMEDS_Study_i::GetDirectoryNames(const char* theContext) { + SALOMEDS::Locker lock; + TColStd_SequenceOfExtendedString aResultSeq; SALOMEDS::ListOfStrings_var aResult = new SALOMEDS::ListOfStrings; TDF_Label aLabel; @@ -734,6 +769,8 @@ SALOMEDS::ListOfStrings* SALOMEDS_Study_i::GetDirectoryNames(const char* theCont */ //============================================================================ SALOMEDS::ListOfStrings* SALOMEDS_Study_i::GetFileNames(const char* theContext) { + SALOMEDS::Locker lock; + TColStd_SequenceOfExtendedString aResultSeq; SALOMEDS::ListOfStrings_var aResult = new SALOMEDS::ListOfStrings; TDF_Label aLabel; @@ -777,6 +814,8 @@ SALOMEDS::ListOfStrings* SALOMEDS_Study_i::GetFileNames(const char* theContext) */ //============================================================================ SALOMEDS::ListOfStrings* SALOMEDS_Study_i::GetComponentNames(const char* theContext) { + SALOMEDS::Locker lock; + TColStd_SequenceOfExtendedString aResultSeq; SALOMEDS::ListOfStrings_var aResult = new SALOMEDS::ListOfStrings; TDF_ChildIterator anIter(_doc->Main(), Standard_False); // iterate all subchildren at first level @@ -802,6 +841,8 @@ SALOMEDS::ListOfStrings* SALOMEDS_Study_i::GetComponentNames(const char* theCont SALOMEDS::ChildIterator_ptr SALOMEDS_Study_i::NewChildIterator(SALOMEDS::SObject_ptr theSObject) { + SALOMEDS::Locker lock; + SALOMEDS_ChildIterator_i* aServant = new SALOMEDS_ChildIterator_i(GetChildIterator(theSObject)); @@ -824,6 +865,8 @@ SALOMEDS_Study_i::GetChildIterator(SALOMEDS::SObject_ptr theSObject) SALOMEDS::SComponentIterator_ptr SALOMEDS_Study_i::NewComponentIterator() { + SALOMEDS::Locker lock; + SALOMEDS_SComponentIterator_i* aServant = new SALOMEDS_SComponentIterator_i(GetComponentIterator()); @@ -843,6 +886,8 @@ SALOMEDS_Study_i::GetComponentIterator() //============================================================================ SALOMEDS::UseCaseBuilder_ptr SALOMEDS_Study_i::GetUseCaseBuilder() { + SALOMEDS::Locker lock; + return _UseCaseBuilder->_this(); } @@ -858,6 +903,8 @@ SALOMEDS_StudyBuilder_i* SALOMEDS_Study_i::GetBuilder() SALOMEDS::StudyBuilder_ptr SALOMEDS_Study_i::NewBuilder() { + SALOMEDS::Locker lock; + return GetBuilder()->_this(); } @@ -868,6 +915,8 @@ SALOMEDS::StudyBuilder_ptr SALOMEDS_Study_i::NewBuilder() //============================================================================ char* SALOMEDS_Study_i::Name() { + SALOMEDS::Locker lock; + return CORBA::string_dup(_name); } @@ -878,6 +927,8 @@ char* SALOMEDS_Study_i::Name() //============================================================================ void SALOMEDS_Study_i::Name(const char* name) { + SALOMEDS::Locker lock; + _name = new char[strlen(name) +1]; strcpy(_name,name); } @@ -889,6 +940,8 @@ void SALOMEDS_Study_i::Name(const char* name) //============================================================================ CORBA::Boolean SALOMEDS_Study_i::IsSaved() { + SALOMEDS::Locker lock; + return _isSaved; } @@ -899,6 +952,8 @@ CORBA::Boolean SALOMEDS_Study_i::IsSaved() //============================================================================ void SALOMEDS_Study_i::IsSaved(CORBA::Boolean save) { + SALOMEDS::Locker lock; + _isSaved = save; } @@ -909,6 +964,8 @@ void SALOMEDS_Study_i::IsSaved(CORBA::Boolean save) //============================================================================ CORBA::Boolean SALOMEDS_Study_i::IsModified() { + SALOMEDS::Locker lock; + // True if is modified and not saved if (_doc->IsModified()) if (!_isSaved) return true; @@ -923,6 +980,8 @@ CORBA::Boolean SALOMEDS_Study_i::IsModified() //============================================================================ char* SALOMEDS_Study_i::URL() { + SALOMEDS::Locker lock; + if(!_URL) { _URL = new char[1]; _URL[0] = (char)0; @@ -937,6 +996,8 @@ char* SALOMEDS_Study_i::URL() //============================================================================ void SALOMEDS_Study_i::URL(const char* url) { + SALOMEDS::Locker lock; + if (_URL) delete [] _URL; _URL = new char[strlen(url) +1]; strcpy(_URL,url); @@ -1013,15 +1074,21 @@ SALOMEDS_Study_i::_FindObjectIOR(TDF_Label theLabel, CORBA::Short SALOMEDS_Study_i::StudyId() { + SALOMEDS::Locker lock; + return _StudyId; } void SALOMEDS_Study_i::StudyId(CORBA::Short id) { + SALOMEDS::Locker lock; + _StudyId = id; } void SALOMEDS_Study_i::UpdateIORLabelMap(const char* anIOR,const char* anEntry) { + SALOMEDS::Locker lock; + TDF_Label aLabel; CORBA::String_var anEn = CORBA::string_dup(anEntry); CORBA::String_var IOR = CORBA::string_dup(anIOR); @@ -1038,6 +1105,8 @@ void SALOMEDS_Study_i::IORUpdated(const Handle(SALOMEDS_IORAttribute) theAttribu } SALOMEDS::Study::ListOfSObject* SALOMEDS_Study_i::FindDependances(SALOMEDS::SObject_ptr anObject) { + SALOMEDS::Locker lock; + SALOMEDS::GenericAttribute_ptr aTarget; if (anObject->FindAttribute(aTarget,"AttributeTarget")) { return SALOMEDS::AttributeTarget::_narrow(aTarget)->Get(); @@ -1049,6 +1118,8 @@ SALOMEDS::Study::ListOfSObject* SALOMEDS_Study_i::FindDependances(SALOMEDS::SObj SALOMEDS::AttributeStudyProperties_ptr SALOMEDS_Study_i::GetProperties(){ + SALOMEDS::Locker lock; + SALOMEDS::SObject_var aSObject = FindObjectID("0:1"); SALOMEDS::GenericAttribute_var anAttr = @@ -1058,6 +1129,8 @@ SALOMEDS::AttributeStudyProperties_ptr SALOMEDS_Study_i::GetProperties(){ } char* SALOMEDS_Study_i::GetLastModificationDate() { + SALOMEDS::Locker lock; + SALOMEDS::AttributeStudyProperties_var aProp = GetProperties(); SALOMEDS::StringSeq_var aNames; SALOMEDS::LongSeq_var aMinutes, aHours, aDays, aMonths, aYears; @@ -1071,6 +1144,8 @@ char* SALOMEDS_Study_i::GetLastModificationDate() { } SALOMEDS::ListOfDates* SALOMEDS_Study_i::GetModificationsDate() { + SALOMEDS::Locker lock; + SALOMEDS::AttributeStudyProperties_var aProp = GetProperties(); SALOMEDS::StringSeq_var aNames; SALOMEDS::LongSeq_var aMinutes, aHours, aDays, aMonths, aYears; @@ -1098,6 +1173,8 @@ SALOMEDS::ListOfDates* SALOMEDS_Study_i::GetModificationsDate() { //============================================================================ void SALOMEDS_Study_i::Close() { + SALOMEDS::Locker lock; + SALOMEDS_SComponentIterator_i itcomponent(this,_doc); const CORBA::ORB_var& anORB = GetORB(); @@ -1114,8 +1191,11 @@ void SALOMEDS_Study_i::Close() if (!CORBA::is_nil(obj)) { SALOMEDS::Driver_var anEngine = SALOMEDS::Driver::_narrow(obj) ; - if (!anEngine->_is_nil()) + if (!anEngine->_is_nil()){ + SALOMEDS::unlock(); anEngine->Close(sco); + SALOMEDS::lock(); + } } } } @@ -1136,6 +1216,8 @@ void SALOMEDS_Study_i::Close() */ //============================================================================ void SALOMEDS_Study_i::AddPostponed(const char* theIOR) { + SALOMEDS::Locker lock; + if (!GetBuilder()->HasOpenCommand()) return; try { CORBA::Object_var obj = GetORB()->string_to_object(theIOR); @@ -1152,6 +1234,8 @@ void SALOMEDS_Study_i::AddPostponed(const char* theIOR) { } void SALOMEDS_Study_i::AddCreatedPostponed(const char* theIOR) { + SALOMEDS::Locker lock; + if (!GetBuilder()->HasOpenCommand()) return; try { CORBA::Object_var obj = GetORB()->string_to_object(theIOR); @@ -1173,6 +1257,8 @@ void SALOMEDS_Study_i::AddCreatedPostponed(const char* theIOR) { */ //============================================================================ void SALOMEDS_Study_i::RemovePostponed(const CORBA::Long theUndoLimit) { + SALOMEDS::Locker lock; + int anIndex; int anOld; @@ -1236,6 +1322,8 @@ void SALOMEDS_Study_i::RemovePostponed(const CORBA::Long theUndoLimit) { */ //============================================================================ void SALOMEDS_Study_i::UndoPostponed(const CORBA::Long theWay) { + SALOMEDS::Locker lock; + myNbUndos += theWay; // remove current postponed if (myNbPostponed.Last() > 0) diff --git a/src/SALOMEDS/SALOMEDS_UseCaseIterator_i.cxx b/src/SALOMEDS/SALOMEDS_UseCaseIterator_i.cxx index 38dbd0568..706cba9da 100644 --- a/src/SALOMEDS/SALOMEDS_UseCaseIterator_i.cxx +++ b/src/SALOMEDS/SALOMEDS_UseCaseIterator_i.cxx @@ -8,12 +8,11 @@ // Author : Yves FRICAUD // Module : SALOME -using namespace std; #include "SALOMEDS_UseCaseIterator_i.hxx" #include "SALOMEDS_SObject_i.hxx" #include "utilities.h" - +using namespace std; //============================================================================ /*! Function : constructor diff --git a/src/SALOMEGUI/CLIENT_msg_en.po b/src/SALOMEGUI/CLIENT_msg_en.po index a4695f62b..6ce59fb23 100644 --- a/src/SALOMEGUI/CLIENT_msg_en.po +++ b/src/SALOMEGUI/CLIENT_msg_en.po @@ -20,7 +20,7 @@ msgstr "" #--------------- msgid "INF_VERSION" -msgstr "Version 2.2.0" +msgstr "Version 2.2.2" msgid "INF_COPYRIGHT" msgstr "Copyright (C) 2003-2004 OPEN CASCADE, EADS/CCR, LIP6,\nCEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS" @@ -38,8 +38,8 @@ msgstr "salome" #: QAD_Application.cxx:133 msgid "QAD_Application::APP_DEFAULTTITLE" -msgstr "SALOME 2.2.0" +msgstr "SALOME 2.2.2" #: QAD_Desktop.cxx:424 msgid "QAD_Desktop::DESK_DEFAULTTITLE" -msgstr "SALOME 2.2.0" +msgstr "SALOME 2.2.2" diff --git a/src/SALOMEGUI/Makefile.in b/src/SALOMEGUI/Makefile.in index d3acbc362..bd8f7efdd 100644 --- a/src/SALOMEGUI/Makefile.in +++ b/src/SALOMEGUI/Makefile.in @@ -221,7 +221,7 @@ LIB_CLIENT_IDL = SALOMEDS.idl \ SALOME_ContainerManager.idl \ SALOME_Exception.idl -CPPFLAGS+=$(QT_INCLUDES) $(PYTHON_INCLUDES) $(OCC_INCLUDES) +CPPFLAGS+=$(QT_INCLUDES) $(PYTHON_INCLUDES) $(OCC_INCLUDES) -DSIP_VERS_@SIP_VERS@ LDFLAGS+=$(QT_MT_LIBS) -lSalomeNS -lqsplitterP -lSalomeLifeCycleCORBA -lOpUtil -lSalomeObject -lEvent -lSalomePrs LIBS+= $(PYTHON_LIBS) diff --git a/src/SALOMEGUI/PyInterp_PyQt.cxx b/src/SALOMEGUI/PyInterp_PyQt.cxx index 440c302f3..29077ca0e 100644 --- a/src/SALOMEGUI/PyInterp_PyQt.cxx +++ b/src/SALOMEGUI/PyInterp_PyQt.cxx @@ -9,7 +9,7 @@ // Module : SALOME // $Header$ -#include "PyInterp_PyQt.h" +#include "PyInterp_PyQt.h" // this include must be first (see PyInterp_base.h)! #include "utilities.h" using namespace std; @@ -30,14 +30,25 @@ PyInterp_PyQt::~PyInterp_PyQt() void PyInterp_PyQt::initState() { + /* + * The GIL is assumed to not be held on the call + * The GIL is acquired in initState and will be held on initState exit + * It is the caller responsability to release the lock on exit if needed + */ SCRUTE(PyInterp_base::_gtstate); _tstate=PyInterp_base::_gtstate; + PyEval_AcquireLock(); PyThreadState_Swap(_tstate); SCRUTE(_tstate); } void PyInterp_PyQt::initContext() { + /* + * The GIL is assumed to be held + * It is the caller responsability to acquire the GIL before calling initContext + * It will still be held on initContext exit + */ _g = PyDict_New(); // create interpreter dictionnary context PyObject *bimod = PyImport_ImportModule("__builtin__"); PyDict_SetItemString(_g, "__builtins__", bimod); diff --git a/src/SALOMEGUI/PyInterp_PyQt.h b/src/SALOMEGUI/PyInterp_PyQt.h index 74d743e27..4f2f58f9c 100644 --- a/src/SALOMEGUI/PyInterp_PyQt.h +++ b/src/SALOMEGUI/PyInterp_PyQt.h @@ -12,7 +12,7 @@ #ifndef _PYINTERP_PYQT_H_ #define _PYINTERP_PYQT_H_ -#include "PyInterp_base.h" +#include "PyInterp_base.h" // this include must be first (see PyInterp_base.h)! class PyInterp_PyQt : public PyInterp_base { diff --git a/src/SALOMEGUI/PyInterp_base.cxx b/src/SALOMEGUI/PyInterp_base.cxx index 153872048..1c4879d1d 100644 --- a/src/SALOMEGUI/PyInterp_base.cxx +++ b/src/SALOMEGUI/PyInterp_base.cxx @@ -13,12 +13,11 @@ #include #include -#include +#include "PyInterp_base.h" // this include must be first (see PyInterp_base.h)! #include #include -#include "PyInterp_base.h" #include "utilities.h" @@ -42,13 +41,14 @@ PyLockWrapper::PyLockWrapper(PyThreadState* theThreadState): mySaveThreadState(PyInterp_base::_gtstate) { PyEval_AcquireLock(); - mySaveThreadState = PyThreadState_Swap(myThreadState); + mySaveThreadState = PyThreadState_Swap(myThreadState); // store previous current in save, + // set local in current } PyLockWrapper::~PyLockWrapper(){ - PyThreadState_Swap(mySaveThreadState); - PyEval_ReleaseLock(); + PyThreadState_Swap(mySaveThreadState); // restore previous current (no need to get local, + PyEval_ReleaseLock(); // local thread state* already in _tstate } @@ -129,24 +129,7 @@ void PyInterp_base::initialize() _history.clear(); // start a new list of user's commands _ith = _history.begin(); - if(!_gtstate){ - PyReleaseLock aReleaseLock; - Py_Initialize(); // Initialize the interpreter - PyEval_InitThreads(); // Initialize and acquire the global interpreter lock - PySys_SetArgv(_argc,_argv); // initialize sys.argv - _gtstate = PyThreadState_Get(); - - /* - * salome_shared_modules should be imported only once - */ - salome_shared_modules_module = PyImport_ImportModule("salome_shared_modules"); - if(!salome_shared_modules_module) - { - INFOS("PyInterp_base::initialize() - salome_shared_modules_module == NULL"); - PyErr_Print(); - PyErr_Clear(); - } - } + if(!_gtstate) init_python(); // Here the global lock is released if(MYPYDEBUG) MESSAGE("PyInterp_base::initialize() - this = "<NewOutput(128); _verr = PycStringIO->NewOutput(128); @@ -175,6 +158,31 @@ void PyInterp_base::initialize() initRun(); } +void PyInterp_base::init_python() +{ + /* + * Initialize the main state (_gtstate) if not already done + * The lock is released on init_python output + * It is the caller responsability to acquire it if needed + */ + if(!_gtstate){ + PyReleaseLock aReleaseLock; + Py_Initialize(); // Initialize the interpreter + PyEval_InitThreads(); // Initialize and acquire the global interpreter lock + PySys_SetArgv(_argc,_argv); // initialize sys.argv + _gtstate = PyThreadState_Get(); + /* + * salome_shared_modules should be imported only once + */ + salome_shared_modules_module = PyImport_ImportModule("salome_shared_modules"); + if(!salome_shared_modules_module) + { + INFOS("PyInterp_base::initialize() - salome_shared_modules_module == NULL"); + PyErr_Print(); + PyErr_Clear(); + } + } +} string PyInterp_base::getbanner() { @@ -193,7 +201,7 @@ int PyInterp_base::initRun() PyObjWrapper verr(PyObject_CallMethod(_verr,"reset","")); PyObjWrapper vout(PyObject_CallMethod(_vout,"reset","")); - PyObject *m = PyImport_GetModuleDict(); + //PyObject *m = PyImport_GetModuleDict(); PySys_SetObject("stdout",PySys_GetObject("__stdout__")); PySys_SetObject("stderr",PySys_GetObject("__stderr__")); diff --git a/src/SALOMEGUI/PyInterp_base.h b/src/SALOMEGUI/PyInterp_base.h index 157d5c3f7..739b5d4f0 100644 --- a/src/SALOMEGUI/PyInterp_base.h +++ b/src/SALOMEGUI/PyInterp_base.h @@ -16,7 +16,10 @@ #include #include -#include +// include order important! +// pthread then python then qt +#include // must be before Python.h ! +#include // must be before qt includes ... class QSemaphore; class QMutex; @@ -71,6 +74,7 @@ class PyInterp_base{ ~PyInterp_base(); virtual void initialize(); + static void init_python(); int run(const char *command); @@ -88,6 +92,7 @@ class PyInterp_base{ PyObject * _vout; PyObject * _verr; PyObject * _g; + PyObject * _codeop; std::list _history; std::list::iterator _ith; bool _atFirst; diff --git a/src/SALOMEGUI/QAD_Application.cxx b/src/SALOMEGUI/QAD_Application.cxx index c58e5f57f..ef2a9c39d 100644 --- a/src/SALOMEGUI/QAD_Application.cxx +++ b/src/SALOMEGUI/QAD_Application.cxx @@ -1279,7 +1279,9 @@ void QAD_Application::onStudyClosed(QAD_Study* study) void QAD_Application::onActiveStudyChanged( QAD_Study* oldActiveStudy, QAD_Study* newActiveStudy ) { - getDesktop()->onActiveStudyChanged(); + // san -- Check added: see comment by P.Rascle to PAL8065 about poor performance + if ( oldActiveStudy != newActiveStudy ) + getDesktop()->onActiveStudyChanged(); if ( oldActiveStudy ) QAD_ASSERT( disconnect( oldActiveStudy, SIGNAL(docOperationTerminated( bool )), diff --git a/src/SALOMEGUI/QAD_Desktop.cxx b/src/SALOMEGUI/QAD_Desktop.cxx index 5fa319a28..cbc5a92e7 100644 --- a/src/SALOMEGUI/QAD_Desktop.cxx +++ b/src/SALOMEGUI/QAD_Desktop.cxx @@ -37,13 +37,13 @@ #define DEFAULT_BROWSER "mozilla" +#include "QAD_PyEditor.h" // this include must be first (see PyInterp_base.h)! #include "QAD.h" #include "QAD_Help.h" #include "QAD_Tools.h" #include "QAD_Desktop.h" #include "QAD_LeftFrame.h" #include "QAD_RightFrame.h" -#include "QAD_PyEditor.h" #include "QAD_Operation.h" #include "QAD_XmlHandler.h" #include "QAD_MessageBox.h" @@ -3348,8 +3348,12 @@ SALOMEGUI* QAD_Desktop::getComponentGUI( const QString& component ) dir = QAD_Tools::addSlash(dir) ; #ifdef WNT dir = dir + "libSalomePyQtcmodule.dll" ; +#else +#ifdef SIP_VERS_v4_1 + dir = dir + "SalomePyQt.so" ; #else dir = dir + "libSalomePyQtcmodule.so" ; +#endif #endif MESSAGE ( " GUI library = " << dir ); fileInfo.setFile(dir) ; diff --git a/src/SALOMEGUI/QAD_FileDlg.h b/src/SALOMEGUI/QAD_FileDlg.h index a234de43d..71b19cfe2 100644 --- a/src/SALOMEGUI/QAD_FileDlg.h +++ b/src/SALOMEGUI/QAD_FileDlg.h @@ -15,13 +15,7 @@ #include #include -// VSR (18/01/2005): use patched QFileDialog only for the official 3.0.5 version of Qt -#if QT_VERSION == 0x030005 #include -#else -#include -#define QFileDialogP QFileDialog -#endif #include "QAD.h" #include "QAD_FileValidator.h" diff --git a/src/SALOMEGUI/QAD_ObjectBrowser.cxx b/src/SALOMEGUI/QAD_ObjectBrowser.cxx index e97f591ed..958cd0b28 100644 --- a/src/SALOMEGUI/QAD_ObjectBrowser.cxx +++ b/src/SALOMEGUI/QAD_ObjectBrowser.cxx @@ -340,8 +340,11 @@ void QAD_ObjectBrowser::setupListView() /*! Event filter + We can use the following static variables for drag-n-drop operations because it is impossible + to perform several dragging operation at one time. */ - +static bool dragged = false; +static QStringList draggedlist; bool QAD_ObjectBrowser::eventFilter( QObject* o, QEvent* e ) { QAD_Desktop* Desktop = (QAD_Desktop*) QAD_Application::getDesktop(); @@ -357,7 +360,7 @@ bool QAD_ObjectBrowser::eventFilter( QObject* o, QEvent* e ) // Test if clicked on selection and start drag if necessary QMouseEvent* me = ( QMouseEvent* )e; QAD_ObjectBrowserItem* item = ( QAD_ObjectBrowserItem* )( myUseCaseView->itemAt( me->pos() ) ); - if ( item && item->isSelected() && me->button() == LeftButton) { + if ( item && item->isSelected() && me->button() == LeftButton && !(me->state() & (ControlButton | ShiftButton)) ) { if ( me->pos().x() > myUseCaseView->header()->sectionPos( myUseCaseView->header()->mapToIndex( 0 ) ) + myUseCaseView->treeStepSize() * ( item->depth() + ( myUseCaseView->rootIsDecorated() ? 1 : 0 ) ) + myUseCaseView->itemMargin() || @@ -378,13 +381,40 @@ bool QAD_ObjectBrowser::eventFilter( QObject* o, QEvent* e ) } } if ( done && !entryList.isEmpty() ) { - QTextDrag *d = new QTextDrag( entryList.join("*"), myUseCaseView->viewport() ); - d->dragMove(); + draggedlist = entryList; + // vsr 03/03/05 - start dragging only if mouse starts moving after pressing left button (see below) + //QTextDrag *d = new QTextDrag( entryList.join("*"), myUseCaseView->viewport() ); + //d->dragMove(); + dragged = true; return true; } } } } + else if ( e->type() == QEvent::MouseMove ) { + // vsr 03/03/05 - start dragging only if mouse starts moving + if ( dragged ) { + if ( !draggedlist.isEmpty() ) { + QTextDrag *d = new QTextDrag( draggedlist.join("*"), myUseCaseView->viewport() ); + d->dragMove(); + } + dragged = false; + draggedlist.clear(); + } + } + else if ( e->type() == QEvent::MouseButtonRelease ) { + // vsr 03/03/05 - if dragging was not performed (mouse was not moved after mouse press) + // simulate the ordinary mouse click that means just selection of the one item + QMouseEvent* me = ( QMouseEvent* )e; + if ( dragged ) { + draggedlist.clear(); + dragged = false; + QAD_ObjectBrowserItem* item = ( QAD_ObjectBrowserItem* )( myUseCaseView->itemAt( me->pos() ) ); + myUseCaseView->clearSelection(); + myUseCaseView->setSelected( item, true ); + myUseCaseView->setCurrentItem( item ); + } + } else if ( e->type() == QEvent::DragMove ) { QDragMoveEvent* dme = ( QDragMoveEvent* )e; if ( dme->source() == myUseCaseView->viewport() ) { @@ -1423,9 +1453,6 @@ void QAD_ObjectBrowser::showUseCasePopupMenu(QListViewItem* theItem) */ void QAD_ObjectBrowser::onSelectedItem() { - if (currentPage()==myListView) - myUseCaseView->clearSelection(); - QListView* whoIs; if ( sender()->inherits("QListView") ) whoIs = (QListView*)sender(); diff --git a/src/SALOMEGUI/QAD_PyEditor.cxx b/src/SALOMEGUI/QAD_PyEditor.cxx index bfd4ec997..10c70d5fb 100644 --- a/src/SALOMEGUI/QAD_PyEditor.cxx +++ b/src/SALOMEGUI/QAD_PyEditor.cxx @@ -26,8 +26,7 @@ // Module : SALOME // $Header$ -#include "QAD_PyEditor.h" -#include "QAD_PyInterp.h" +#include "QAD_PyEditor.h" // this include must be first (see PyInterp_base.h)! #include "QAD_Application.h" #include "QAD_Desktop.h" #include "QAD_Config.h" diff --git a/src/SALOMEGUI/QAD_PyEditor.h b/src/SALOMEGUI/QAD_PyEditor.h index 941a340df..8a23d6474 100644 --- a/src/SALOMEGUI/QAD_PyEditor.h +++ b/src/SALOMEGUI/QAD_PyEditor.h @@ -29,6 +29,7 @@ #ifndef QAD_PyEditor_H #define QAD_PyEditor_H +#include "QAD_PyInterp.h" // this include must be first (see PyInterp_base.h)! #include #include diff --git a/src/SALOMEGUI/QAD_PyInterp.cxx b/src/SALOMEGUI/QAD_PyInterp.cxx index d7da14e42..a2ea8ac56 100644 --- a/src/SALOMEGUI/QAD_PyInterp.cxx +++ b/src/SALOMEGUI/QAD_PyInterp.cxx @@ -72,6 +72,11 @@ QAD_PyInterp::~QAD_PyInterp() void QAD_PyInterp::initState() { + /* + * The GIL is acquired and will be held on initState output + * It is the caller responsability to release the lock if needed + */ + PyEval_AcquireLock(); _tstate = Py_NewInterpreter(); // create an interpreter and save current state PySys_SetArgv(PyInterp_base::_argc,PyInterp_base::_argv); // initialize sys.argv if(MYDEBUG) MESSAGE("QAD_PyInterp::initState - this = "< diff --git a/src/SALOMEGUI/QAD_Study.cxx b/src/SALOMEGUI/QAD_Study.cxx index b52002cb2..370df0689 100644 --- a/src/SALOMEGUI/QAD_Study.cxx +++ b/src/SALOMEGUI/QAD_Study.cxx @@ -31,6 +31,7 @@ \brief Study for QAD-based application. */ +#include "QAD_PyInterp.h" // this include must be first (see PyInterp_base.h)! #include "QAD.h" #include "QAD_Tools.h" #include "QAD_Desktop.h" @@ -40,9 +41,7 @@ #include "QAD_MessageBox.h" #include "QAD_Application.h" #include "QAD_ObjectBrowser.h" -#include "QAD_PyInterp.h" #include "QAD_Config.h" -#include "QAD_PyInterp.h" #include "utilities.h" @@ -135,6 +134,7 @@ QAD_Study::QAD_Study(QAD_Application* theApp, Selection( QAD_Application::getDesktop()->getComponentUserName( "KERNEL" ) ); /* create python interpreter */ + QAD_PyInterp::init_python(); // initialize Python out of qthread myInitStudyThread = new TInitStudyThread(myInterp,myMutex); myInitStudyThread->start(); diff --git a/src/SALOMEGUI/QAD_StudyFrame.cxx b/src/SALOMEGUI/QAD_StudyFrame.cxx index cfba6977e..fa1642d6d 100644 --- a/src/SALOMEGUI/QAD_StudyFrame.cxx +++ b/src/SALOMEGUI/QAD_StudyFrame.cxx @@ -31,6 +31,7 @@ \brief Frame window which contains QAD_LeftFrame and QAD_RightFrame. */ +#include "QAD_PyInterp.h" // this include must be first (see PyInterp_base.h)! #include "QAD_StudyFrame.h" #include "QAD_StudyFrame.h" #include "QAD_RightFrame.h" @@ -40,7 +41,6 @@ #include "QAD_Desktop.h" #include "QAD_Study.h" #include "QAD_ObjectBrowser.h" -#include "QAD_PyInterp.h" #include diff --git a/src/SALOMETraceCollector/TraceCollector_WaitForServerReadiness.cxx b/src/SALOMETraceCollector/TraceCollector_WaitForServerReadiness.cxx index 9e91b71d9..5512ea926 100644 --- a/src/SALOMETraceCollector/TraceCollector_WaitForServerReadiness.cxx +++ b/src/SALOMETraceCollector/TraceCollector_WaitForServerReadiness.cxx @@ -79,10 +79,10 @@ CORBA::Object_ptr TraceCollector_WaitForServerReadiness(CORBA::ORB_ptr orb, if (!CORBA::is_nil(theObj)) inc = CosNaming::NamingContext::_narrow(theObj); } - catch( CORBA::COMM_FAILURE& ) + catch( CORBA::SystemException& ) { cout << "TraceCollector_WaitForServerReadiness: " - << "CORBA::COMM_FAILURE: " + << "CORBA::SystemException: " << "Unable to contact the Naming Service" << endl; } catch(...) diff --git a/src/SALOME_PYQT/Makefile.in b/src/SALOME_PYQT/Makefile.in index a72114d91..a581f99b1 100644 --- a/src/SALOME_PYQT/Makefile.in +++ b/src/SALOME_PYQT/Makefile.in @@ -20,44 +20,78 @@ VPATH=.:@srcdir@:@top_srcdir@/idl # SIP C++ Python # SIP defined in make_commence.in -SIP_FLAGS = -t WS_X11 -t Qt_3_0_5 -s ".cc" -c $(CURDIR) -I $(PYQT_SIPS) +#SIP_FLAGS = -t WS_X11 -t Qt_3_0_5 -s ".cc" -c $(CURDIR) -I $(PYQT_SIPS) # SIP input file(s) -SIP_FILES = SalomePyQt.sip +#SIP_FILES = SalomePyQt.sip # SIP-generated C++ source files (corresponding line should be added for each wrapped class # contained by SalomePyQt module) +#SIP_SRC=$(CURDIR)/SalomePyQtcmodule.cc \ +# $(CURDIR)/sipSalomePyQtSalomePyQt.cc \ +# $(CURDIR)/sipSalomePyQtSALOME_Selection.cc -SIP_SRC=$(CURDIR)/SalomePyQtcmodule.cc \ +ifeq ($(SIP_VERS),v4_1) +SIP_FLAGS = -t WS_X11 -t Qt_3_3_0 -s ".cc" -c $(CURDIR) -I $(PYQT_SIPS) +SIP_SRC=$(CURDIR)/sipSalomePyQtcmodule.cc \ $(CURDIR)/sipSalomePyQtSalomePyQt.cc \ $(CURDIR)/sipSalomePyQtSALOME_Selection.cc +MOC_SRC = sipSalomePyQtcmodule_moc.cxx +MOC_H = sipSalomePyQtcmodule.h +SIP_FILES = SalomePyQt_v4.sip +#LDFLAGS+= -lSalomeGUI +#LDFLAGS+= -lSalomeGUI -module +LDFLAGS+= -shared -lSalomeGUI +# Libraries targets +LIB = SalomePyQt.so +else ifeq ($(SIP_VERS),new2) +SIP_FLAGS = -t WS_X11 -t Qt_3_0_5 -s ".cc" -c $(CURDIR) -I $(PYQT_SIPS) +SIP_SRC=$(CURDIR)/SalomePyQtcmodule.cc \ + $(CURDIR)/sipSalomePyQtSalomePyQt.cc \ + $(CURDIR)/sipSalomePyQtSALOME_Selection.cc MOC_SRC = SalomePyQtcmodule_moc.cxx MOC_H = SalomePyQtcmodule.h +SIP_FILES = SalomePyQt.sip +LDFLAGS+= -lSalomeGUI -lqtcmodule + +# Libraries targets +LIB = libSalomePyQtcmodule.la + +EXPORT_SHAREDPYSCRIPTS = SalomePyQt.py else +SIP_FLAGS = -t WS_X11 -t Qt_3_0_5 -s ".cc" -c $(CURDIR) -I $(PYQT_SIPS) +SIP_SRC=$(CURDIR)/SalomePyQtcmodule.cc \ + $(CURDIR)/sipSalomePyQtSalomePyQt.cc \ + $(CURDIR)/sipSalomePyQtSALOME_Selection.cc MOC_SRC = sipSalomePyQtProxySalomePyQt_moc.cxx MOC_H = sipSalomePyQtProxySalomePyQt.h -endif +SIP_FILES = SalomePyQt.sip +LDFLAGS+= -lSalomeGUI -lqtcmodule # Libraries targets - LIB = libSalomePyQtcmodule.la +EXPORT_SHAREDPYSCRIPTS = SalomePyQt.py +endif +endif + LIB_SRC += SalomePyQt.cxx SALOME_PYQT_GUI.cxx $(SIP_SRC) $(MOC_SRC) LIB_MOC = SALOME_PYQT_GUI.h #LIB_MOC += sipSalomePyQtProxySalomePyQt.h -EXPORT_SHAREDPYSCRIPTS = SalomePyQt.py +#EXPORT_SHAREDPYSCRIPTS = SalomePyQt.py LIB_CLIENT_IDL = SALOME_Exception.idl SALOME_ContainerManager.idl CPPFLAGS+=$(QT_INCLUDES) $(PYTHON_INCLUDES) $(SIP_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) LIBS+= $(PYTHON_LIBS) $(SIP_LIBS) $(PYQT_LIBS) $(VTK_LIBS) $(OGL_LIBS) -LDFLAGS+= -lSalomeGUI -lqtcmodule +#LDFLAGS+= -lSalomeGUI -lqtcmodule +#LDFLAGS+= -lSalomeGUI # Custom build step: generate C++ wrapping according to $(SIP_FILES) diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUI.cxx b/src/SALOME_PYQT/SALOME_PYQT_GUI.cxx index 1ec297726..da744268e 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUI.cxx +++ b/src/SALOME_PYQT/SALOME_PYQT_GUI.cxx @@ -16,7 +16,13 @@ #include "SALOMEGUI_QtCatchCorbaException.hxx" #include "utilities.h" + +#if QT_VERSION > 0x030005 +#include +#else #include +#endif + #include #include @@ -41,14 +47,14 @@ void SALOME_PYQT_GUI::setWorkSpace() PyLockWrapper aLock = interp->GetLockWrapper(); // Try to import qt module. If it's not possible don't go on - PyObjWrapper qtmodule(PyImport_ImportModule("qt")); + PyObjWrapper qtmodule(PyImport_ImportModule("SalomePyQt")); if(!qtmodule){ PyErr_Print(); return ; } - PyObjWrapper pyws(sipMapCppToSelf( QAD_Application::getDesktop()->getMainFrame(), - sipClass_QWorkspace)); + QWorkspaceP *sipRes=QAD_Application::getDesktop()->getMainFrame(); + PyObjWrapper pyws(sipMapCppToSelf( sipRes, sipClass_QWorkspace)); PyObjWrapper res(PyObject_CallMethod(_module,"setWorkSpace","O",pyws.get())); SCRUTE(pyws->ob_refcnt); if(!res){ diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUI.h b/src/SALOME_PYQT/SALOME_PYQT_GUI.h index eb1ca4861..a8bc62a80 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUI.h +++ b/src/SALOME_PYQT/SALOME_PYQT_GUI.h @@ -1,5 +1,5 @@ //============================================================================= -// File : SALOME_PYQT_GUI.hxx +// File : SALOME_PYQT_GUI.h // Created : mer jun 4 17:17:20 UTC 2003 // Author : Paul RASCLE, EDF // Project : SALOME @@ -10,8 +10,8 @@ #ifndef _SALOME_PYQT_GUI_HXX_ #define _SALOME_PYQT_GUI_HXX_ +#include "PyInterp_PyQt.h" // this include must be first (see PyInterp_base.h)! #include "QAD_Desktop.h" -#include "PyInterp_PyQt.h" #include "SALOMEGUI.h" class SALOME_PYQT_GUI: public SALOMEGUI diff --git a/src/SALOME_PYQT/SalomePyQt.sip b/src/SALOME_PYQT/SalomePyQt.sip index df84b3fc1..ebfac3e00 100644 --- a/src/SALOME_PYQT/SalomePyQt.sip +++ b/src/SALOME_PYQT/SalomePyQt.sip @@ -2,12 +2,15 @@ %Import qtmod.sip + class SALOME_Selection : QObject { + %HeaderCode #include %End + public: SALOME_Selection(const QString &); void Clear(); @@ -29,6 +32,7 @@ enum MenuName { class SalomePyQt { + %HeaderCode #include %End diff --git a/src/SALOME_SWIG_WITHOUTIHM/import_hook.py b/src/SALOME_SWIG_WITHOUTIHM/import_hook.py index 1e6613cd3..79725c627 100755 --- a/src/SALOME_SWIG_WITHOUTIHM/import_hook.py +++ b/src/SALOME_SWIG_WITHOUTIHM/import_hook.py @@ -59,9 +59,10 @@ def is_shared(name): def get_shared_imported(name): return shared_imported.get(name) + def set_shared_imported(name,module): shared_imported[name]=module - #print "Module %s shared registered" % name + #print "Module %s shared registered" % name,module def get_shared_imported_with_copy(name): module_dict= shared_imported.get(name) @@ -73,6 +74,7 @@ def set_shared_imported_with_copy(name,module): #print "Module %s shared registered" % name def import_hook(name, globals=None, locals=None, fromlist=None): + #print "import_hook",name,fromlist module=get_shared_imported(name) if module: sys.modules[name]=module @@ -99,6 +101,8 @@ def init_shared_modules(shared_module): global shared_imported, patterns shared_imported=shared_module.shared_imported patterns= shared_module.patterns + for k,v in shared_imported.items(): + if v is not None:sys.modules[k]=v shared_imported["salome_shared_modules"]=shared_module import salome_shared_modules for m in salome_shared_modules.list_modules: diff --git a/src/SALOME_SWIG_WITHOUTIHM/kernel_shared_modules.py b/src/SALOME_SWIG_WITHOUTIHM/kernel_shared_modules.py index 291e27c26..bcdd46381 100755 --- a/src/SALOME_SWIG_WITHOUTIHM/kernel_shared_modules.py +++ b/src/SALOME_SWIG_WITHOUTIHM/kernel_shared_modules.py @@ -1,9 +1,10 @@ """ """ -import glob,os,sys - import import_hook + +import glob,os,sys,string,imp + from import_hook import register_name from import_hook import register_pattern @@ -11,12 +12,68 @@ register_name("qt") register_pattern(lambda(x):x.endswith("_idl")) register_name("omniORB") -register_name("CosNaming") +import omniORB + +# Modify omniORB to use right sys.modules dictionnary +# with multi-interpreter feature +# openModule and newModule are functions of omniORB/__init__.py module +# modified to register modules to share +# Function to return a Python module for the required IDL module name +def openModule(mname, fname=None): + # Salome modification start + import sys + # Salome modification end + + if mname == "CORBA": + mod = sys.modules["omniORB.CORBA"] + elif sys.modules.has_key(mname): + mod = sys.modules[mname] + else: + mod = newModule(mname) + + # Salome modification start + import_hook.set_shared_imported(mname,mod) + # Salome modification end + + + if not hasattr(mod, "__doc__") or mod.__doc__ is None: + mod.__doc__ = "omniORB IDL module " + mname + "\n\n" + \ + "Generated from:\n\n" + + if fname is not None: + mod.__doc__ = mod.__doc__ + " " + fname + "\n" -register_name("Engines") -register_name("SALOME") -register_name("SALOMEDS") -register_name("SALOME_ModuleCatalog") + return mod + +# Function to create a new module, and any parent modules which do not +# already exist +def newModule(mname): + # Salome modification start + import sys + # Salome modification end + + mlist = string.split(mname, ".") + current = "" + mod = None + + for name in mlist: + current = current + name + + if sys.modules.has_key(current): + mod = sys.modules[current] + else: + newmod = imp.new_module(current) + if mod: setattr(mod, name, newmod) + sys.modules[current] = mod = newmod + + current = current + "." + + return mod +# Replace openModule and newModule by modified ones +# to take into account the sys.modules that matches +# the right one (multi-interpreter feature) +omniORB.openModule=openModule +omniORB.newModule=newModule # BE CAREFUL # Engines, SALOME, SALOMEDS must be imported in that order because : @@ -27,36 +84,7 @@ register_name("SALOME_ModuleCatalog") import Engines import SALOME import SALOMEDS - import SALOME_ModuleCatalog -from SALOME_utilities import MESSAGE -# -# We search all Python CORBA (omniorb) modules. -# A Python CORBA module has 2 associated Python packages -# These packages are named : and __POA -# -# Get the SALOMEPATH if set or else use KERNEL_ROOT_DIR that should be set. -salome_path=os.environ.get("SALOMEPATH",os.getenv("KERNEL_ROOT_DIR")) - -# Register all CORBA modules in the path and python modules in shared_modules -path=salome_path.split(":") -# -for rep in path: - rep_salome=os.path.join(rep,"lib","python"+sys.version[:3],"site-packages","salome") - # Find all the *__POA packages in the path - for elem in glob.glob(os.path.join(rep_salome,"*__POA")): - if os.path.isdir(elem): - # Found a directory (Python package) named *__POA - module__POA=os.path.basename(elem) - module=module__POA[:-5] - MESSAGE( "Register CORBA module: " + module + ". Directory: " + os.path.abspath(elem)[:-5] ) - register_name(module) - - # Now we import modules found in shared_modules directory - for elem in glob.glob(os.path.join(rep_salome,"shared_modules","*.py")): - module=os.path.basename(elem)[:-3] - MESSAGE( "Register Python module: " + module + ". Location: " + os.path.abspath(elem) ) - register_name(module) def init_shared_modules(): """ @@ -73,3 +101,4 @@ def init_shared_modules(): sys.modules["_omnipy.poa_func"]=_omnipy.poa_func sys.modules["_omnipy.poamanager_func"]=_omnipy.poamanager_func sys.modules["_omnipy.orb_func"]=_omnipy.orb_func + diff --git a/src/SALOME_SWIG_WITHOUTIHM/salome_shared_modules.py b/src/SALOME_SWIG_WITHOUTIHM/salome_shared_modules.py index ebc0d1292..56c884176 100755 --- a/src/SALOME_SWIG_WITHOUTIHM/salome_shared_modules.py +++ b/src/SALOME_SWIG_WITHOUTIHM/salome_shared_modules.py @@ -22,7 +22,6 @@ # File : salome_shared_modules.py # Module : SALOME -from SALOME_utilities import * """ This module with help of import_hook and *_shared_modules @@ -51,9 +50,10 @@ Usage: that could be found in the path SALOMEPATH """ +import import_hook + import glob,os,sys -import import_hook # shared_imported, patterns, register_name, register_pattern # will be shared by all Python sub interpretors from import_hook import shared_imported @@ -72,9 +72,12 @@ list_modules=[] path=salome_path.split(":") for rep in path: # Import all *_shared_modules in rep - for f in glob.glob(os.path.join(rep,"lib","python"+sys.version[:3],"site-packages","salome","shared_modules","*_shared_modules.py")): + for f in glob.glob(os.path.join(rep,"lib","python"+sys.version[:3],"site-packages", + "salome","shared_modules","*_shared_modules.py")): try: - m=__import__(os.path.splitext(os.path.basename(f))[0]) + name=os.path.splitext(os.path.basename(f))[0] + register_name(name) + m=__import__(name) list_modules.append(m) except: pass @@ -85,5 +88,5 @@ for rep in path: # for name,module in sys.modules.items(): if import_hook.is_shared(name) and shared_imported.get(name) is None: - #print "Module shared added to shared_imported: ",name + #print "Module shared added to shared_imported: ",name,module shared_imported[name]=module diff --git a/src/Session/Session_ServerLauncher.cxx b/src/Session/Session_ServerLauncher.cxx index 6b9f4b92e..c1b32b7bd 100644 --- a/src/Session/Session_ServerLauncher.cxx +++ b/src/Session/Session_ServerLauncher.cxx @@ -82,9 +82,9 @@ Session_ServerLauncher::~Session_ServerLauncher() void Session_ServerLauncher::run() { - //MESSAGE("Session_ServerLauncher::run"); + MESSAGE("Session_ServerLauncher::run"); _GUIMutex->lock(); // lock released by calling thread when ready: wait(mutex) - //MESSAGE("Server Launcher thread free to go..."); + MESSAGE("Server Launcher thread free to go..."); _GUIMutex->unlock(); CheckArgs(); @@ -181,16 +181,6 @@ void Session_ServerLauncher::CheckArgs() void Session_ServerLauncher::ActivateAll() { - - // Always launch ContainerManager - - char** argv = new char* [1]; - argv[0] = "ContainerManager"; - Session_SessionThread* aServerThread2 - = new Session_SessionThread(1, argv, _orb,_root_poa,_GUIMutex,_ServerLaunch); - _serverThreads.push_front(aServerThread2); - - aServerThread2->Init(); list::iterator itServ; for (itServ = _argServToLaunch.begin(); itServ !=_argServToLaunch.end(); itServ++) @@ -216,7 +206,7 @@ void Session_ServerLauncher::ActivateAll() // Always launch Session Server int argc=1; - argv = new char*[argc]; + char **argv = new char*[argc]; argv[0] = "Session"; Session_SessionThread* aServerThread = new Session_SessionThread(argc, argv, _orb,_root_poa,_GUIMutex,_ServerLaunch); diff --git a/src/Session/Session_ServerThread.cxx b/src/Session/Session_ServerThread.cxx index eef032494..d3bf23b36 100644 --- a/src/Session/Session_ServerThread.cxx +++ b/src/Session/Session_ServerThread.cxx @@ -33,7 +33,6 @@ #include "Session_ServerThread.hxx" #include "SALOME_Container_i.hxx" -#include "SALOME_ContainerManager.hxx" #include "SALOMEDS_StudyManager_i.hxx" #include "SALOME_ModuleCatalog_impl.hxx" #include "RegistryService.hxx" @@ -51,13 +50,12 @@ using namespace std; -const int Session_ServerThread::NB_SRV_TYP = 6; +const int Session_ServerThread::NB_SRV_TYP = 5; const char* Session_ServerThread::_serverTypes[NB_SRV_TYP] = {"Container", "ModuleCatalog", "Registry", "SALOMEDS", - "Session", - "ContainerManager"}; + "Session"}; //============================================================================= /*! @@ -82,7 +80,7 @@ Session_ServerThread::Session_ServerThread(int argc, PortableServer::POA_ptr poa, QMutex *GUIMutex) { - //MESSAGE("Session_ServerThread Constructor " << argv[0]); + MESSAGE("Session_ServerThread Constructor " << argv[0]); _argc = argc; _argv = argv; _orb = CORBA::ORB::_duplicate(orb); @@ -101,7 +99,7 @@ Session_ServerThread::Session_ServerThread(int argc, Session_ServerThread::~Session_ServerThread() { - //MESSAGE("~Session_ServerThread "<< _argv[0]); + MESSAGE("~Session_ServerThread "<< _argv[0]); } //============================================================================= @@ -158,12 +156,6 @@ void Session_ServerThread::Init() ActivateSession(_argc, _argv); break; } - case 5: // Container Manager - { - NamingService_WaitForServerReadiness(_NS,""); - ActivateContainerManager(_argc, _argv); - break; - } default: { ASSERT(0); @@ -333,44 +325,6 @@ void Session_ServerThread::ActivateRegistry(int argc, */ //============================================================================= -void Session_ServerThread::ActivateContainerManager(int argc, - char ** argv) -{ - try - { - PortableServer::POA_var root_poa=PortableServer::POA::_the_root_poa(); - cout << "ActivateContainerManager ......!!!! " << endl; - SALOME_ContainerManager * myContainer - = new SALOME_ContainerManager(_orb); - } - catch(CORBA::SystemException&) - { - INFOS("Caught CORBA::SystemException."); - } - catch(PortableServer::POA::WrongPolicy&) - { - INFOS("Caught CORBA::WrongPolicyException."); - } - catch(PortableServer::POA::ServantAlreadyActive&) - { - INFOS("Caught CORBA::ServantAlreadyActiveException"); - } - catch(CORBA::Exception&) - { - INFOS("Caught CORBA::Exception."); - } - catch(...) - { - INFOS("Caught unknown exception."); - } -} - -//============================================================================= -/*! - * - */ -//============================================================================= - void Session_ServerThread::ActivateContainer(int argc, char ** argv) { diff --git a/src/TestContainer/TestContainer.cxx b/src/TestContainer/TestContainer.cxx index e8492fb6e..b668b740b 100644 --- a/src/TestContainer/TestContainer.cxx +++ b/src/TestContainer/TestContainer.cxx @@ -120,9 +120,9 @@ int main (int argc, char * argv[]) if (!CORBA::is_nil(theObj)) inc = CosNaming::NamingContext::_narrow(theObj); } - catch( CORBA::COMM_FAILURE& ) + catch( CORBA::SystemException& ) { - INFOS( "Test Container: CORBA::COMM_FAILURE: Unable to contact the Naming Service" ) + INFOS( "Test Container: CORBA::SystemException: Unable to contact the Naming Service" ) } if(!CORBA::is_nil(inc)) { diff --git a/src/Utils/Makefile.in b/src/Utils/Makefile.in index f7f5d5a65..c862428f3 100644 --- a/src/Utils/Makefile.in +++ b/src/Utils/Makefile.in @@ -46,7 +46,8 @@ EXPORT_HEADERS= \ Utils_SINGLETON.hxx \ Utils_DESTRUCTEUR_GENERIQUE.hxx \ Utils_ExceptHandlers.hxx \ - Utils_SignalsHandler.h + Utils_SignalsHandler.h \ + Utils_Mutex.hxx EXPORT_PYSCRIPTS = Utils_Identity.py SALOME_utilities.py # Libraries targets @@ -58,7 +59,8 @@ LIB_SRC = OpUtil.cxx Utils_Timer.cxx duplicate.cxx \ Utils_Identity.cxx Utils_ORB_INIT.cxx \ Utils_DESTRUCTEUR_GENERIQUE.cxx \ Utils_ExceptHandlers.cxx \ - Utils_SignalsHandler.cxx + Utils_SignalsHandler.cxx \ + Utils_Mutex.cxx LIB_SERVER_IDL = SALOME_Exception.idl diff --git a/src/Utils/Utils_CorbaException.hxx b/src/Utils/Utils_CorbaException.hxx index 5d6d5bf51..c05e8e50a 100644 --- a/src/Utils/Utils_CorbaException.hxx +++ b/src/Utils/Utils_CorbaException.hxx @@ -45,7 +45,7 @@ throw SALOME::SALOME_Exception(ExDescription); \ } -#include +#include //Dump the CORBA exception type. inline std::ostream& operator<<(std::ostream& os, const CORBA::Exception& e) diff --git a/src/Utils/Utils_Mutex.cxx b/src/Utils/Utils_Mutex.cxx new file mode 100644 index 000000000..0aa3e4514 --- /dev/null +++ b/src/Utils/Utils_Mutex.cxx @@ -0,0 +1,85 @@ +// SALOME Utils : general SALOME's definitions and tools +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// File: Utils_Mutex.cxx +// Author: Sergey ANIKIN +// Module : SALOME +// $Header$ + + +#include + +Utils_Mutex::Utils_Mutex() +: myCount( 0 ) +{ + pthread_mutex_init( &myMutex, 0 ); + pthread_mutex_init( &myHelperMutex, 0 ); +} + +Utils_Mutex::~Utils_Mutex() +{ + pthread_mutex_destroy( &myHelperMutex ); + pthread_mutex_destroy( &myMutex ); +} + +void Utils_Mutex::lock() +{ + pthread_mutex_lock( &myHelperMutex ); + + if ( myCount > 0 && myThread == pthread_self() ) { + myCount++; + } + else { + pthread_mutex_unlock( &myHelperMutex ); + pthread_mutex_lock( &myMutex ); + pthread_mutex_lock( &myHelperMutex ); + myCount = 1; + myThread = pthread_self(); + } + + pthread_mutex_unlock( &myHelperMutex ); +} + +void Utils_Mutex::unlock() +{ + pthread_mutex_lock( &myHelperMutex ); + + if ( myThread == pthread_self() ) { + if ( myCount && (--myCount) < 1 ) { + myCount = 0; + pthread_mutex_unlock( &myMutex ); + } + } + + pthread_mutex_unlock( &myHelperMutex ); +} + +Utils_Locker::Utils_Locker( Utils_Mutex* mutex ) +: myMutex( mutex ) +{ + if ( myMutex ) myMutex->lock(); +} + +Utils_Locker::~Utils_Locker() +{ + if ( myMutex ) myMutex->unlock(); +} diff --git a/src/Utils/Utils_Mutex.hxx b/src/Utils/Utils_Mutex.hxx new file mode 100644 index 000000000..d33df2211 --- /dev/null +++ b/src/Utils/Utils_Mutex.hxx @@ -0,0 +1,59 @@ +// SALOME Utils : general SALOME's definitions and tools +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// File: Utils_Mutex.hxx +// Author: Sergey ANIKIN +// Module : SALOME +// $Header$ + + +#ifndef Utils_Mutex_HeaderFile +#define Utils_Mutex_HeaderFile + +#include + +class Utils_Mutex +{ +public: + Utils_Mutex(); + ~Utils_Mutex(); + + void lock(); + void unlock(); + +private: + pthread_mutex_t myMutex; + pthread_mutex_t myHelperMutex; + pthread_t myThread; + int myCount; +}; + +class Utils_Locker +{ +public: + Utils_Locker( Utils_Mutex* ); + virtual ~Utils_Locker(); + +private: + Utils_Mutex* myMutex; +}; + +#endif