Salome HOME
PAL10427 V3_1_0a2
authorvsr <vsr@opencascade.com>
Tue, 8 Nov 2005 12:43:13 +0000 (12:43 +0000)
committervsr <vsr@opencascade.com>
Tue, 8 Nov 2005 12:43:13 +0000 (12:43 +0000)
adm_local/unix/config_files/check_gd.m4 [new file with mode: 0644]
adm_local/unix/make_commence.in
configure.in.base
src/Sierpinsky/Makefile.in
src/SierpinskyGUI/Makefile.in
src/SierpinskyGUI/SierpinskyGUI.cxx
src/SierpinskyGUI/SierpinskyGUI.h
src/SierpinskyGUI/SierpinskyGUI_RunDlg.cxx
src/SierpinskyGUI/SierpinskyGUI_RunDlg.h

diff --git a/adm_local/unix/config_files/check_gd.m4 b/adm_local/unix/config_files/check_gd.m4
new file mode 100644 (file)
index 0000000..7115c74
--- /dev/null
@@ -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 <gd.h>],
+              [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
index d5b63162d2096c945c8753e5070250725ef81130..28dbe9e240a9959772e529f0a70fc599acd51e6f 100644 (file)
@@ -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
index 23abbf1ce9159c67a4685fc0ffb5674d5b280cf7..e61a9bbbe7107e3ea26035439d22f45ee923ce1a 100644 (file)
@@ -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
index c9c0894638f9b87f48d6386cc61b7fe6313f2eeb..bac9125c632c598ace3f8a59744c7a3a3c67e546 100644 (file)
@@ -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)
 
index 4f2b94a0021e15f49703adece8685221fca9e4b4..ac2042f362414c13e3d3dc4b10852847a1eed964 100644 (file)
@@ -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 \
index eb872682ec92a23f080f131f51e7efef9a3d41bd..f6176b8d97a8ffafa6c87257c3dd476dd935fae2 100644 (file)
@@ -9,12 +9,12 @@
 
 #include <SUIT_MessageBox.h>
 #include <SUIT_ResourceMgr.h>
+#include <SUIT_Desktop.h>
 #include <SalomeApp_Application.h>
+#include <SVTK_ViewModel.h>
 #include <SALOME_LifeCycleCORBA.hxx>
 #include <SierpinskyGUI_RunDlg.h>
 
-#include <SUIT_Desktop.h>
-
 /*!
  * Constructor
  */
@@ -78,6 +78,22 @@ QString SierpinskyGUI::engineIOR() const
   return QString( anIOR.in() );
 }
 
+/*!
+ * Required dockable windows
+ */
+void SierpinskyGUI::windows( QMap<int, int>& 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();
 }
 
index eba7f078b7b84650044c2cde7a7e980131cfd8aa..6ba7f9d4c24a7311627d9f8073418deb651f6c45 100644 (file)
@@ -29,11 +29,14 @@ public:
   void    initialize( CAM_Application* );
   virtual QString     engineIOR() const;
 
+  virtual void        windows( QMap<int, int>& ) 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();
index b47f1ef689c689bcc2722195c749d930ea4b4094..98c2c40ead66b83ba9f2ddc9235be25c186d3e4d 100644 (file)
@@ -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 );
           }
         }
       }
index 5e3a70d0c14b761cf19e5fb20c2556342b779073..c21a9943a469f4a6df28f32a9ed17c7226b60227 100644 (file)
@@ -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;