From d830c3602b351cb572edab1a3fd11ec355e502c3 Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 8 Nov 2005 12:43:13 +0000 Subject: [PATCH] PAL10427 --- adm_local/unix/config_files/check_gd.m4 | 53 ++++++++++++++++++++++ adm_local/unix/make_commence.in | 6 ++- configure.in.base | 10 +++- src/Sierpinsky/Makefile.in | 2 +- src/SierpinskyGUI/Makefile.in | 2 +- src/SierpinskyGUI/SierpinskyGUI.cxx | 22 +++++++-- src/SierpinskyGUI/SierpinskyGUI.h | 7 ++- src/SierpinskyGUI/SierpinskyGUI_RunDlg.cxx | 9 +++- src/SierpinskyGUI/SierpinskyGUI_RunDlg.h | 24 ++++++---- 9 files changed, 114 insertions(+), 21 deletions(-) create mode 100644 adm_local/unix/config_files/check_gd.m4 diff --git a/adm_local/unix/config_files/check_gd.m4 b/adm_local/unix/config_files/check_gd.m4 new file mode 100644 index 0000000..7115c74 --- /dev/null +++ b/adm_local/unix/config_files/check_gd.m4 @@ -0,0 +1,53 @@ +dnl Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +dnl +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; either +dnl version 2.1 of the License. +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +dnl +dnl See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +dnl +dnl +dnl + +AC_DEFUN([CHECK_GDLIB],[ +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_CPP])dnl + +AC_CHECKING(for gd library) + +gd_ok=no + +dnl check gd.h header +AC_CHECK_HEADER(gd.h, gd_ok=yes, gd_ok=no) + +if test "x$gd_ok" = "xyes"; then + dnl check gd library + AC_MSG_CHECKING(linking with libgd.so) + LIBS_old=$LIBS + LIBS="$LIBS -lgd" + AC_TRY_LINK([#include ], + [gdImagePtr image = gdImageCreate(10,10);], + gd_ok=yes, + gd_ok=no) + LIBS=$LIBS_old + AC_MSG_RESULT(done) +fi + +if test "x$gd_ok" = "xno"; then + AC_MSG_WARN(gd library is not installed!) +fi + +AC_MSG_RESULT(for gd: $gd_ok) + +])dnl diff --git a/adm_local/unix/make_commence.in b/adm_local/unix/make_commence.in index d5b6316..28dbe9e 100644 --- a/adm_local/unix/make_commence.in +++ b/adm_local/unix/make_commence.in @@ -276,5 +276,9 @@ ac_cxx_typename.m4 check_pthreads.m4 check_cas.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/%) +ACLOCAL_SRC1 = \ +check_Med.m4 check_Med2.m4 check_Randomizer.m4 \ +check_Visu.m4 check_gd.m4 + +$(top_srcdir)/aclocal.m4: $(ACLOCAL_SRC:%=@KERNEL_ROOT_DIR@/salome_adm/unix/config_files/%) $(ACLOCAL_SRC1:%=$(top_srcdir)/adm_local/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/configure.in.base b/configure.in.base index 23abbf1..e61a9bb 100644 --- a/configure.in.base +++ b/configure.in.base @@ -265,6 +265,14 @@ echo CHECK_HTML_GENERATORS +echo +echo --------------------------------------------- +echo Testing gd library +echo --------------------------------------------- +echo + +CHECK_GDLIB + echo echo --------------------------------------------- echo Testing Kernel @@ -305,7 +313,7 @@ echo echo Configure 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" +OpenGL_ok qt_ok msg2qm_ok vtk_ok hdf5_ok med2_ok omniORB_ok occ_ok doxygen_ok graphviz_ok gd_ok Kernel_ok Med_ok Visu_ok Randomizer_ok" for var in $variables do diff --git a/src/Sierpinsky/Makefile.in b/src/Sierpinsky/Makefile.in index c9c0894..bac9125 100644 --- a/src/Sierpinsky/Makefile.in +++ b/src/Sierpinsky/Makefile.in @@ -21,7 +21,7 @@ LIB = libSIERPINSKYEngine.la LIB_SRC = SIERPINSKY_Gen_i.cxx LIB_SERVER_IDL = Sierpinsky.idl MED.idl -LIB_CLIENT_IDL = SALOME_Component.idl SALOME_Exception.idl SALOMEDS.idl +LIB_CLIENT_IDL = SALOME_Component.idl SALOME_Exception.idl SALOMEDS.idl SALOME_GenericObj.idl SALOME_Comm.idl CPPFLAGS += -I${KERNEL_ROOT_DIR}/include/salome $(HDF5_INCLUDES) -I${MED_ROOT_DIR}/include/salome $(BOOST_CPPFLAGS) diff --git a/src/SierpinskyGUI/Makefile.in b/src/SierpinskyGUI/Makefile.in index 4f2b94a..ac2042f 100644 --- a/src/SierpinskyGUI/Makefile.in +++ b/src/SierpinskyGUI/Makefile.in @@ -20,7 +20,7 @@ EXPORT_HEADERS = \ PO_FILES = SIERPINSKY_msg_en.po SIERPINSKY_icons.po # Libraries targets -LIB = libSIERPINSKYGUI.la +LIB = libSIERPINSKY.la LIB_SRC = \ SierpinskyGUI.cxx \ diff --git a/src/SierpinskyGUI/SierpinskyGUI.cxx b/src/SierpinskyGUI/SierpinskyGUI.cxx index eb87268..f6176b8 100644 --- a/src/SierpinskyGUI/SierpinskyGUI.cxx +++ b/src/SierpinskyGUI/SierpinskyGUI.cxx @@ -9,12 +9,12 @@ #include #include +#include #include +#include #include #include -#include - /*! * Constructor */ @@ -78,6 +78,22 @@ QString SierpinskyGUI::engineIOR() const return QString( anIOR.in() ); } +/*! + * Required dockable windows + */ +void SierpinskyGUI::windows( QMap& wmap ) const +{ + wmap.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::DockLeft ); +} + +/*! + * Required viewers list + */ +void SierpinskyGUI::viewManagers( QStringList& vmlist ) const +{ + vmlist.append( SVTK_Viewer::Type() ); +} + /*! * Module's activation */ @@ -114,7 +130,7 @@ SierpinskyGUI::~SierpinskyGUI() void SierpinskyGUI::OnRun() { QWidget* aParent = getApp()->desktop(); - SierpinskyGUI_RunDlg* aDlg = new SierpinskyGUI_RunDlg( aParent ); + SierpinskyGUI_RunDlg* aDlg = new SierpinskyGUI_RunDlg( aParent, this ); aDlg->exec(); } diff --git a/src/SierpinskyGUI/SierpinskyGUI.h b/src/SierpinskyGUI/SierpinskyGUI.h index eba7f07..6ba7f9d 100644 --- a/src/SierpinskyGUI/SierpinskyGUI.h +++ b/src/SierpinskyGUI/SierpinskyGUI.h @@ -29,11 +29,14 @@ public: void initialize( CAM_Application* ); virtual QString engineIOR() const; + virtual void windows( QMap& ) const; + virtual void viewManagers( QStringList& ) const; + static SIERPINSKY_ORB::SIERPINSKY_ptr InitSIERPINSKYGen( SalomeApp_Application* ); public slots: - bool deactivateModule( SUIT_Study* ); - bool activateModule( SUIT_Study* ); + virtual bool deactivateModule( SUIT_Study* ); + virtual bool activateModule( SUIT_Study* ); protected slots: void OnRun(); diff --git a/src/SierpinskyGUI/SierpinskyGUI_RunDlg.cxx b/src/SierpinskyGUI/SierpinskyGUI_RunDlg.cxx index b47f1ef..98c2c40 100644 --- a/src/SierpinskyGUI/SierpinskyGUI_RunDlg.cxx +++ b/src/SierpinskyGUI/SierpinskyGUI_RunDlg.cxx @@ -6,6 +6,7 @@ /////////////////////////////////////////////////////////// #include "SierpinskyGUI_RunDlg.h" +#include "SierpinskyGUI.h" #include "SALOME_LifeCycleCORBA.hxx" #include "SalomeApp_Application.h" //#include "VisuGUI_Tools.h" @@ -154,10 +155,10 @@ private: /*! * Constructor */ -SierpinskyGUI_RunDlg::SierpinskyGUI_RunDlg( QWidget* parent ) +SierpinskyGUI_RunDlg::SierpinskyGUI_RunDlg( QWidget* parent, SierpinskyGUI* module ) : QDialog( parent, "SierpinskyGUI_RunDlg", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose ), - myThread( 0 ) + myThread( 0 ), myModule( module ) { setCaption( tr( "CAPTION" ) ); setSizeGripEnabled( true ); @@ -532,6 +533,9 @@ void SierpinskyGUI_RunDlg::nextStep( const int step ) int aJPEGSize = myJpegSize->value(); if ( !aJPEGFile.isEmpty() && aJPEGSize > 0 ) { bool res = getSierpinskyEngine()->ExportToJPEG( aJPEGFile.latin1(), aJPEGSize ); + if ( !res ) { + // error: can't create JPEG image + } } } // export to MED @@ -546,6 +550,7 @@ 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 ); + myModule->getApp()->updateObjectBrowser( true ); } } } diff --git a/src/SierpinskyGUI/SierpinskyGUI_RunDlg.h b/src/SierpinskyGUI/SierpinskyGUI_RunDlg.h index 5e3a70d..c21a994 100644 --- a/src/SierpinskyGUI/SierpinskyGUI_RunDlg.h +++ b/src/SierpinskyGUI/SierpinskyGUI_RunDlg.h @@ -18,6 +18,7 @@ class QGroupBox; class QtxDblSpinBox; class MyThread; class QProgressBar; +class SierpinskyGUI; class SierpinskyGUI_RunDlg : public QDialog { @@ -25,7 +26,7 @@ class SierpinskyGUI_RunDlg : public QDialog public: // Constructor - SierpinskyGUI_RunDlg( QWidget* ); + SierpinskyGUI_RunDlg( QWidget*, SierpinskyGUI* ); // Destructor ~SierpinskyGUI_RunDlg(); @@ -44,19 +45,22 @@ protected slots: void toggled(); // Toggle 'Base points' mode private: + // module + SierpinskyGUI* myModule; + // widgets QGroupBox* box1; - QtxDblSpinBox* myStartX; - QtxDblSpinBox* myStartY; + QtxDblSpinBox* myStartX; + QtxDblSpinBox* myStartY; QCheckBox* myStartRandom; QGroupBox* box2; - QtxDblSpinBox* myX1; - QtxDblSpinBox* myY1; - QtxDblSpinBox* myX2; - QtxDblSpinBox* myY2; - QtxDblSpinBox* myX3; - QtxDblSpinBox* myY3; + QtxDblSpinBox* myX1; + QtxDblSpinBox* myY1; + QtxDblSpinBox* myX2; + QtxDblSpinBox* myY2; + QtxDblSpinBox* myX3; + QtxDblSpinBox* myY3; QCheckBox* myBaseRandom; QCheckBox* myBaseDefault; @@ -70,7 +74,7 @@ private: QCheckBox* myMedCheck; QLineEdit* myMedFile; QPushButton* myMedBtn; - QtxDblSpinBox* myMedSize; + QtxDblSpinBox* myMedSize; QCheckBox* myVisuCheck; QPushButton* myStartBtn; -- 2.39.2