From 81a9dcfa8d5f7cb352365f119bc86f5a96e0c230 Mon Sep 17 00:00:00 2001 From: enk Date: Tue, 6 Sep 2005 09:09:42 +0000 Subject: [PATCH] Porting to SALOME 3.0 --- INSTALL | 9 +- Makefile.in | 1 - README | 14 +- adm_local/unix/make_commence.in | 7 +- bin/VERSION | 2 +- configure.in.base | 11 +- idl/Makefile.in | 2 +- resources/SIERPINSKYCatalog.xml | 2 +- resources/graph2.xml | 1073 ++++++++++++-------- src/Sierpinsky/Makefile.in | 8 +- src/Sierpinsky/SIERPINSKY_Gen_i.cxx | 6 +- src/SierpinskyGUI/Makefile.in | 11 +- src/SierpinskyGUI/SIERPINSKY_icons.po | 2 + src/SierpinskyGUI/SIERPINSKY_msg_en.po | 9 + src/SierpinskyGUI/SierpinskyGUI.cxx | 119 ++- src/SierpinskyGUI/SierpinskyGUI.h | 29 +- src/SierpinskyGUI/SierpinskyGUI_RunDlg.cxx | 74 +- src/SierpinskyGUI/SierpinskyGUI_RunDlg.h | 20 +- 18 files changed, 874 insertions(+), 525 deletions(-) diff --git a/INSTALL b/INSTALL index 70ef8cc..7cd600c 100644 --- a/INSTALL +++ b/INSTALL @@ -1,4 +1,7 @@ -This is the version 0.1 of SIERPINSKY module +This is the version 0.2 of SIERPINSKY module Requires : - - SALOME KERNEL 2.2.4 - - RANDOMIZER 0.1 + - SALOME KERNEL 3.0.2 + - SALOME GUI 3.0.2 + - SALOME MED 3.0.2 + - SALOME VISU 3.0.2 + - RANDOMIZER 0.2 diff --git a/Makefile.in b/Makefile.in index 4fe142f..04e0ad6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -17,7 +17,6 @@ SUBDIRS = idl src RESOURCES_FILES = \ SIERPINSKYCatalog.xml \ - SIERPINSKY_en.xml \ SIERPINSKY.png \ go.png \ graph1.xml \ diff --git a/README b/README index 2359dd0..8c36269 100755 --- a/README +++ b/README @@ -1,7 +1,7 @@ ============================================================ README for: -* Randomizer module : version 0.1 -* Sierpinsky module : version 0.1 +* Randomizer module : version 0.2 +* Sierpinsky module : version 0.2 ============================================================ Contents of this file: @@ -23,8 +23,8 @@ Randomizer and Sierpinsky SALOME-based modules implement simple interface to cal 2. Prerequisites. ======================================================= -SALOME version 2.2.4 is used as a referense version of SALOME platform. -All other products are those used by SALOME v2.2.4. +SALOME version 3.0.2 is used as a referense version of SALOME platform. +All other products are those used by SALOME v3.0.2. ======================================================= 3. Installation. @@ -32,13 +32,13 @@ All other products are those used by SALOME v2.2.4. The compilation procedure is exactly the same as for other SALOME modules: -3.1. install SALOME 2.2.4 with all prerequisite products; +3.1. install SALOME 3.0.2 with all prerequisite products; 3.2. unpack Randomizer and Sierpinsky modules sources; 3.3 set environment: source /env_products.csh - where is a directory where SALOME 2.2.4 is installed to. + where is a directory where SALOME 3.0.2 is installed to. 3.4 create build directory for Randomizer module: @@ -69,7 +69,7 @@ To launch SALOME application the following steps should be performed: source /env_products.csh - where is a directory where SALOME 2.2.4 is installed to. + where is a directory where SALOME 3.0.2 is installed to. 4.3. add Randomizer and Sierpinsky modules environment: diff --git a/adm_local/unix/make_commence.in b/adm_local/unix/make_commence.in index 7130d52..d5b6316 100644 --- a/adm_local/unix/make_commence.in +++ b/adm_local/unix/make_commence.in @@ -77,6 +77,9 @@ QT_MT_LIBS = @QT_MT_LIBS@ MOC = @MOC@ UIC = @UIC@ +# msg2qm + +MSG2QM = @MSG2QM@ #QWT @@ -270,8 +273,8 @@ ac_cxx_mutable.m4 check_mico.m4 libtool.m4 \ ac_cxx_namespaces.m4 check_omniorb.m4 pyembed.m4 \ ac_cxx_partial_specialization.m4 check_opengl.m4 python.m4 \ ac_cxx_typename.m4 check_pthreads.m4 check_cas.m4 \ -ac_cc_warnings.m4 check_qt.m4 check_med2.m4 \ -check_swig.m4 check_boost.m4 +ac_cc_warnings.m4 check_qt.m4 check_swig.m4 \ +check_boost.m4 $(top_srcdir)/aclocal.m4: $(ACLOCAL_SRC:%=@KERNEL_ROOT_DIR@/salome_adm/unix/config_files/%) cd $(top_srcdir) ; aclocal --acdir=adm_local/unix/config_files -I @KERNEL_ROOT_DIR@/salome_adm/unix/config_files diff --git a/bin/VERSION b/bin/VERSION index 32ae3cd..1f21a15 100755 --- a/bin/VERSION +++ b/bin/VERSION @@ -1 +1 @@ -THIS IS SIERPINSKY COMPONENT - VERSION: 0.1 +THIS IS SIERPINSKY COMPONENT - VERSION: 0.2 diff --git a/configure.in.base b/configure.in.base index 553ac6f..23abbf1 100644 --- a/configure.in.base +++ b/configure.in.base @@ -217,6 +217,14 @@ echo CHECK_QT +echo +echo --------------------------------------------- +echo testing msg2qm +echo --------------------------------------------- +echo + +CHECK_MSG2QM + echo echo --------------------------------------------- echo testing VTK @@ -296,7 +304,8 @@ echo --------------------------------------------- echo echo Configure -variables="cc_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok med2_ok omniORB_ok occ_ok doxygen_ok graphviz_ok Kernel_ok Med_ok Visu_ok Randomizer_ok" +variables="cc_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok +OpenGL_ok qt_ok msg2qm_ok vtk_ok hdf5_ok med2_ok omniORB_ok occ_ok doxygen_ok graphviz_ok Kernel_ok Med_ok Visu_ok Randomizer_ok" for var in $variables do diff --git a/idl/Makefile.in b/idl/Makefile.in index cb7e402..31e2cb3 100644 --- a/idl/Makefile.in +++ b/idl/Makefile.in @@ -9,7 +9,7 @@ top_srcdir=@top_srcdir@ top_builddir=.. srcdir=@srcdir@ -VPATH=.:${KERNEL_ROOT_DIR}/idl/salome +VPATH=.:${KERNEL_ROOT_DIR}/idl/salome:${MED_ROOT_DIR}/idl/salome @COMMENCE@ diff --git a/resources/SIERPINSKYCatalog.xml b/resources/SIERPINSKYCatalog.xml index a2df5a4..21828a4 100644 --- a/resources/SIERPINSKYCatalog.xml +++ b/resources/SIERPINSKYCatalog.xml @@ -8,7 +8,7 @@ Sierpinsky OTHER Vadim SANDLER (VSR) - 0.1 + 0.2 unknown 0 SIERPINSKY.png diff --git a/resources/graph2.xml b/resources/graph2.xml index 47dc13b..13dc9f9 100644 --- a/resources/graph2.xml +++ b/resources/graph2.xml @@ -1,892 +1,1107 @@ - - - -? + + + + ? ? aNewDataFlow_1 1 ? -aNewDataFlow_1 + aNewDataFlow_1 - -long - Loop__nbIter -long - Loop__iter + long + Loop__nbIter + + + long + Loop__iter + -double - ExportToMED__size + double + ExportToMED__size + -string - getFileNames__medFile + string + getFileNames__medFile + -string - getFileNames__jpegFile + string + getFileNames__jpegFile + -long - ExportToJPEG__size + long + ExportToJPEG__size + + - -double - EndLoop__x -double - EndLoop__y + double + EndLoop__x + -long - EndLoop__nbIter + double + EndLoop__y + -long - EndLoop__iter + long + EndLoop__nbIter + -long - CheckMedFile__ko + long + EndLoop__iter + -boolean - ExportToJPEG__return + long + CheckMedFile__ko + + + boolean + ExportToJPEG__return + + + 13/7/2005 - 13:45:3 - 14/7/2005 - 17:53:15 + 5/9/2005 - 17:48:48 2.0 ? ? ? 0 - 0 + 0 + + - -RANDOMIZER + + RANDOMIZER RANDOMIZER InitPoint 0 ? -InitPoint + InitPoint - -double - theX -double - theY + double + theX + + + double + theY + + + - 14/7/2005 - 17:28:25 - 14/7/2005 - 17:28:25 + 5/9/2005 - 17:48:48 + 5/9/2005 - 17:48:48 2.0 ? FactoryServerPy InitPoint from RANDOMIZER 20 - 7 + 7 + -RANDOMIZER + RANDOMIZER RANDOMIZER NextIteration 0 ? -NextIteration + NextIteration - -long - return + + long + return + + + - 14/7/2005 - 17:28:25 - 14/7/2005 - 17:28:25 + 5/9/2005 - 17:48:48 + 5/9/2005 - 17:48:48 2.0 ? FactoryServerPy NextIteration from RANDOMIZER 633 - 207 + 207 + -SIERPINSKY + SIERPINSKY SIERPINSKY NextPoint 0 ? -NextPoint + NextPoint - -double - X -double - Y + double + X + + + double + Y + -long - iter + long + iter + + - -double - nextX -double - nextY + double + nextX + + + double + nextY + + + - 14/7/2005 - 17:28:25 - 14/7/2005 - 17:28:25 + 5/9/2005 - 17:48:48 + 5/9/2005 - 17:48:48 2.0 ? localhost/FactoryServer NextPoint from SIERPINSKY 825 - 7 + 7 + -? + ? ? Loop 4 EndLoop -Loop + Loop - -double - x -double - y + double + x + + + double + y + -long - nbIter + long + nbIter + -long - iter + long + iter + + - -double - x -double - y + double + x + -long - nbIter + double + y + -long - iter + long + nbIter + + + long + iter + + + - -InitLoop + + InitLoop - + + -MoreLoop + MoreLoop - + + -NextLoop + NextLoop - - 14/7/2005 - 17:28:25 - 14/7/2005 - 17:28:25 + + + + 5/9/2005 - 17:48:48 + 5/9/2005 - 17:48:48 2.0 ? ? Compute Node 432 - 47 + 47 + -? + ? ? EndLoop 5 Loop -EndLoop + EndLoop - -double - x -double - y + double + x + -long - nbIter + double + y + -long - iter + long + nbIter + + + long + iter + + - -double - x -double - y + double + x + + + double + y + -long - nbIter + long + nbIter + -long - iter + long + iter + + + - -EndLoop - - 14/7/2005 - 17:28:25 - 14/7/2005 - 17:28:25 + + EndLoop + + + + 5/9/2005 - 17:48:48 + 5/9/2005 - 17:48:48 2.0 ? ? Compute Node 1015 - 47 + 47 + -SIERPINSKY + SIERPINSKY SIERPINSKY ExportToMED 0 ? -ExportToMED + ExportToMED - -string - fileName -double - size + string + fileName + + + double + size + + - -boolean - return + + boolean + return + + + - 14/7/2005 - 17:28:25 - 14/7/2005 - 17:28:25 + 5/9/2005 - 17:48:48 + 5/9/2005 - 17:48:48 2.0 ? localhost/FactoryServer ExportToMED from SIERPINSKY 474 - 484 + 484 + -? + ? ? ImportToVISU 3 ? -ImportToVISU + ImportToVISU - -string - fileName - + + string + fileName + + + + - -ImportToVISU - - - - - - - - - - - - - - - - - - - - - - + + ImportToVISU + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - 14/7/2005 - 17:28:25 - 14/7/2005 - 17:28:25 + + + 5/9/2005 - 17:48:48 + 5/9/2005 - 17:48:48 2.0 ? ? Compute Node 861 - 460 + 460 + -? + ? ? CheckMedFile 6 EndOfCheckMedFile -ImportToVISU_1 + CheckMedFile - -long - ok + + long + ok + + - -long - ok -long - ko + long + ok + + + long + ko + + + - -CheckMedFile + + CheckMedFile - - 14/7/2005 - 17:28:25 - 14/7/2005 - 17:28:25 + + + + 5/9/2005 - 17:48:48 + 5/9/2005 - 17:48:48 2.0 ? ? Compute Node 662 - 524 + 524 + -? + ? ? EndOfCheckMedFile 7 CheckMedFile -EndImportToVISU + EndOfCheckMedFile - + + - -EndImportToVISU - - 14/7/2005 - 17:28:25 - 14/7/2005 - 17:28:25 + + EndImportToVISU + + + + 5/9/2005 - 17:48:48 + 5/9/2005 - 17:48:48 2.0 ? ? Compute Node 1054 - 520 + 520 + -SIERPINSKY + SIERPINSKY SIERPINSKY Init 0 ? -Init + Init - -double - X1 -double - Y1 + double + X1 + -double - X2 + double + Y1 + -double - Y2 + double + X2 + -double - X3 + double + Y2 + -double - Y3 - + double + X3 + + + double + Y3 + + + + - 14/7/2005 - 17:28:25 - 14/7/2005 - 17:28:25 + 5/9/2005 - 17:48:48 + 5/9/2005 - 17:48:48 2.0 ? localhost/FactoryServer Init from SIERPINSKY 234 - 185 + 185 + -RANDOMIZER + RANDOMIZER RANDOMIZER InitPoint_1 0 ? -InitPoint + InitPoint - -double - theX -double - theY + double + theX + + + double + theY + + + - 14/7/2005 - 17:28:25 - 14/7/2005 - 17:28:25 + 5/9/2005 - 17:48:48 + 5/9/2005 - 17:48:48 2.0 ? FactoryServerPy InitPoint from RANDOMIZER 20 - 185 + 185 + -RANDOMIZER + RANDOMIZER RANDOMIZER InitPoint_2 0 ? -InitPoint + InitPoint - -double - theX -double - theY + double + theX + + + double + theY + + + - 14/7/2005 - 17:28:25 - 14/7/2005 - 17:28:25 + 5/9/2005 - 17:48:48 + 5/9/2005 - 17:48:48 2.0 ? FactoryServerPy InitPoint from RANDOMIZER 20 - 317 + 317 + -RANDOMIZER + RANDOMIZER RANDOMIZER InitPoint_3 0 ? -InitPoint + InitPoint - -double - theX -double - theY + double + theX + + + double + theY + + + - 14/7/2005 - 17:28:25 - 14/7/2005 - 17:28:25 + 5/9/2005 - 17:48:48 + 5/9/2005 - 17:48:48 2.0 ? FactoryServerPy InitPoint from RANDOMIZER 20 - 448 + 448 + -? + ? ? getFileNames 3 ? -getFileNames + getFileNames - -string - medFile -string - jpegFile + string + medFile + + + string + jpegFile + + - -string - medFile -string - jpegFile + string + medFile + + + string + jpegFile + + + - -getMedFileName + + getMedFileName - - 14/7/2005 - 17:28:25 - 14/7/2005 - 17:28:25 + + + + 5/9/2005 - 17:48:48 + 5/9/2005 - 17:48:48 2.0 ? ? Compute Node 21 - 594 + 594 + -SIERPINSKY + SIERPINSKY SIERPINSKY ExportToJPEG 0 ? -ExportToJPEG + ExportToJPEG - -string - fileName -long - size + string + fileName + + + long + size + + - -boolean - return + + boolean + return + + + - 14/7/2005 - 17:28:25 - 14/7/2005 - 17:28:25 + 5/9/2005 - 17:48:48 + 5/9/2005 - 17:48:48 2.0 ? localhost/FactoryServer ExportToJPEG from SIERPINSKY 474 - 658 + 658 + + - -InitPoint + + InitPoint theX Loop x - + + -InitPoint + InitPoint theY Loop y - + + -NextIteration + NextIteration return NextPoint iter - -807 - 118 -807 - 278 + 807 + 118 + + + 807 + 278 + + + -NextPoint + NextPoint nextX EndLoop x - + + -NextPoint + NextPoint nextY EndLoop y - + + -Loop + Loop DoLoop EndLoop DoLoop - + + -Loop + Loop x NextPoint X - + + -Loop + Loop y NextPoint Y - + + -Loop + Loop nbIter EndLoop nbIter - + + -Loop + Loop iter EndLoop iter - + + -Loop + Loop Gate NextIteration Gate - -615 - 302 -615 - 162 + 615 + 302 + + + 615 + 162 + + + -EndLoop + EndLoop DoLoop Loop DoLoop - + + -EndLoop + EndLoop Gate ExportToMED Gate - -457 - 599 -457 - 377 + 457 + 599 + + + 457 + 377 + -1195 - 377 + 1195 + 377 + -1195 - 162 + 1195 + 162 + + + -EndLoop + EndLoop Gate ExportToJPEG Gate - -457 - 773 -457 - 377 + 457 + 773 + -1195 - 377 + 457 + 377 + -1195 - 162 + 1195 + 377 + + + 1195 + 162 + + + -ExportToMED + ExportToMED return CheckMedFile ok - + + -ImportToVISU + ImportToVISU Gate EndOfCheckMedFile Default - + + -CheckMedFile + CheckMedFile ok ImportToVISU Gate - + + -Init + Init Gate Loop Gate - -412 - 162 -412 - 380 + 412 + 162 + + + 412 + 380 + + + -InitPoint_1 + InitPoint_1 theX Init X1 - + + -InitPoint_1 + InitPoint_1 theY Init Y1 - + + -InitPoint_2 + InitPoint_2 theX Init X2 - -198 - 296 -198 - 388 + 198 + 296 + + + 198 + 388 + + + -InitPoint_2 + InitPoint_2 theY Init Y2 - -204 - 316 -204 - 408 + 204 + 316 + + + 204 + 408 + + + -InitPoint_3 + InitPoint_3 theX Init X3 - -210 - 336 -210 - 519 + 210 + 336 + + + 210 + 519 + + + -InitPoint_3 + InitPoint_3 theY Init Y3 - -216 - 356 -216 - 539 + 216 + 356 + + + 216 + 539 + + + -getFileNames + getFileNames medFile ExportToMED fileName - -355 - 555 -355 - 665 + 355 + 555 + + + 355 + 665 + + + -getFileNames + getFileNames medFile ImportToVISU fileName - -842 - 531 -842 - 430 + 842 + 531 + -355 - 430 + 842 + 430 + -355 - 665 + 355 + 430 + + + 355 + 665 + + + -getFileNames + getFileNames jpegFile ExportToJPEG fileName - -356 - 729 -356 - 685 + 356 + 729 + + + 356 + 685 + + + + - -aNewDataFlow_1 + + aNewDataFlow_1 Loop__nbIter Loop nbIter -3 - 500 - + 3 + 500 + + + -aNewDataFlow_1 + aNewDataFlow_1 Loop__iter Loop iter -3 - 0 - + 3 + 0 + + + -aNewDataFlow_1 + aNewDataFlow_1 ExportToMED__size ExportToMED size -7 - 100 - + 7 + 100 + + + -aNewDataFlow_1 + aNewDataFlow_1 getFileNames__medFile getFileNames medFile -18 - - + 18 + /tmp/sierpinsky_graph2.med + + + -aNewDataFlow_1 + aNewDataFlow_1 getFileNames__jpegFile getFileNames jpegFile -18 - - + 18 + /tmp/sierpinsky_graph2.jpg + + + -aNewDataFlow_1 + aNewDataFlow_1 ExportToJPEG__size ExportToJPEG size -3 - 100 - + 3 + 100 + + + + + + + diff --git a/src/Sierpinsky/Makefile.in b/src/Sierpinsky/Makefile.in index cafbee7..c9c0894 100644 --- a/src/Sierpinsky/Makefile.in +++ b/src/Sierpinsky/Makefile.in @@ -20,12 +20,12 @@ LIB = libSIERPINSKYEngine.la LIB_SRC = SIERPINSKY_Gen_i.cxx -LIB_SERVER_IDL = Sierpinsky.idl +LIB_SERVER_IDL = Sierpinsky.idl MED.idl LIB_CLIENT_IDL = SALOME_Component.idl SALOME_Exception.idl SALOMEDS.idl -CPPFLAGS += -I${KERNEL_ROOT_DIR}/include/salome $(BOOST_CPPFLAGS) $(HDF5_INCLUDES) +CPPFLAGS += -I${KERNEL_ROOT_DIR}/include/salome $(HDF5_INCLUDES) -I${MED_ROOT_DIR}/include/salome $(BOOST_CPPFLAGS) -LDFLAGS += -L${KERNEL_ROOT_DIR}/lib/salome -lSalomeContainer -lSalomeNS -lOpUtil -lRegistry -lSalomeNotification -lSALOMELocalTrace -lgd -lMEDWrapper -LDFLAGSFORBIN += -L${KERNEL_ROOT_DIR}/lib/salome -lSalomeContainer -lSalomeNS -lOpUtil -lRegistry -lSalomeNotification -lSALOMELocalTrace -lgd -lMEDWrapper +LDFLAGS += -L${KERNEL_ROOT_DIR}/lib/salome -L${MED_ROOT_DIR}/lib/salome -lSalomeContainer -lSalomeNS -lOpUtil -lRegistry -lSalomeNotification -lSALOMELocalTrace -lgd -lMEDWrapper +LDFLAGSFORBIN += -L${KERNEL_ROOT_DIR}/lib/salome -L${MED_ROOT_DIR}/lib/salome -lSalomeContainer -lSalomeNS -lOpUtil -lRegistry -lSalomeNotification -lSALOMELocalTrace -lgd -lMEDWrapper -lMEDWrapper_V2_2 -lMEDWrapper_V2_1 -lMEDWrapperBase @CONCLUDE@ diff --git a/src/Sierpinsky/SIERPINSKY_Gen_i.cxx b/src/Sierpinsky/SIERPINSKY_Gen_i.cxx index 6f94aca..7069dbb 100644 --- a/src/Sierpinsky/SIERPINSKY_Gen_i.cxx +++ b/src/Sierpinsky/SIERPINSKY_Gen_i.cxx @@ -22,9 +22,9 @@ extern "C" const char* instanceName, const char* interfaceName ) { - SIERPINSKY_Gen_i* anEngine = new SIERPINSKY_Gen_i( orb, poa, contId, instanceName, interfaceName ); - return anEngine->getId() ; - } + SIERPINSKY_Gen_i* anEngine = new SIERPINSKY_Gen_i( orb, poa, contId, instanceName, interfaceName ); + return anEngine->getId() ; +} } /*! diff --git a/src/SierpinskyGUI/Makefile.in b/src/SierpinskyGUI/Makefile.in index 93900a7..4f2b94a 100644 --- a/src/SierpinskyGUI/Makefile.in +++ b/src/SierpinskyGUI/Makefile.in @@ -27,13 +27,16 @@ LIB_SRC = \ SierpinskyGUI_RunDlg.cxx LIB_MOC = \ - SierpinskyGUI_RunDlg.h + SierpinskyGUI_RunDlg.h \ + SierpinskyGUI.h LIB_CLIENT_IDL = SALOME_Component.idl SALOME_Exception.idl SALOMEDS.idl Sierpinsky.idl Randomizer.idl \ SALOME_GenericObj.idl SALOMEDS_Attributes.idl SALOME_Comm.idl MED.idl VISU_Gen.idl -CPPFLAGS+= $(QT_INCLUDES) $(OCC_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome -I${RANDOMIZER_ROOT_DIR}/include/salome -CXXFLAGS+= $(QT_INCLUDES) $(OCC_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome -I${RANDOMIZER_ROOT_DIR}/include/salome -LDFLAGS+= -L${KERNEL_ROOT_DIR}/lib/salome $(QT_LIBS) -lSalomeGUI -lSIERPINSKYEngine -L${RANDOMIZER_ROOT_DIR}/lib/salome +CPPFLAGS+= $(QT_INCLUDES) $(OCC_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome -I${RANDOMIZER_ROOT_DIR}/include/salome -I${GUI_ROOT_DIR}/include/salome $(BOOST_CPPFLAGS) + +CXXFLAGS+= $(QT_INCLUDES) $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome -I${RANDOMIZER_ROOT_DIR}/include/salome -I${GUI_ROOT_DIR}/include/salome + +LDFLAGS+= -L${KERNEL_ROOT_DIR}/lib/salome $(QT_LIBS) -L${GUI_ROOT_DIR}/lib/salome -lSalomeApp -lSIERPINSKYEngine -L${RANDOMIZER_ROOT_DIR}/lib/salome -L${GUI_ROOT_DIR}/include/salome -lSalomeLifeCycleCORBA @CONCLUDE@ diff --git a/src/SierpinskyGUI/SIERPINSKY_icons.po b/src/SierpinskyGUI/SIERPINSKY_icons.po index b386757..d1fc0e8 100644 --- a/src/SierpinskyGUI/SIERPINSKY_icons.po +++ b/src/SierpinskyGUI/SIERPINSKY_icons.po @@ -9,3 +9,5 @@ msgstr "" "Last-Translator: FULLNAME \n" "Content-Type: text/plain; charset=iso-8859-1\n" +msgid "ICON_RUN_DLG" +msgstr "go.png" diff --git a/src/SierpinskyGUI/SIERPINSKY_msg_en.po b/src/SierpinskyGUI/SIERPINSKY_msg_en.po index 0681603..7777329 100644 --- a/src/SierpinskyGUI/SIERPINSKY_msg_en.po +++ b/src/SierpinskyGUI/SIERPINSKY_msg_en.po @@ -10,6 +10,15 @@ msgstr "" "Last-Translator: FULLNAME \n" "Content-Type: text/plain; charset=iso-8859-1\n" +msgid "SierpinskyGUI::RUN" +msgstr "Run" + +msgid "SierpinskyGUI::CAPTION" +msgstr "Run Sierpinsky dialog" + +msgid "SierpinskyGUI::MENU_Sierpinsky" +msgstr "Sierpinsky" + msgid "SierpinskyGUI_RunDlg::CAPTION" msgstr "Run Sierpinsky Algo" diff --git a/src/SierpinskyGUI/SierpinskyGUI.cxx b/src/SierpinskyGUI/SierpinskyGUI.cxx index ef8568c..eb87268 100644 --- a/src/SierpinskyGUI/SierpinskyGUI.cxx +++ b/src/SierpinskyGUI/SierpinskyGUI.cxx @@ -6,52 +6,121 @@ /////////////////////////////////////////////////////////// #include "SierpinskyGUI.h" -#include "SierpinskyGUI_RunDlg.h" -#include "QAD_Desktop.h" +#include +#include +#include +#include +#include -SierpinskyGUI* SierpinskyGUI::GetSierpinskyGUI() +#include + +/*! + * Constructor + */ +SierpinskyGUI::SierpinskyGUI() : + SalomeApp_Module("Sierpinsky") { - static SierpinskyGUI gui; - return &gui; +} + +/*! + * Gets an reference to the module's engine + */ +SIERPINSKY_ORB::SIERPINSKY_ptr SierpinskyGUI::InitSIERPINSKYGen( SalomeApp_Application* app ) +{ + SIERPINSKY_ORB::SIERPINSKY_ptr clr; + try{ + Engines::Component_var comp = app->lcc()->FindOrLoad_Component( "FactoryServer","SIERPINSKY" ); + clr = SIERPINSKY_ORB::SIERPINSKY::_narrow(comp); + } + catch (CORBA::Exception&){ + MESSAGE("Caught CORBA::Exception."); + } + catch (...){ + MESSAGE("Caught unknown exception."); + } + return clr; } /*! - * Constructor + * Module's initialization */ -SierpinskyGUI::SierpinskyGUI( const QString& name, QObject* parent ) +void SierpinskyGUI::initialize( CAM_Application* app ) { + SalomeApp_Module::initialize( app ); + + InitSIERPINSKYGen( dynamic_cast( app ) ); + + QWidget* aParent = app->desktop(); + SUIT_ResourceMgr* aResourceMgr = app->resourceMgr(); + + // create actions + QPixmap aPixmap = aResourceMgr->loadPixmap( "SIERPINSKY",tr( "ICON_RUN_DLG" ) ); + createAction( 901, tr( "Run Dialog" ), QIconSet(aPixmap), tr( "RUN" ), tr( "CAPTION" ), 0, aParent, false, + this, SLOT( OnRun() ) ); + + // create menus + int aMenuId; + aMenuId = createMenu( tr( "MENU_Sierpinsky" ), -1, -1, 30 ); + createMenu( 901, aMenuId, 10 ); + + // create toolbars + int aToolId = createTool ( tr( "TOOL_Sierpinsky" ) ); + createTool( 901, aToolId ); } /*! - * Destructor + * Module's engine IOR */ -SierpinskyGUI::~SierpinskyGUI() +QString SierpinskyGUI::engineIOR() const { + CORBA::String_var anIOR = getApp()->orb()->object_to_string( InitSIERPINSKYGen( getApp() ) ); + return QString( anIOR.in() ); } /*! - * Processes GUI event + * Module's activation */ -bool SierpinskyGUI::OnGUIEvent( int theCommandID, QAD_Desktop* parent ) -{ - switch( theCommandID ) { - case 10000: - { - SierpinskyGUI_RunDlg* aDlg = new SierpinskyGUI_RunDlg( parent ); - aDlg->exec(); - break; - } - } - return true; +bool SierpinskyGUI::activateModule( SUIT_Study* theStudy ) +{ + bool bOk = SalomeApp_Module::activateModule( theStudy ); + + setMenuShown(true); + setToolShown(true); + + return bOk; +} + +/*! + * Module's deactivation + */ +bool SierpinskyGUI::deactivateModule( SUIT_Study* theStudy ) +{ + setMenuShown(false); + setToolShown(false); + + return SalomeApp_Module::deactivateModule( theStudy ); } /*! - * GUI factory + * Destructor */ -extern "C" +SierpinskyGUI::~SierpinskyGUI() { - Standard_EXPORT SALOMEGUI* GetComponentGUI() { - return SierpinskyGUI::GetSierpinskyGUI(); +} + + +// Action slot +void SierpinskyGUI::OnRun() +{ + QWidget* aParent = getApp()->desktop(); + SierpinskyGUI_RunDlg* aDlg = new SierpinskyGUI_RunDlg( aParent ); + aDlg->exec(); +} + +extern "C" { + CAM_Module* createModule() + { + return new SierpinskyGUI(); } } diff --git a/src/SierpinskyGUI/SierpinskyGUI.h b/src/SierpinskyGUI/SierpinskyGUI.h index c296982..eba7f07 100644 --- a/src/SierpinskyGUI/SierpinskyGUI.h +++ b/src/SierpinskyGUI/SierpinskyGUI.h @@ -8,23 +8,36 @@ #ifndef __SIERPINSKYGUI_H #define __SIERPINSKYGUI_H -#include "SALOMEGUI.h" +#include -class QAD_Desktop; +#include +#include CORBA_CLIENT_HEADER(Sierpinsky) -class SierpinskyGUI : public SALOMEGUI +class SUIT_Desktop; +class SalomeApp_Application; + +class SierpinskyGUI : public SalomeApp_Module { + Q_OBJECT; + public: // Constructor - SierpinskyGUI( const QString& name = "", QObject* parent = 0 ); + SierpinskyGUI(); // Destructor ~SierpinskyGUI(); - // Get the only instance of GUI - static SierpinskyGUI* SierpinskyGUI::GetSierpinskyGUI(); + void initialize( CAM_Application* ); + virtual QString engineIOR() const; + + static SIERPINSKY_ORB::SIERPINSKY_ptr InitSIERPINSKYGen( SalomeApp_Application* ); + +public slots: + bool deactivateModule( SUIT_Study* ); + bool activateModule( SUIT_Study* ); + +protected slots: + void OnRun(); - // Processes GUI event - virtual bool OnGUIEvent( int theCommandID, QAD_Desktop* parent ); }; #endif // __SIERPINSKYGUI_H diff --git a/src/SierpinskyGUI/SierpinskyGUI_RunDlg.cxx b/src/SierpinskyGUI/SierpinskyGUI_RunDlg.cxx index 146bea9..b47f1ef 100644 --- a/src/SierpinskyGUI/SierpinskyGUI_RunDlg.cxx +++ b/src/SierpinskyGUI/SierpinskyGUI_RunDlg.cxx @@ -6,6 +6,9 @@ /////////////////////////////////////////////////////////// #include "SierpinskyGUI_RunDlg.h" +#include "SALOME_LifeCycleCORBA.hxx" +#include "SalomeApp_Application.h" +//#include "VisuGUI_Tools.h" #include #include @@ -18,11 +21,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include CORBA_SERVER_HEADER(Sierpinsky) @@ -37,10 +40,17 @@ static RANDOMIZER_ORB::RANDOMIZER_var getRandomizerEngine() { static RANDOMIZER_ORB::RANDOMIZER_var aGen; if( CORBA::is_nil( aGen ) ) { - if( QAD_Desktop* aDesktop = QAD_Application::getDesktop() ) { - Engines::Component_var aComponent = aDesktop->getEngine( "FactoryServerPy","RANDOMIZER" ); + try{ + SALOME_LifeCycleCORBA aLCC(SalomeApp_Application::namingService()); + Engines::Component_var aComponent = aLCC.FindOrLoad_Component("FactoryServerPy","RANDOMIZER"); aGen = RANDOMIZER_ORB::RANDOMIZER::_narrow( aComponent ); } + catch (CORBA::Exception&){ + MESSAGE("Caught CORBA::Exception."); + } + catch (...){ + MESSAGE("Caught unknown exception."); + } } return aGen; } @@ -52,10 +62,17 @@ static SIERPINSKY_ORB::SIERPINSKY_var getSierpinskyEngine() { static SIERPINSKY_ORB::SIERPINSKY_var aGen; if( CORBA::is_nil( aGen ) ) { - if( QAD_Desktop* aDesktop = QAD_Application::getDesktop() ) { - Engines::Component_var aComponent = aDesktop->getEngine( "FactoryServer","SIERPINSKY" ); + try{ + SALOME_LifeCycleCORBA aLCC(SalomeApp_Application::namingService()); + Engines::Component_var aComponent = aLCC.FindOrLoad_Component("FactoryServer","SIERPINSKY"); aGen = SIERPINSKY_ORB::SIERPINSKY::_narrow( aComponent ); } + catch (CORBA::Exception&){ + MESSAGE("Caught CORBA::Exception."); + } + catch (...){ + MESSAGE("Caught unknown exception."); + } } return aGen; } @@ -67,10 +84,18 @@ static VISU::VISU_Gen_var getVisuEngine() { static VISU::VISU_Gen_var aGen; if( CORBA::is_nil( aGen ) ) { - if( QAD_Desktop* aDesktop = QAD_Application::getDesktop() ) { - Engines::Component_var aComponent = aDesktop->getEngine( "FactoryServer","VISU" ); + try{ + SALOME_LifeCycleCORBA aLCC(SalomeApp_Application::namingService()); + Engines::Component_var aComponent = aLCC.FindOrLoad_Component("FactoryServer","VISU"); aGen = VISU::VISU_Gen::_narrow( aComponent ); } + catch (CORBA::Exception&){ + MESSAGE("Caught CORBA::Exception."); + } + catch (...){ + MESSAGE("Caught unknown exception."); + } + } return aGen; } @@ -149,11 +174,11 @@ SierpinskyGUI_RunDlg::SierpinskyGUI_RunDlg( QWidget* parent ) box1Layout->setMargin( MARGIN_SIZE ); box1Layout->setSpacing( SPACING_SIZE ); QLabel* labX = new QLabel( "X:", box1 ); - myStartX = new QAD_SpinBoxDbl( box1, 0.0, 1.0, 0.1 ); + myStartX = new QtxDblSpinBox( 0.0, 1.0, 0.1 ,box1); myStartX->setMinimumWidth( 150 ); QLabel* labY = new QLabel( "Y:", box1 ); - myStartY = new QAD_SpinBoxDbl( box1, 0.0, 1.0, 0.1 ); + myStartY = new QtxDblSpinBox( 0.0, 1.0, 0.1 ,box1); myStartY->setMinimumWidth( 150 ); myStartRandom = new QCheckBox( tr( "RANDOM" ), box1 ); @@ -173,27 +198,27 @@ SierpinskyGUI_RunDlg::SierpinskyGUI_RunDlg( QWidget* parent ) box2Layout->setMargin( MARGIN_SIZE ); box2Layout->setSpacing( SPACING_SIZE ); QLabel* labX1 = new QLabel( "X1:", box2 ); - myX1 = new QAD_SpinBoxDbl( box2, 0.0, 1.0, 0.1 ); + myX1 = new QtxDblSpinBox( 0.0, 1.0, 0.1 , box2); myX1->setMinimumWidth( 150 ); QLabel* labY1 = new QLabel( "Y1:", box2 ); - myY1 = new QAD_SpinBoxDbl( box2, 0.0, 1.0, 0.1 ); + myY1 = new QtxDblSpinBox( 0.0, 1.0, 0.1 , box2); myY1->setMinimumWidth( 150 ); QLabel* labX2 = new QLabel( "X2:", box2 ); - myX2 = new QAD_SpinBoxDbl( box2, 0.0, 1.0, 0.1 ); + myX2 = new QtxDblSpinBox( 0.0, 1.0, 0.1 , box2); myX2->setMinimumWidth( 150 ); QLabel* labY2 = new QLabel( "Y2:", box2 ); - myY2 = new QAD_SpinBoxDbl( box2, 0.0, 1.0, 0.1 ); + myY2 = new QtxDblSpinBox( 0.0, 1.0, 0.1, box2); myY2->setMinimumWidth( 150 ); QLabel* labX3 = new QLabel( "X3:", box2 ); - myX3 = new QAD_SpinBoxDbl( box2, 0.0, 1.0, 0.1 ); + myX3 = new QtxDblSpinBox( 0.0, 1.0, 0.1, box2); myX3->setMinimumWidth( 150 ); QLabel* labY3 = new QLabel( "Y3:", box2 ); - myY3 = new QAD_SpinBoxDbl( box2, 0.0, 1.0, 0.1 ); + myY3 = new QtxDblSpinBox( 0.0, 1.0, 0.1, box2); myY3->setMinimumWidth( 150 ); myBaseRandom = new QCheckBox( tr( "RANDOM" ), box2 ); @@ -248,7 +273,7 @@ SierpinskyGUI_RunDlg::SierpinskyGUI_RunDlg( QWidget* parent ) myMedBtn->setFixedSize( 20, 20 ); QLabel* labMed = new QLabel( tr( "MESH_SIZE" ), box3 ); - myMedSize = new QAD_SpinBoxDbl( box3, 0.0, 1000, 1.0 ); + myMedSize = new QtxDblSpinBox( 0.0, 1000, 1.0, box3); myMedSize->setMinimumWidth( 150 ); myVisuCheck = new QCheckBox( tr( "IMPORT_MED_2_VISU" ), box3 ); @@ -334,7 +359,7 @@ void SierpinskyGUI_RunDlg::onBrowse() { const QObject* snd = sender(); bool jpg = snd == myJpegBtn; - QString aFileName = QAD_FileDlg::getFileName( this, + QString aFileName = SUIT_FileDlg::getFileName( this, jpg ? myJpegFile->text() : myMedFile->text(), QStringList::split( ":", jpg ? tr( "JPEG_FILES") : tr( "MED_FILES" ) ), jpg ? tr( "EXPORT_JPEG_FILE" ) : tr( "EXPORT_MED_FILE" ), @@ -389,7 +414,7 @@ void SierpinskyGUI_RunDlg::accept() SIERPINSKY_ORB::SIERPINSKY_var aSierpGen = getSierpinskyEngine(); if( CORBA::is_nil( aRandGen ) || CORBA::is_nil( aSierpGen ) ) { - QAD_MessageBox::error1( this, + SUIT_MessageBox::error1( this, tr( "ERR_ERROR" ), tr( "EXEC_ERROR" ), tr( "OK_BTN") ); @@ -403,7 +428,7 @@ void SierpinskyGUI_RunDlg::accept() aJPEGFile = myJpegFile->text().stripWhiteSpace(); aJPEGSize = myJpegSize->value(); if ( aJPEGFile.isEmpty() || aJPEGSize <= 0 ) { - int res = QAD_MessageBox::warn2( this, + int res = SUIT_MessageBox::warn2( this, tr( "WRN_WARNING" ), tr( "JPEG_PARAMETERS_ERROR" ), tr( "YES_BTN"), tr( "NO_BTN" ), 0, 1, 0 ); @@ -418,7 +443,7 @@ void SierpinskyGUI_RunDlg::accept() aMEDFile = myMedFile->text().stripWhiteSpace(); aMEDSize = myMedSize->value(); if ( aMEDFile.isEmpty() || aMEDSize <= 0 ) { - int res = QAD_MessageBox::warn2( this, + int res = SUIT_MessageBox::warn2( this, tr( "WRN_WARNING" ), tr( "MED_PARAMETERS_ERROR" ), tr( "YES_BTN"), tr( "NO_BTN" ), 0, 1, 0 ); @@ -521,7 +546,6 @@ void SierpinskyGUI_RunDlg::nextStep( const int step ) VISU::Result_var aResult = aVisuGen->ImportFile( aMEDFile.latin1() ); if ( !CORBA::is_nil( aResult ) ) aVisuGen->MeshOnEntity( aResult, "Sierpinsky", VISU::NODE ); - QAD_Application::getDesktop()->getActiveStudy()->updateObjBrowser( true ); } } } diff --git a/src/SierpinskyGUI/SierpinskyGUI_RunDlg.h b/src/SierpinskyGUI/SierpinskyGUI_RunDlg.h index 428e5b7..5e3a70d 100644 --- a/src/SierpinskyGUI/SierpinskyGUI_RunDlg.h +++ b/src/SierpinskyGUI/SierpinskyGUI_RunDlg.h @@ -15,7 +15,7 @@ class QCheckBox; class QSpinBox; class QPushButton; class QGroupBox; -class QAD_SpinBoxDbl; +class QtxDblSpinBox; class MyThread; class QProgressBar; @@ -46,17 +46,17 @@ protected slots: private: // widgets QGroupBox* box1; - QAD_SpinBoxDbl* myStartX; - QAD_SpinBoxDbl* myStartY; + QtxDblSpinBox* myStartX; + QtxDblSpinBox* myStartY; QCheckBox* myStartRandom; QGroupBox* box2; - QAD_SpinBoxDbl* myX1; - QAD_SpinBoxDbl* myY1; - QAD_SpinBoxDbl* myX2; - QAD_SpinBoxDbl* myY2; - QAD_SpinBoxDbl* myX3; - QAD_SpinBoxDbl* myY3; + QtxDblSpinBox* myX1; + QtxDblSpinBox* myY1; + QtxDblSpinBox* myX2; + QtxDblSpinBox* myY2; + QtxDblSpinBox* myX3; + QtxDblSpinBox* myY3; QCheckBox* myBaseRandom; QCheckBox* myBaseDefault; @@ -70,7 +70,7 @@ private: QCheckBox* myMedCheck; QLineEdit* myMedFile; QPushButton* myMedBtn; - QAD_SpinBoxDbl* myMedSize; + QtxDblSpinBox* myMedSize; QCheckBox* myVisuCheck; QPushButton* myStartBtn; -- 2.39.2