--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+CMAKE_MINIMUM_REQUIRED(VERSION 2.4.7 FATAL_ERROR)
+
+IF(COMMAND cmake_policy)
+ cmake_policy(SET CMP0003 NEW)
+ENDIF(COMMAND cmake_policy)
+
+# Temporary definitions
+SET(DOXYGEN_IS_OK 0)
+IF(WINDOWS)
+ SET(CPPUNIT_IS_OK 0)
+ENDIF(WINDOWS)
+SET(GUI_ENABLE_CORBA ON)
+SET(ENABLE_VTKVIEWER ON)
+SET(ENABLE_SALOMEOBJECT ON)
+SET(ENABLE_OCCVIEWER ON)
+SET(ENABLE_GLVIEWER ON)
+SET(ENABLE_PLOT2DVIEWER ON)
+SET(ENABLE_PYCONSOLE ON)
+SET(ENABLE_SUPERVGRAPHVIEWER ON)
+SET(ENABLE_QXGRAPHVIEWER ON)
+
+ENABLE_TESTING()
+SET(VERSION "6.5.0")
+SET(VERSION_DEV "1")
+
+SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR})
+IF(KERNEL_ROOT_DIR)
+ STRING(REPLACE "\\" "/" KERNEL_ROOT_DIR ${KERNEL_ROOT_DIR})
+ INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindPLATFORM.cmake)
+ INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindPYTHON.cmake)
+ INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindOMNIORB.cmake)
+ INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindPTHREADS.cmake)
+ INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindMPI.cmake)
+ INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindHDF5.cmake)
+ INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindBOOST.cmake)
+ INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindLIBXML2.cmake)
+ INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindSWIG.cmake)
+ INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindCPPUNIT.cmake)
+ INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindDOXYGEN.cmake)
+ INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindLIBBATCH.cmake)
+ INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindKERNEL.cmake)
+ENDIF(KERNEL_ROOT_DIR)
+
+INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindCAS.cmake)
+INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindQT4.cmake)
+INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindOPENGL.cmake)
+INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindVTK.cmake)
+INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindQWT.cmake)
+INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindSIPPYQT.cmake)
+
+EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import sys; t=sys.argv[-1].split(\".\") ; t[:]=(int(elt) for elt in t) ; sys.stdout.write(\"0x%02x%02x%02x\"%tuple(t))" ${VERSION}
+ OUTPUT_VARIABLE XVERSION)
+
+SET(GUI_salomebin_BINS bin/salome)
+
+SET(GUI_salomelib_LIBS lib/salome)
+SET(GUI_paraviewlib_LIBS lib/paraview)
+
+SET(GUI_salomeinclude_HEADERS include/salome)
+
+SET(GUI_salomeres_DATA share/salome/resources/gui)
+
+SET(GUI_salomeres_SCRIPTS share/salome/resources/gui)
+
+SET(GUI_salomepluginsdir share/salome/plugins/gui)
+
+SET(GUI_salomescript_SCRIPTS bin/salome)
+
+SET(GUI_salomescript_DATA bin/salome)
+
+SET(GUI_salomescript_PYTHON bin/salome)
+SET(KERNEL_salomescript_PYTHON ${GUI_salomescript_PYTHON})
+
+SET(GUI_appliskel_SCRIPTS bin/salome/appliskel)
+
+SET(GUI_appliskel_PYTHON bin/salome/appliskel)
+
+SET(GUI_pythondir lib/python${PYTHON_VERSION}/site-packages)
+
+SET(GUI_salomepythondir ${GUI_pythondir}/salome)
+SET(KERNEL_salomepythondir ${GUI_salomepythondir})
+
+SET(GUI_sharedpkgpython_PYTHON ${GUI_salomepythondir}/shared_modules)
+
+SET(GUI_admlocalcmake adm_local/cmake_files)
+
+SET(IDLDIR)
+IF(GUI_ENABLE_CORBA)
+ SET(IDLDIR idl)
+ENDIF(GUI_ENABLE_CORBA)
+
+SET(SUBDIRS
+ ${IDLDIR}
+ adm_local
+ resources
+ src
+ doc
+ bin
+ tools
+)
+FOREACH(dir ${SUBDIRS})
+ ADD_SUBDIRECTORY(${dir})
+ENDFOREACH(dir ${SUBDIRS})
+
+SET(input ${CMAKE_CURRENT_SOURCE_DIR}/GUI_version.h.in)
+SET(output ${CMAKE_CURRENT_BINARY_DIR}/GUI_version.h)
+MESSAGE(STATUS "Creation of ${output}")
+CONFIGURE_FILE(${input} ${output} @ONLY)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/GUI_version.h DESTINATION ${GUI_salomeinclude_HEADERS})
--- /dev/null
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+ADD_SUBDIRECTORY(unix)
+ADD_SUBDIRECTORY(cmake_files)
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+# ===============================================================
+# Files to be installed
+# ===============================================================
+
+# These files are data, module or lib files
+SET(DATA
+ FindCAS.cmake
+ FindOPENGL.cmake
+ FindQT4.cmake
+ UseQT4EXT.cmake
+ FindQWT.cmake
+ FindSIPPYQT.cmake
+ FindVTK.cmake
+ FindGUI.cmake
+)
+INSTALL(FILES ${DATA} DESTINATION ${GUI_admlocalcmake})
\ No newline at end of file
FIND_LIBRARY(VTKViewer VTKViewer ${GUI_ROOT_DIR}/lib/salome)
FIND_LIBRARY(vtkEDFOverloads vtkEDFOverloads ${GUI_ROOT_DIR}/lib/paraview)
FIND_LIBRARY(vtkTools vtkTools ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(SalomeGuiHelpers SalomeGuiHelpers ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(SalomeTreeData SalomeTreeData ${GUI_ROOT_DIR}/lib/salome)
INCLUDE(FindQt4)
INCLUDE(UseQt4)
+SET(QT_INCLUDE_DIRS ${QT_INCLUDES})
SET(DIRS)
FOREACH(D ${QT_INCLUDES})
SET(DIRS ${DIRS} -I${D})
ENDFOREACH(D ${QT_INCLUDES})
-SET(QT_INCLUDES ${DIRS})
-SET(QT_INCLUDES ${QT_INCLUDES} -DQT_THREAD_SUPPORT)
+SET(QT_INCLUDES ${DIRS}) # to be removed
+SET(QT_INCLUDES ${QT_INCLUDES} -DQT_THREAD_SUPPORT) # to be removed
+SET(QT_DEFINITIONS -DQT_THREAD_SUPPORT)
SET(QT_MT_LIBS ${QT_LIBRARIES} ${QT_QTXML_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${QT_QTWEBKIT_LIBRARY})
SET(QT_LIBS ${QT_MT_LIBS})
SET(qt4_ldflags ${QT_MT_LIBS})
+SET(QT_LIBS ${QT_MT_LIBS})
FIND_PROGRAM(QT_LRELEASE_EXECUTABLE lrelease)
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-SET(QWTHOME $ENV{QWTHOME})
+FILE(TO_CMAKE_PATH $ENV{QWTHOME} QWTHOME)
IF(NOT QWTHOME)
SET(QWTHOME /usr)
ENDIF(NOT QWTHOME)
FIND_PATH(QWT_INCLUDE_DIR qwt_plot.h PATHS ${QWTHOME}/include ${QWTHOME}/include/qwt)
-SET(QWT_INCLUDES -I${QWT_INCLUDE_DIR})
+SET(QWT_INCLUDES -I${QWT_INCLUDE_DIR}) # to remove
+SET(QWT_INCLUDE_DIRS ${QWT_INCLUDE_DIR})
IF(WINDOWS)
-SET(QWT_INCLUDES ${QWT_INCLUDES} -DQWT_DLL)
+SET(QWT_INCLUDES ${QWT_INCLUDES} -DQWT_DLL) # to remove
+SET(QWT_DEFINITIONS "-DQWT_DLL")
ENDIF(WINDOWS)
IF(WINDOWS)
FIND_LIBRARY(QWT_LIBS qwt5 ${QWTHOME}/lib)
ENDIF(CMAKE_BUILD_TYPE STREQUAL Debug)
ELSE(WINDOWS)
-FIND_LIBRARY(QWT_LIBS qwt PATHS ${QWTHOME}/lib ${QWTHOME}/lib64)
+FIND_LIBRARY(QWT_LIBS qwt HINTS ${QWTHOME} PATH_SUFFIXES lib lib64)
ENDIF(WINDOWS)
GET_FILENAME_COMPONENT(SIP_ROOT ${SIP_ROOT} PATH)
ENDIF(SIP_ROOT)
-SET(SIP_INCLUDES -I${SIP_ROOT}/include/python${PYTHON_VERSION})
+SET(SIP_INCLUDES -I${SIP_ROOT}/include/python${PYTHON_VERSION}) # to be removed
+SET(SIP_INCLUDE_DIRS ${SIP_ROOT}/include/python${PYTHON_VERSION})
IF(WINDOWS)
- SET(SIP_INCLUDES ${SIP_INCLUDES} -I${SIP_ROOT}/include)
+ SET(SIP_INCLUDES ${SIP_INCLUDES} -I${SIP_ROOT}/include) # to be removed
+ SET(SIP_INCLUDE_DIRS ${SIP_INCLUDE_DIRS} ${SIP_ROOT}/include)
ENDIF(WINDOWS)
IF(WINDOWS)
INSTALL(CODE "SET(INSTALL_TS_DIR ${WHERETOINSTALL})")
SET(MYSOURCES)
FOREACH(input ${MYTSFILES})
- STRING(REGEX REPLACE ".ts" "" base ${input})
+ GET_FILENAME_COMPONENT(input2 ${input} NAME)
+ STRING(REGEX REPLACE ".ts" "" base ${input2})
SET(output "${base}.qm")
INSTALL(CODE "QT4_COMPILE_TS_ON_INSTALL( \"${QT_LRELEASE_EXECUTABLE}\" \"${CMAKE_CURRENT_SOURCE_DIR}/${input}\" \"${CMAKE_INSTALL_PREFIX}/\${INSTALL_TS_DIR}\" ${output})")
ENDFOREACH(input ${MYIDLFILES})
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE\r
+#\r
+# This library is free software; you can redistribute it and/or\r
+# modify it under the terms of the GNU Lesser General Public\r
+# License as published by the Free Software Foundation; either\r
+# version 2.1 of the License.\r
+#\r
+# This library is distributed in the hope that it will be useful,\r
+# but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+# Lesser General Public License for more details.\r
+#\r
+# You should have received a copy of the GNU Lesser General Public\r
+# License along with this library; if not, write to the Free Software\r
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+#\r
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com\r
+#\r
+\r
+ADD_SUBDIRECTORY(config_files)\r
--- /dev/null
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007 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
+#
+
+SET(dist_admlocalm4_DATA
+ check_disable_Corba.m4
+ check_GLViewer.m4
+ check_GUI.m4
+ check_msg2qm.m4
+ check_OCCViewer.m4
+ check_opengl.m4
+ check_Plot2dViewer.m4
+ check_PyConsole.m4
+ check_pyqt.m4
+ check_qt.m4
+ check_qwt.m4
+ check_SalomeObject.m4
+ check_sip.m4
+ check_SupervGraphViewer.m4
+ check_VTKViewer.m4
+ check_QxGraphViewer.m4
+ check_TestRecorder.m4
+ check_salome_version.m4
+)
+
+FOREACH(f ${dist_admlocalm4_DATA})
+ SET(DEST adm_local/unix/config_files)
+ INSTALL(FILES ${f} DESTINATION ${DEST})
+ENDFOREACH(f ${dist_admlocalm4_DATA})
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/SalomeMacros.cmake)
+
+CONFIGURE_FILE(VERSION.in VERSION @ONLY)
+
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/VERSION DESTINATION ${GUI_salomebin_BINS})
+
+# ===============================================================
+# Files to be installed
+# ===============================================================
+
+SET(SCRIPTS runLightSalome.csh runLightSalome.sh gui_setenv.py)
+SALOME_INSTALL_SCRIPTS("${SCRIPTS}" ${GUI_salomescript_SCRIPTS})
--- /dev/null
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+ADD_SUBDIRECTORY(salome)
--- /dev/null
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007 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
+#
+
+SET(SUBDIRS
+ tui
+ gui
+)
+FOREACH(dir ${SUBDIRS})
+ ADD_SUBDIRECTORY(${dir})
+ENDFOREACH(dir ${SUBDIRS})
+
--- /dev/null
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+SET(top_builddir
+ ${CMAKE_BINARY_DIR}
+)
+SET(top_srcdir
+ ${CMAKE_SOURCE_DIR}
+)
+SET(srcdir
+ ${CMAKE_CURRENT_SOURCE_DIR}
+)
+SET(builddir
+ ${CMAKE_CURRENT_BINARY_DIR}
+)
+SET(datadir
+ ${CMAKE_INSTALL_PREFIX}/share
+)
+SET(docdir
+ ${datadir}/doc/salome
+)
+
+
+SET(input ${CMAKE_CURRENT_SOURCE_DIR}/doxyfile.in)
+SET(output ${CMAKE_CURRENT_BINARY_DIR}/doxyfile)
+MESSAGE(STATUS "Creation of ${output}")
+CONFIGURE_FILE(${input} ${output})
+
+SET(input ${CMAKE_CURRENT_SOURCE_DIR}/static/header.html.in)
+SET(output ${CMAKE_CURRENT_BINARY_DIR}/static/header.html)
+MESSAGE(STATUS "Creation of ${output}")
+CONFIGURE_FILE(${input} ${output})
+
+ADD_CUSTOM_TARGET(usr_docs ${DOXYGEN_EXECUTABLE}
+ COMMAND ${PYTHON_EXECUTABLE} -c "import shutil, sys; shutil.rmtree(r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/gui/GUI''', True); shutil.copytree(r'''${CMAKE_CURRENT_BINARY_DIR}/GUI''', r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/gui/GUI'''); shutil.copy(r'''${CMAKE_CURRENT_SOURCE_DIR}/images/head.png''', r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/gui/GUI''')"
+ VERBATIM
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+)
From the point of view of the \subpage salome_architecture_page "Architecture",
Salome is composed of several modules.
-To run salome (with different options) refer to \subpage running_salome_page page.
This part of documentation on Salome also covers
\subpage introduction_to_gui_page "general Salome functionalities",
common for all modules, such as study management, Salome viewers,
preferences, etc.
+
And finally, there is an additional chapter, which provides a short
-guide about the \subpage tui_page "usage of Python module salome.py" to access main SALOME
+guide about the \subpage tui_page "usage of SALOME GUI Python interface" to access SALOME GUI
functionalities from the Python code.
-
*/
+++ /dev/null
-/*!
-
-\page running_salome_page Running SALOME
-
-<em>To launch SALOME:</em>
-<ol>
-<li>Install the SALOME package into a definite directory (ex. \b 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.</li>
-<li>The installation shell script will create a special file:
-<b>salome.csh</b> (CShell file) in your SALOME/KERNEL 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: <br><br>
-<tt>source salome.csh</tt>
-
-<b>Tip:</b> During the installation procedure you have a possibility to set your profile automatically.</li>
-
-<li> Launch SALOME platform, using the following Python script located
-in the <b>SALOME/KERNEL/bin/salome</b> directory:<br><br>
-<ul>
-<li>\b runSalome.py [command line options]
-</ul>
-</li>
-</ol>
-
-\anchor batch_mode_run
-
-<table>
-<tr>
-<td><h2>Options</h2></td>
-<td><h2>Description</h2></td>
-</tr>
-<tr>
-<td>--\b help or -\b h</td>
-<td>print this help</td>
-</tr>
-<tr>
-<td>--\b gui or -\b g</td>
-<td>launch with GUI</td>
-</tr>
-<tr>
-<td> --\b terminal or -\b t</td>
-<td>launch without GUI in batch mode</td>
-</tr>
-<tr>
-<td>--\b logger or -\b l</td>
-<td>redirects log messages in the file <em>logger.log</em></td>
-</tr>
-<tr>
-<td>--\b file=<b>\<FILE\></b> or -\b f=<b>\<FILE\></b></td>
-<td>redirects log messages in a custom file</td>
-</tr>
-<tr>
-<td>--\b xterm or -\b x</td>
-<td>the servers open an xterm window and log messages are displayed in this window</td>
-</tr>
-<tr>
-<td>--\b modules=\b module1,\b module2,... or -\b m=\b module1,\b module2,...</td>
-<td>list of SALOME modules which will be loaded into the module catalogue</td>
-</tr>
-<tr>
-<td>--\b embedded=<b>registry,study,moduleCatalog,cppContainer</b>,
-or -\b e=<b>registry,study,moduleCatalog,cppContainer</b></td>
-<td>embedded CORBA servers (default: registry,study,moduleCatalog,cppContainer)
-note that logger,pyContainer,supervContainer can't be embedded</td>
-</tr>
-<tr>
-<td>--\b standalone=<b>registry,study,moduleCatalog,cppContainer,pyContainer,supervContainer</b>, or
--\b s=<b>registry,study,moduleCatalog,cppContainer,pyContainer,supervContainer</b></td>
-<td>standalone CORBA servers (default: pyContainer,supervContainer)</td>
-</tr>
-<tr>
-<td>--\b containers=<b>cpp,python,superv</b>
-or -\b c=<b>cpp,python,superv</b></td>
-<td>launch of cpp, python and supervision containers</td>
-</tr>
-<tr>
-<td>--\b portkill or -\b p</td>
-<td>kill SALOME launched with the current port</td>
-</tr>
-<tr>
-<td>--\b killall or -\b k</td>
-<td>kill SALOME</td>
-</tr>
-<tr>
-<td>--<b>interp</b>=<b>n</b> or -<b>i</b>=<b>n</b></td>
-<td>number of additional xterm to open, with session environment</td>
-</tr>
-<tr>
-<td>-\b z</td>
-<td>display splash screen</td>
-</tr>
-<tr>
-<td>-\b r</td>
-<td>disable centralized exception handling mechanism</td>
-</tr>
-</table>
-
-<b>Tip:</b> If the \b runSalome.py script is launched without prompting
-any options, they will be taken by default from the file <b>SalomeApp.xml
-(SALOME/GUI/share/salome/resources/SalomeApp.xml)</b>. If you are
-constantly launching SALOME with some specific options which are
-different from the defaults, 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.
-
-*/
\ No newline at end of file
Additional information about CORBA technology
is available at http://www.omg.org
-\note In \b SALOME there is a possibility to run
-definite components in the so-called \ref batch_mode_run "batch mode" without GUI provided
-by GUI 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
/*!
-\page tui_page Using salome.py module
+\page tui_page Using SALOME GUI python interface
-The Python module salome.py provides a functionality to access main
-SALOME features from the Python console (either embedded in GUI
-desktop or external one).
-To use salome.py module, import it into the Python interpreter and
-initialize it by calling \c salome_init() function:
-
-\code
-import salome
-salome.salome_init()
-\endcode
-
-The salome.py Python module provides a set of variables and functions
-allowing access to different elements of the current SALOME
-session (this Python interpreter is connected to).
-This page gives a short description of most useful variables and
-functions.
-
-\li \b orb Reference to the CORBA::ORB instance
-
-This variable can be used to initialize different CORBA-related
-elements of the SALOME session (for example, naming service, etc).
-For example, to get an access to the SALOME naming service, you can
-use the following commands:
-\code
-import SALOME_NamingServicePy
-NS = SALOME_NamingServicePy.SALOME_NamingServicePy_i(salome.orb)
-\endcode
-
-The \b orb variable is also useful when it is necessary to convert
-CORBA reference object to its string representation (IOR) and vice
-versa:
-\code
-studyIOR = salome.orb.object_to_string(salome.myStudy)
-study = salome.orb.string_to_object(studyIOR)
-is_same = salome.myStudy._is_equivalent(study) # is_same = True
-\endcode
-
-\li \b naming_service SALOME naming service instance
-
-This variable can be used to register/find objects created in a
-distributed environment. For example, to get access to the SALOME
-Module Catalog server, use \c Resolve() method:
-\code
-import SALOME_ModuleCatalog
-mc = salome.naming_service.Resolve('/Kernel/ModulCatalog')
-\endcode
-
-Similarly, method \c Register() can be used to register objects
-in the naming service:
-\code
-salome.naming_service.Register(myObject,'/My/Object/Path')
-o = salome.naming_service.Resolve('/My/Object/Path')
-is_same = myObject._is_equivalent(o) # is_same = True
-\endcode
-
-\li \b lcc Life Cycle CORBA class instance
-
-This object can be used to get access to CORBA engine part of some
-SALOME module, available in the current SALOME session. The following
-code returns a reference to the Geometry module engine, loading it if
-necessary:
-\code
-import GEOM
-geom = salome.lcc.FindOrLoadComponent('FactoryServer', 'GEOM')
-\endcode
-\b Note, that in the above example, \e "FactoryServer" is a name of the
-SALOME container, where Geometry module engine should be loaded.
-
-\li \b myStudyManager Reference to the study manager
-
-SALOMEDS Study manager is used to manipulate with the studies: create,
-open, save, close. It also can be used to find the study by its
-numerical ID or name. The code below demonstrates main
-functionalities of a study manager:
-\code
-# create new study with the name "MyStudy"
-new_study = salome.myStudyManager.NewStudy("MyStudy")
-
-# open study from file /home/user/MyStudy.hdf
-study = salome.myStudyManager.OpenStudy("/home/user/MyStudy.hdf")
-
-# save study
-salome.myStudyManager.Save(study, False) # not using multifile save mode
-
-# save study in ASCII format
-salome.myStudyManager.SaveASCII(study, True) # using multifile save mode
-
-# save study with the new file path
-salome.myStudyManager.SaveAs("/home/user/MyStudy.hdf", study, False)
-
-# save study with the new file path in ASCII format
-salome.myStudyManager.SaveAsASCII("/home/user/MyStudy.hdf", study, False)
-
-# close study
-salome.myStudyManager.Close(study)
-
-# get list of all opened studies
-studies = salome.myStudyManager.GetOpenStudies()
-
-# find study by its numerical ID (integer value starting from 1)
-study = salome.myStudyManager.GetStudyByID(studyID)
-
-# find study by its name
-study = salome.myStudyManager.GetStudyByName("/home/user/MyStudy.hdf")
-
-# ...
-\endcode
-
-\li \b myStudy Reference to the current (active) study
-
-This variable can be used to manipulate with the date of the study:
-create data tree, assign attributes of different types to the objects
-in a data tree, create references between objects, etc.
-
-\b Note, that the term "active" or "current" study does not make much
-sense outise the GUI Python console. When working in GUI, user always
-deals with one only top-level study, which desktop is currently on the
-top if the windows stack. This is what is called \e "active study".
-In TUI mode (without GUI or outside GUI), user has to manipulate with
-studies manually; no any special control for the life cycle of the
-study is done. In TUI mode, \c salome.muStudy variable is an instance
-of the first study created when you call salome_init() function.
-
-The following code demonstrates some examples of \c salome.myStudy
-variable usage. For more details please refer to the SALOMEDS.idl file
-documentation.
-
-\code
-# get study name
-studyName = salome.myStudy._get_Name()
-
-# get study numerical ID
-studyID = salome.myStudy._get_StudyId()
-
-# find SALOMEDS component by its type
-scomponent = FindComponent("MyComponent")
-
-# find SALOMEDS component by its entry ID
-scomponent = FindComponentID("0:1:1") # "0:1:1" is a component ID
-
-# find SALOMEDS object by its name (first found object is returned)
-sobject = salome.myStudy.FindObject("MyObject")
-
-# find SALOMEDS object by its entry ID
-sobject = salome.myStudy.FindObjectID() # "0:1:1:1" is an object ID
-
-# find SALOMEDS object by its IOR attribute
-sobject = salome.myStudy.FindObjectIOR(IOR)
-
-# find SALOMEDS object by its path in the data tree
-sobject = salome.myStudy.FindObjectByPath("/MyComponent/MyObject/MySubObject")
-
-# get SALOMEDS object's path in a study data tree
-sobject_path = salome.myStudy.GetObjectPath(sobject)
-
-# get study properties
-prop = salome.myStudy.GetProperties()
-prop.GetCreationDate() # get creation date
-prop.IsModified() # check if study has been modified (and not yet saved)
-prop.SetLocked(True) # lock the study (prohibit modifications)
-prop.IsLocked() # check if study is locked
-
-# create objects with study builder
-builder = salome.myStudy.NewBuilder() # create builder
-comp = builder.NewComponent("MyComponent") # create a component of the "MyComponent" type
-attrName = builder.FindOrCreateAttribute(comp, "AttributeName")
-attrName.SetValue("MyComponent") # set name to the component
-object = builder.NewObject(comp) # create new object, a child of the component
-attrName = builder.FindOrCreateAttribute(object, "AttributeName")
-attrName.SetValue("MyObject") # set name to the object
-attrInt = builder.FindOrCreateAttribute(object, "AttributeInteger")
-attrInt.SetValue(123) # assign integer attribute to the object
-attrIOR = builder.FindOrCreateAttribute(object, "AttributeIOR")
-attrIOR.SetValue(IOR) # assign IOR attribute to the object (to point to some CORBA object)
-
-# iterate through objects of the data tree with child iterator
-iter = salome.myStudy.NewChildIterator(comp) # initialize from the component
-iter.InitEx(True) # init recursive mode
-while iter.More():
- c = iter.Value()
- print c.GetID()
- iter.Next()
- pass
-
-# ...
-\endcode
-
-\li \b myStudyId Identifier of the current (active) study
-
-This variable contains the numerical identifier of the current
-(active) study. It is an equivalent of \c
-salome.myStudy._get_StudyId() code.
-
-\li \b myStudyName Name of the current (active) study
-
-This variable contains the name of the current (active) study. It is
-an equivalent of \c salome.myStudy._get_Name() code.
-
-\li \b DumpStudy() Print study contents
-
-This function prints the study data object tree to the terminal
-window. The output for each object includes its entry ID, name, IOR
-(if there is one) and referenced object ID (for references). I.e.
-this is the same data the user can see in the Object Browser columns.
-\code
-salome.DumpStudy(salome.myStudy)
-\endcode
-
-\li \b IDToSObject() Get SALOMEDS object by its entry ID.
-
-This function checks if the SObject with the specified entry ID exists
-in the current study and returns it. Otherwise \c None is returned.
-\code
-sobject = salome.IDToSObject("0:1:1:1") # "0:1:1:1" is an object ID
-\endcode
-Actually this function is just a shortcut to the following code:
-\code
-sobject = salome.myStudy.FindObjectID("0:1:1:1")
-\endcode
-
-\li \b IDToObject() Get CORBA object by its entry ID.
-
-This function checks if the SObject with the specified entry ID exists
-in the current study, then retrieves IOR attribute from it and,
-finally, if IOR is not empty, returns CORBA object corresponding to
-the found SObject:
-\code
-object = salome.IDToObject("0:1:1:1") # "0:1:1:1" is an object ID
-\endcode
-Actually this function is just a shortcut to the following code:
-\code
-sobject = salome.myStudy.FindObjectID("0:1:1:1")
-if sobject:
- object = sobject.GetObject()
-else:
- object = None
-\endcode
-
-\li \b ObjectToSObject() Get SALOMEDS object corresponding to the
-CORBA object.
-
-This function finds an object in the current study which corresponds
-to the specified CORBA object (i.e. it has IOR attribute, pointing to
-the CORBA object). If there is no corresponding SALOMEDS object in the
-study, \c None is returned:
-\code
-sobject = salome.ObjectToSObject(object)
-\endcode
-Actually this function is just a shortcut to the following code:
-\code
-ior = salome.orb.object_to_string(object)
-sobject = salome.myStudy.FindObjectIOR(ior)
-\endcode
-
-\li \b ObjectToID() Get SALOMEDS object entry ID corresponding to the
-CORBA object.
-
-This function finds an object in the current study which corresponds
-to the specified CORBA object (i.e. it has IOR attribute, pointing to
-the CORBA object). If the object is found, its entry ID is returned,
-otherwise empty string is returned:
-\code
-entry = salome.ObjectToID(object)
-\endcode
-Actually this function is just a shortcut to the following code:
-\code
-ior = salome.orb.object_to_string(object)
-sobject = salome.myStudy.FindObjectIOR(ior)
-if sobject:
- entry = sobject.GetID()
-else:
- entry = ""
-\endcode
-
-\li \b createNewStudy() Create new study
-
-This function can be used to create new SALOME study. Returns an ID of
-the created study.
-\code
-studyId = salome.createNewStudy()
-study = salome.myStudyManager.GetStudyByID(s)
-\endcode
-
-\li \b generateName() Generate unique name
-
-This function adds random numerical suffix to the passed string
-parameter ("Study" by default) and returns the resulting string:
-\code
-name_1 = salome.generateName() # name_1 is something like "Study682"
-name_1 = salome.generateName("Obj") # name_1 is something like "Obj32"
-\endcode
-
-\li \b sg SWIG interface to the SALOME GUI
-
-This variable provides an access to some GUI functions.
+The extended salome.py Python module provides a \b sg variable, this variable provides an access to some GUI functions.
\b Note, that this variable is not available if you use salome.py
Python module outside the GUI desktop, i.e. not in the embedded Python
--- /dev/null
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+SET(top_builddir
+ ${CMAKE_BINARY_DIR}
+)
+SET(top_srcdir
+ ${CMAKE_SOURCE_DIR}
+)
+SET(srcdir
+ ${CMAKE_CURRENT_SOURCE_DIR}
+)
+SET(builddir
+ ${CMAKE_CURRENT_BINARY_DIR}
+)
+SET(datadir
+ ${CMAKE_INSTALL_PREFIX}/share
+)
+SET(docdir
+${datadir}/doc/salome
+)
+
+SET(input ${CMAKE_CURRENT_SOURCE_DIR}/doxyfile.in)
+SET(output ${CMAKE_CURRENT_BINARY_DIR}/doxyfile)
+MESSAGE(STATUS "Creation of ${output}")
+CONFIGURE_FILE(${input} ${output})
+
+SET(input ${CMAKE_CURRENT_SOURCE_DIR}/static/header.html.in)
+SET(output ${CMAKE_CURRENT_BINARY_DIR}/static/header.html)
+MESSAGE(STATUS "Creation of ${output}")
+CONFIGURE_FILE(${input} ${output})
+
+ADD_CUSTOM_TARGET(dev_docs ${DOXYGEN_EXECUTABLE}
+ COMMAND ${PYTHON_EXECUTABLE} -c "import shutil, sys; shutil.rmtree(r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/tui/GUI''', True); shutil.copytree(r'''${CMAKE_CURRENT_BINARY_DIR}/GUI''', r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/tui/GUI'''); shutil.copy(r'''${CMAKE_CURRENT_SOURCE_DIR}/images/head.png''', r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/tui/GUI''')"
+ VERBATIM
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+)
+
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/UseOMNIORB.cmake)
+
+INCLUDE_DIRECTORIES(
+ ${OMNIORB_INCLUDE_DIRS}
+ ${KERNEL_ROOT_DIR}/include/salome
+ ${CMAKE_CURRENT_BINARY_DIR}
+)
+
+SET(SalomeIDLGUI_IDLSOURCES
+ SalomeApp_Engine.idl
+)
+
+SET(IDL_INCLUDE_DIRS
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${KERNEL_ROOT_DIR}/idl/salome
+)
+
+SET(TYPE SHARED)
+IF(WINDOWS)
+ SET(TYPE STATIC)
+ENDIF(WINDOWS)
+
+OMNIORB_ADD_MODULE(SalomeIDLGUI "${SalomeIDLGUI_IDLSOURCES}" "${IDL_INCLUDE_DIRS}" ${TYPE})
+TARGET_LINK_LIBRARIES(SalomeIDLGUI ${CORBA_LIBS})
+SET_TARGET_PROPERTIES(SalomeIDLGUI PROPERTIES COMPILE_FLAGS "${OMNIORB_DEFINITIONS}")
+
+INSTALL(TARGETS SalomeIDLGUI DESTINATION ${GUI_salomelib_LIBS})
--- /dev/null
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+# add resource files here ...
+#
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/UseQT4EXT.cmake)
+
+INCLUDE_DIRECTORIES(
+ ${PTHREAD_INCLUDE_DIRS}
+ ${CAS_INCLUDE_DIRS}
+ ${KERNEL_ROOT_DIR}/include/salome
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Qtx
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SUIT
+ ${CMAKE_CURRENT_SOURCE_DIR}/../STD
+)
+
+SET(COMMON_LIBS
+ qtx
+ suit
+ std
+ ${QT_MT_LIBS}
+ ${CAS_OCAF}
+ ${CAS_OCAFVIS}
+)
+
+SET(GUI_HEADERS CAF_Application.h CAF_Operation.h CAF_Study.h)
+QT4_WRAP_CPP(GUI_HEADERS ${GUI_HEADERS})
+SET(caf_SOURCES
+ CAF_Application.cxx
+ CAF_Operation.cxx
+ CAF_Study.cxx
+ CAF_Tools.cxx
+)
+
+SET(GUITS_SOURCES
+ resources/CAF_msg_en.ts
+ resources/CAF_msg_fr.ts
+)
+
+ADD_LIBRARY(caf SHARED ${caf_SOURCES} ${GUI_HEADERS})
+SET_TARGET_PROPERTIES(caf PROPERTIES COMPILE_FLAGS "${CAS_DEFINITIONS} ${QT_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+TARGET_LINK_LIBRARIES(caf ${COMMON_LIBS})
+INSTALL(TARGETS caf DESTINATION ${GUI_salomelib_LIBS})
+
+FILE(GLOB COMMON_HEADERS_H "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
+INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${GUI_salomeinclude_HEADERS})
+QT4_INSTALL_TS_RESOURCES("${GUITS_SOURCES}" "${GUI_salomeres_DATA}")
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/UseQT4EXT.cmake)
+
+INCLUDE_DIRECTORIES(
+ ${QT_INCLUDE_DIRS}
+ ${KERNEL_ROOT_DIR}/include/salome
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Qtx
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SUIT
+ ${CMAKE_CURRENT_SOURCE_DIR}/../STD
+)
+
+SET(COMMON_LIBS
+ qtx
+ suit
+ std
+ ${QT_MT_LIBS}
+)
+
+SET(CAM_HEADERS CAM_Application.h CAM_Module.h CAM_Study.h CAM_DataModel.h)
+QT4_WRAP_CPP(CAM_HEADERS_MOC ${CAM_HEADERS})
+
+SET(CAM_SOURCES
+ CAM_Application.cxx
+ CAM_DataModel.cxx
+ CAM_DataObject.cxx
+ CAM_Module.cxx
+ CAM_Study.cxx
+)
+
+SET(CAMTS_SOURCES
+ resources/CAM_msg_en.ts
+ resources/CAM_msg_fr.ts
+)
+
+ADD_LIBRARY(CAM SHARED ${CAM_SOURCES} ${CAM_HEADERS_MOC})
+SET_TARGET_PROPERTIES(CAM PROPERTIES COMPILE_FLAGS "${QT_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+TARGET_LINK_LIBRARIES(CAM ${COMMON_LIBS})
+INSTALL(TARGETS CAM DESTINATION ${GUI_salomelib_LIBS})
+
+FILE(GLOB COMMON_HEADERS_H "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
+INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${GUI_salomeinclude_HEADERS})
+QT4_INSTALL_TS_RESOURCES("${CAMTS_SOURCES}" "${GUI_salomeres_DATA}")
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE_DIRECTORIES(
+ ${PTHREAD_INCLUDE_DIRS}
+ ${CAS_INCLUDE_DIRS}
+)
+
+SET(CASCatch_SOURCES
+ CASCatch_CatchSignals.cxx
+ CASCatch_ErrorHandler.cxx
+ CASCatch_Failure.cxx
+)
+
+ADD_LIBRARY(CASCatch SHARED ${CASCatch_SOURCES})
+SET_TARGET_PROPERTIES(CASCatch PROPERTIES COMPILE_FLAGS "${CAS_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+TARGET_LINK_LIBRARIES(CASCatch ${CAS_KERNEL})
+INSTALL(TARGETS CASCatch DESTINATION ${GUI_salomelib_LIBS})
+
+FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
+INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${GUI_salomeinclude_HEADERS})
+
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+##
+# Common packages
+##
+SET(SUBDIRS_COMMON
+ CASCatch
+ Qtx
+ Style
+ DDS
+ QDS
+ ObjBrowser
+ SUIT
+ SUITApp
+ STD
+ CAF
+ CAM
+ LogWindow
+ Prs
+ Event
+ OpenGLUtils
+ GUI_PY
+)
+
+##
+# SALOME object
+##
+IF(ENABLE_SALOMEOBJECT)
+ SET(SUBDIRS_OBJECT OBJECT)
+ENDIF(ENABLE_SALOMEOBJECT)
+
+##
+# GL viewer
+##
+IF(ENABLE_GLVIEWER)
+ SET(SUBDIRS_GLVIEWER GLViewer)
+ENDIF(ENABLE_GLVIEWER)
+
+##
+# VTK viewer
+##
+IF(ENABLE_VTKVIEWER)
+ SET(SUBDIRS_VTKVIEWER VTKViewer)
+
+ IF(ENABLE_SALOMEOBJECT)
+ SET(SUBDIRS_VTKVIEWER ${SUBDIRS_VTKVIEWER} SVTK)
+ SET(SUBDIRS_VIEWERTOOLSViewerTools)
+ ENDIF(ENABLE_SALOMEOBJECT)
+ENDIF(ENABLE_VTKVIEWER)
+
+##
+# OCC viewer
+##
+IF(ENABLE_OCCVIEWER)
+ SET(SUBDIRS_OCCVIEWER OCCViewer)
+ SET(SUBDIRS_VIEWERTOOLS ViewerTools)
+
+ IF(ENABLE_SALOMEOBJECT)
+ SET(SUBDIRS_OCCVIEWER ${SUBDIRS_OCCVIEWER} SOCC)
+ ENDIF(ENABLE_SALOMEOBJECT)
+ENDIF(ENABLE_OCCVIEWER)
+
+##
+# Plot2d viewer
+##
+IF(ENABLE_PLOT2DVIEWER)
+ SET(SUBDIRS_PLOT2DVIEWER Plot2d)
+
+ IF(ENABLE_SALOMEOBJECT)
+ SET(SUBDIRS_PLOT2DVIEWER ${SUBDIRS_PLOT2DVIEWER} SPlot2d)
+ ENDIF(ENABLE_SALOMEOBJECT)
+ENDIF(ENABLE_PLOT2DVIEWER)
+
+##
+# SUPERV graph viewer
+##
+IF(ENABLE_SUPERVGRAPHVIEWER)
+ SET(SUBDIRS_SUPERVGRAPHVIEWER SUPERVGraph)
+ENDIF(ENABLE_SUPERVGRAPHVIEWER)
+
+##
+# Qx scene viewer
+##
+###VSR: QxGraph has been replaced by QxScene
+###SUBDIRS_QXGRAPHVIEWER = QxGraph
+IF(ENABLE_QXGRAPHVIEWER)
+ SET(SUBDIRS_QXGRAPHVIEWER QxScene)
+ENDIF(ENABLE_QXGRAPHVIEWER)
+
+##
+# Python console (base)
+##
+IF(ENABLE_PYCONSOLE)
+ SET(SUBDIRS_PYCONSOLE PyInterp PyConsole)
+ENDIF(ENABLE_PYCONSOLE)
+
+##
+# Light SALOME packages
+##
+SET(SUBDIRS_LIGHT
+ LightApp
+ ResExporter
+)
+
+##
+# Full (CORBA) SALOME packages
+##
+IF(GUI_ENABLE_CORBA)
+ SET(SUBDIRS_CORBA
+ TOOLSGUI
+ Session
+ SalomeApp
+ GuiHelpers
+ TreeData
+ )
+ENDIF(GUI_ENABLE_CORBA)
+
+##
+# Extra Python packages
+##
+IF(ENABLE_PYCONSOLE)
+ SET(SUBDIRS_PY_LIGHT
+ SALOME_SWIG
+ SALOME_PY
+ SALOME_PYQT
+ )
+ENDIF(ENABLE_PYCONSOLE)
+
+SET(SUBDIRS
+ ${SUBDIRS_COMMON}
+ ${SUBDIRS_OBJECT}
+ ${SUBDIRS_VIEWERTOOLS}
+ ${SUBDIRS_GLVIEWER}
+ ${SUBDIRS_VTKVIEWER}
+ ${SUBDIRS_OCCVIEWER}
+ ${SUBDIRS_PLOT2DVIEWER}
+ ${SUBDIRS_SUPERVGRAPHVIEWER}
+ ${SUBDIRS_QXGRAPHVIEWER}
+ ${SUBDIRS_PYCONSOLE}
+ ${SUBDIRS_LIGHT}
+ ${SUBDIRS_CORBA}
+ ${SUBDIRS_PY_LIGHT}
+)
+
+FOREACH(dir ${SUBDIRS})
+ ADD_SUBDIRECTORY(${dir})
+ENDFOREACH(dir ${SUBDIRS})
+
--- /dev/null
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE_DIRECTORIES(
+ ${PTHREAD_INCLUDE_DIRS}
+ ${CAS_INCLUDE_DIRS}
+ ${KERNEL_ROOT_DIR}/include/salome
+)
+
+SET(DDS_SOURCES
+ DDS_DicGroup.cxx
+ DDS_DicItem.cxx
+ DDS_Dictionary.cxx
+ DDS_KeyWords.cxx
+)
+
+ADD_LIBRARY(DDS SHARED ${DDS_SOURCES})
+SET_TARGET_PROPERTIES(DDS PROPERTIES COMPILE_FLAGS "${CAS_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+TARGET_LINK_LIBRARIES(DDS ${CAS_KERNEL} ${CAS_OCAF})
+INSTALL(TARGETS DDS DESTINATION ${GUI_salomelib_LIBS})
+
+FILE(GLOB COMMON_HEADERS_H "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
+INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${GUI_salomeinclude_HEADERS})
+
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+SET(Event_SOURCES
+ ${QT_INCLUDE_DIRS}
+ SALOME_Event.cxx
+ SALOME_EventFilter.cxx
+)
+
+ADD_LIBRARY(Event SHARED ${Event_SOURCES})
+SET_TARGET_PROPERTIES(Event PROPERTIES COMPILE_FLAGS "${QT_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+TARGET_LINK_LIBRARIES(Event ${QT_MT_LIBS})
+INSTALL(TARGETS Event DESTINATION ${GUI_salomelib_LIBS})
+
+FILE(GLOB COMMON_HEADERS_H "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
+INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${GUI_salomeinclude_HEADERS})
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/UseQT4EXT.cmake)
+
+INCLUDE_DIRECTORIES(
+ ${CAS_INCLUDE_DIRS}
+ ${PTHREAD_INCLUDE_DIRS}
+ ${QT_INCLUDE_DIRS}
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Qtx
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SUIT
+)
+
+SET(COMMON_LIBS
+ suit
+ ${QT_MT_LIBS}
+ ${CAS_KERNEL}
+ ${OGL_LIBS}
+)
+
+SET(GUI_HEADERS GLViewer_Selector.h GLViewer_Selector2d.h GLViewer_ToolTip.h GLViewer_ViewFrame.h GLViewer_ViewManager.h GLViewer_ViewPort.h GLViewer_ViewPort2d.h GLViewer_Viewer.h GLViewer_Viewer2d.h GLViewer_Widget.h)
+QT4_WRAP_CPP(GUI_HEADERS_MOC ${GUI_HEADERS})
+
+SET(GLViewer_SOURCES
+ GLViewer_AspectLine.cxx
+ GLViewer_BaseDrawers.cxx
+ GLViewer_BaseObjects.cxx
+ GLViewer_Compass.cxx
+ GLViewer_Context.cxx
+ GLViewer_CoordSystem.cxx
+ GLViewer_Drawer.cxx
+ GLViewer_Geom.cxx
+ GLViewer_Grid.cxx
+ GLViewer_Group.cxx
+ GLViewer_MimeData.cxx
+ GLViewer_Object.cxx
+ GLViewer_Selector.cxx
+ GLViewer_Selector2d.cxx
+ GLViewer_Text.cxx
+ GLViewer_Tools.cxx
+ GLViewer_ToolTip.cxx
+ GLViewer_ViewFrame.cxx
+ GLViewer_ViewManager.cxx
+ GLViewer_ViewPort.cxx
+ GLViewer_ViewPort2d.cxx
+ GLViewer_Viewer.cxx
+ GLViewer_Viewer2d.cxx
+ GLViewer_Widget.cxx
+)
+
+SET(GUITS_SOURCES
+ resources/GLViewer_images.ts
+ resources/GLViewer_msg_en.ts
+ resources/GLViewer_msg_fr.ts
+)
+
+ADD_LIBRARY(GLViewer SHARED ${GLViewer_SOURCES} ${GUI_HEADERS_MOC})
+SET_TARGET_PROPERTIES(GLViewer PROPERTIES COMPILE_FLAGS "${CAS_DEFINITIONS} ${QT_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+TARGET_LINK_LIBRARIES(GLViewer ${COMMON_LIBS})
+INSTALL(TARGETS GLViewer DESTINATION ${GUI_salomelib_LIBS})
+
+FILE(GLOB COMMON_HEADERS_H "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
+INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${GUI_salomeinclude_HEADERS})
+QT4_INSTALL_TS_RESOURCES("${GUITS_SOURCES}" "${GUI_salomeres_DATA}")
+
+FILE(GLOB GUIPNG_DATA "${CMAKE_CURRENT_SOURCE_DIR}/resources/*.png")
+INSTALL(FILES ${GUIPNG_DATA} DESTINATION ${GUI_salomeres_DATA})
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/SalomeMacros.cmake)
+
+INCLUDE_DIRECTORIES(
+ ${CMAKE_CURRENT_BINARY_DIR}
+)
+# Python modules to be installed
+SET(mypkgpython_PYTHON
+ __init__.py
+ selectvars.py
+ genericdialog.py
+ mytestdialog.py
+ helper.py
+)
+SALOME_INSTALL_SCRIPTS("${mypkgpython_PYTHON}" ${GUI_salomepythondir}/salome/gui)
+
+SET(PYUIC_FILES
+ SelectVarsDialog_ui.py
+ genericdialog_ui.py
+ mytestdialog_ui.py
+)
+
+FOREACH(output ${PYUIC_FILES})
+ STRING(REPLACE "_ui.py" ".ui" input ${output})
+ SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${input})
+ SET(output ${CMAKE_CURRENT_BINARY_DIR}/${output})
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${output}
+ COMMAND ${PYUIC_EXECUTABLE} -o ${output} ${input}
+ MAIN_DEPENDENCY ${input}
+ )
+ENDFOREACH(output ${PYUIC_FILES})
+
+ADD_CUSTOM_TARGET(BUILD_PY_UI_FILES ALL DEPENDS ${PYUIC_FILES})
+
+FOREACH(output ${PYUIC_FILES})
+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${output} DESTINATION ${GUI_salomepythondir}/salome/gui)
+ENDFOREACH(output ${PYUIC_FILES})
\ No newline at end of file
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE_DIRECTORIES(
+ ${CAS_INCLUDE_DIRS}
+ ${QT_INCLUDE_DIRS}
+ ${BOOST_INCLUDE_DIRS}
+ ${OMNIORB_INCLUDE_DIRS}
+ ${PTHREAD_INCLUDE_DIRS}
+ ${KERNEL_ROOT_DIR}/include/salome
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SalomeApp
+ ${CMAKE_CURRENT_SOURCE_DIR}/../LightApp
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SUIT
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Qtx
+ ${CMAKE_CURRENT_SOURCE_DIR}/../CAM
+ ${CMAKE_CURRENT_SOURCE_DIR}/../STD
+ ${CMAKE_CURRENT_SOURCE_DIR}/../OBJECT
+)
+
+SET(GUI_HEADERS StandardApp_Module.hxx)
+QT4_WRAP_CPP(GUI_HEADERS_MOC ${GUI_HEADERS})
+SET(SalomeGuiHelpers_SOURCES
+ SALOME_GuiServices.cxx
+ SALOME_AppStudyEditor.cxx
+ StandardApp_Module.cxx
+)
+
+ADD_LIBRARY(SalomeGuiHelpers SHARED ${SalomeGuiHelpers_SOURCES} ${GUI_HEADERS_MOC})
+SET_TARGET_PROPERTIES(SalomeGuiHelpers PROPERTIES COMPILE_FLAGS "${CAS_DEFINITIONS} ${QT_DEFINITIONS} ${BOOST_DEFINITIONS} ${OMNIORB_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+TARGET_LINK_LIBRARIES(SalomeGuiHelpers SalomeApp ${SalomeKernelHelpers} ${CORBA_LIBS})
+INSTALL(TARGETS SalomeGuiHelpers DESTINATION ${GUI_salomelib_LIBS})
+
+FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
+INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${GUI_salomeinclude_HEADERS})
QtHelper.hxx \
SALOME_GuiServices.hxx \
SALOME_AppStudyEditor.hxx \
- StandardApp_Module.hxx
+ StandardApp_Module.hxx \
+ SalomeGuiHelpers.hxx
# Libraries targets
lib_LTLIBRARIES = libSalomeGuiHelpers.la
#include <QDebug>
#define QDEBUG qWarning()
//#define QDEBUG qDebug()
-#define QLOG(data) QDEBUG << "[XSALOME] " << data
+#define QLOG(data) QDEBUG << __FILE__<<" ["<<__LINE__<<"] : " << data
#ifdef LOG
#undef LOG
#endif
#include <SALOME_InteractiveObject.hxx>
#include "SALOME_StudyEditor.hxx"
-
-class SALOME_AppStudyEditor: public SALOME_StudyEditor {
+#include "SalomeGuiHelpers.hxx"
+/*!
+ * This class is a specialization of the KERNEL StudyEditor for
+ * the GUI context. The concept of active study is introduced here
+ * while it does not exist in the pure KERNEL context.
+ */
+class SALOMEGUIHELPERS_EXPORT SALOME_AppStudyEditor: public SALOME_StudyEditor {
public:
SALOME_AppStudyEditor(SalomeApp_Application * salomeApp);
int updateActiveStudy();
#include CORBA_SERVER_HEADER(SALOMEDS)
#include <SALOME_InteractiveObject.hxx>
#include <SALOME_KernelServices.hxx>
-
+#include "SalomeGuiHelpers.hxx"
namespace GUI {
// SALOME GUI main services
- SalomeApp_Application * getSalomeApplication();
- LightApp_SelectionMgr * getSelectionManager();
- SUIT_ResourceMgr * getResourcesManager();
+ SALOMEGUIHELPERS_EXPORT SalomeApp_Application * getSalomeApplication();
+ SALOMEGUIHELPERS_EXPORT LightApp_SelectionMgr * getSelectionManager();
+ SALOMEGUIHELPERS_EXPORT SUIT_ResourceMgr * getResourcesManager();
// Helper functions to deal with the study in a GUI context.
//
// depends of the SALOME module technical choices). In general, on
// of the attribute of a SObject is a CORBA servant that handles the
// data to work with
- SALOMEDS::Study_ptr getActiveStudy();
- int getActiveStudyId();
+ SALOMEGUIHELPERS_EXPORT SALOMEDS::Study_ptr getActiveStudy();
+ SALOMEGUIHELPERS_EXPORT int getActiveStudyId();
// Another way to get the active study (to be converted in
// SALOMEDS::Study):
- SalomeApp_Study * getSalomeAppActiveStudy();
+ SALOMEGUIHELPERS_EXPORT SalomeApp_Study * getSalomeAppActiveStudy();
- SALOMEDS::SObject_ptr IObjectToSObject(const Handle(SALOME_InteractiveObject)& iobject);
+ SALOMEGUIHELPERS_EXPORT SALOMEDS::SObject_ptr IObjectToSObject(const Handle(SALOME_InteractiveObject)& iobject);
template<class TInterface> typename TInterface::_var_type
IObjectToInterface(const Handle(SALOME_InteractiveObject)& iobject) {
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef SALOMEGUIHELPERS_HXX
+#define SALOMEGUIHELPERS_HXX
+
+#ifdef WIN32
+# if defined SalomeGuiHelpers_EXPORTS || defined SALOMEGUIHELPERS_EXPORTS
+# define SALOMEGUIHELPERS_EXPORT __declspec(dllexport)
+# else
+# define SALOMEGUIHELPERS_EXPORT __declspec(dllimport)
+# endif
+#else
+# define SALOMEGUIHELPERS_EXPORT
+#endif
+
+#if defined WIN32
+#pragma warning ( disable: 4251 )
+#pragma warning ( disable: 4786 )
+#endif
+
+#endif // SALOMEGUIHELPERS_HXX
#include <QString>
+#include "SalomeGuiHelpers.hxx"
+
/*!
* This class is provided as the base class for the standard gui part
* of a SALOME module. To define a gui part, you just have to
* test package (tst/module/gui/Xsalome.hxx and
* tst/module/gui/factory.cxx in the XSALOME library).
*/
-class StandardApp_Module: public SalomeApp_Module
+class SALOMEGUIHELPERS_EXPORT StandardApp_Module: public SalomeApp_Module
{
Q_OBJECT
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/UseQT4EXT.cmake)
+
+INCLUDE_DIRECTORIES(
+ ${CAS_INCLUDE_DIRS}
+ ${QT_INCLUDE_DIRS}
+ ${HDF5_INCLUDE_DIRS}
+ ${PYTHON_INCLUDE_DIRS}
+ ${PTHREAD_INCLUDE_DIRS}
+ ${QWT_INCLUDE_DIRS}
+ ${KERNEL_ROOT_DIR}/include/salome
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SUIT
+ ${CMAKE_CURRENT_SOURCE_DIR}/../STD
+ ${CMAKE_CURRENT_SOURCE_DIR}/../CAM
+ ${CMAKE_CURRENT_SOURCE_DIR}/../ObjBrowser
+ ${CMAKE_CURRENT_SOURCE_DIR}/../LogWindow
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Prs
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Qtx
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Event
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Style
+ ${CMAKE_CURRENT_SOURCE_DIR}/../CASCatch
+)
+
+SET(COMMON_FLAGS "${PYTHON_DEFINITIONS} ${HDF5_DEFINITIONS} ${CAS_DEFINITIONS} ${QT_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+IF(NOT WINDOWS)
+ SET(COMMON_FLAGS "${COMMON_FLAGS} -Wno-deprecated")
+ENDIF(NOT WINDOWS)
+
+SET(COMMON_LIBS
+ ${QT_LIBS}
+ suit
+ std
+ CAM
+ LogWindow
+ ${CAS_KERNEL}
+ SalomePrs
+ ObjBrowser
+ SalomeStyle
+ Event
+ ${HDF5_LIBS}
+ ${KERNEL_LDFLAGS}
+ ${SalomeHDFPersist}
+ ${SALOMELocalTrace}
+)
+
+SET(GUI_HEADERS
+ LightApp_AboutDlg.h
+ LightApp_Application.h
+ LightApp_DataModel.h
+ LightApp_Dialog.h
+ LightApp_OBSelector.h
+ LightApp_Operation.h
+ LightApp_Module.h
+ LightApp_ModuleAction.h
+ LightApp_ModuleDlg.h
+ LightApp_NameDlg.h
+ LightApp_SelectionMgr.h
+ LightApp_ShowHideOp.h
+ LightApp_Study.h
+ LightApp_SwitchOp.h
+ LightApp_Preferences.h
+ LightApp_PreferencesDlg.h
+ LightApp_WgViewModel.h
+)
+
+SET(RCCS LightApp.qrc)
+
+SET(LightApp_SOURCES
+ LightApp_AboutDlg.cxx
+ LightApp_Application.cxx
+ LightApp_DataModel.cxx
+ LightApp_DataObject.cxx
+ LightApp_DataOwner.cxx
+ LightApp_DataSubOwner.cxx
+ LightApp_Dialog.cxx
+ LightApp_Displayer.cxx
+ LightApp_Driver.cxx
+ LightApp_EventFilter.cxx
+ LightApp_HDFDriver.cxx
+ LightApp_Module.cxx
+ LightApp_ModuleAction.cxx
+ LightApp_ModuleDlg.cxx
+ LightApp_NameDlg.cxx
+ LightApp_OBSelector.cxx
+ LightApp_Operation.cxx
+ LightApp_Selection.cxx
+ LightApp_SelectionMgr.cxx
+ LightApp_ShowHideOp.cxx
+ LightApp_Study.cxx
+ LightApp_SwitchOp.cxx
+ LightApp_Preferences.cxx
+ LightApp_PreferencesDlg.cxx
+ LightApp_WgViewModel.cxx
+ LightApp_FullScreenHelper.cxx
+)
+
+SET(GUITS_SOURCES
+ resources/LightApp_images.ts
+ resources/LightApp_msg_en.ts
+ resources/LightApp_msg_fr.ts
+)
+
+SET(COMMON_HEADERS_H
+ LightApp.h
+ LightApp_AboutDlg.h
+ LightApp_Application.h
+ LightApp_DataModel.h
+ LightApp_DataObject.h
+ LightApp_DataOwner.h
+ LightApp_DataSubOwner.h
+ LightApp_Dialog.h
+ LightApp_Displayer.h
+ LightApp_Driver.h
+ LightApp_EventFilter.h
+ LightApp_HDFDriver.h
+ LightApp_Module.h
+ LightApp_ModuleAction.h
+ LightApp_ModuleDlg.h
+ LightApp_NameDlg.h
+ LightApp_OBSelector.h
+ LightApp_Operation.h
+ LightApp_Selection.h
+ LightApp_SelectionMgr.h
+ LightApp_ShowHideOp.h
+ LightApp_Study.h
+ LightApp_SwitchOp.h
+ LightApp_Preferences.h
+ LightApp_PreferencesDlg.h
+ LightApp_UpdateFlags.h
+ LightApp_WgViewModel.h
+ LightApp_FullScreenHelper.h
+)
+
+IF(ENABLE_PYCONSOLE)
+ INCLUDE_DIRECTORIES(
+ ${PYTHON_INCLUDE_DIRS}
+ ${CMAKE_CURRENT_SOURCE_DIR}/../PyConsole
+ ${CMAKE_CURRENT_SOURCE_DIR}/../PyInterp
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SUITApp
+ )
+ SET(COMMON_FLAGS "${COMMON_FLAGS} ${PYTHON_DEFINITIONS}")
+ SET(COMMON_HEADERS_H ${COMMON_HEADERS_H} LightApp_PyInterp.h)
+ SET(LightApp_SOURCES ${LightApp_SOURCES} LightApp_PyInterp.cxx)
+ SET(COMMON_LIBS ${COMMON_LIBS} PyInterp PyConsole SUITApp)
+ELSE(ENABLE_PYCONSOLE)
+ SET(COMMON_FLAGS "${COMMON_FLAGS} -DDISABLE_PYCONSOLE")
+ENDIF(ENABLE_PYCONSOLE)
+
+IF(ENABLE_VTKVIEWER)
+ INCLUDE_DIRECTORIES(
+ ${VTK_INCLUDE_DIRS}
+ ${CMAKE_CURRENT_SOURCE_DIR}/../VTKViewer
+ )
+ SET(COMMON_LIBS ${COMMON_LIBS} ${VTK_LIBS} VTKViewer)
+ IF(ENABLE_SALOMEOBJECT)
+ SET(COMMON_HEADERS_H ${COMMON_HEADERS_H} LightApp_VTKSelector.h)
+ SET(LightApp_SOURCES ${LightApp_SOURCES} LightApp_VTKSelector.cxx)
+ SET(GUI_HEADERS ${GUI_HEADERS} LightApp_VTKSelector.h)
+ SET(COMMON_LIBS ${COMMON_LIBS} SVTK)
+ ENDIF(ENABLE_SALOMEOBJECT)
+ELSE(ENABLE_VTKVIEWER)
+ SET(COMMON_FLAGS "${COMMON_FLAGS} -DDISABLE_VTKVIEWER")
+ENDIF(ENABLE_VTKVIEWER)
+
+IF(ENABLE_OCCVIEWER)
+ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../OCCViewer)
+ SET(COMMON_HEADERS_H ${COMMON_HEADERS_H} LightApp_OCCSelector.h)
+ SET(LightApp_SOURCES ${LightApp_SOURCES} LightApp_OCCSelector.cxx)
+ SET(COMMON_LIBS ${COMMON_LIBS} OCCViewer)
+ SET(GUI_HEADERS ${GUI_HEADERS} LightApp_OCCSelector.h)
+ELSE(ENABLE_OCCVIEWER)
+ SET(COMMON_FLAGS "${COMMON_FLAGS} -DDISABLE_OCCVIEWER")
+ENDIF(ENABLE_OCCVIEWER)
+
+IF(ENABLE_GLVIEWER)
+ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../GLViewer)
+ SET(COMMON_HEADERS_H ${COMMON_HEADERS_H} LightApp_GLSelector.h)
+ SET(LightApp_SOURCES ${LightApp_SOURCES} LightApp_GLSelector.cxx)
+ SET(GUI_HEADERS ${GUI_HEADERS} LightApp_GLSelector.h)
+ SET(COMMON_LIBS ${COMMON_LIBS} GLViewer)
+ELSE(ENABLE_GLVIEWER)
+ SET(COMMON_FLAGS "${COMMON_FLAGS} -DDISABLE_GLVIEWER")
+ENDIF(ENABLE_GLVIEWER)
+
+IF(ENABLE_PLOT2DVIEWER)
+ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../Plot2d)
+ SET(COMMON_FLAGS "${COMMON_FLAGS} ${QWT_DEFINITIONS}")
+ SET(COMMON_HEADERS_H ${COMMON_HEADERS_H} LightApp_Plot2dSelector.h)
+ SET(LightApp_SOURCES ${LightApp_SOURCES} LightApp_Plot2dSelector.cxx)
+ SET(GUI_HEADERS ${GUI_HEADERS} LightApp_Plot2dSelector.h)
+ SET(COMMON_LIBS ${COMMON_LIBS} Plot2d)
+ELSE(ENABLE_PLOT2DVIEWER)
+ SET(COMMON_FLAGS "${COMMON_FLAGS} -DDISABLE_PLOT2DVIEWER")
+ENDIF(ENABLE_PLOT2DVIEWER)
+
+IF(ENABLE_SUPERVGRAPHVIEWER)
+ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../SUPERVGraph)
+ SET(COMMON_LIBS ${COMMON_LIBS} SUPERVGraph)
+ELSE(ENABLE_SUPERVGRAPHVIEWER)
+ SET(COMMON_FLAGS "${COMMON_FLAGS} -DDISABLE_SUPERVGRAPHVIEWER")
+ENDIF(ENABLE_SUPERVGRAPHVIEWER)
+
+IF(ENABLE_QXGRAPHVIEWER)
+ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../QxScene)
+ SET(COMMON_LIBS ${COMMON_LIBS} QxScene)
+ELSE(ENABLE_QXGRAPHVIEWER)
+ SET(COMMON_FLAGS "${COMMON_FLAGS} -DDISABLE_QXGRAPHVIEWER")
+ENDIF(ENABLE_QXGRAPHVIEWER)
+
+IF(ENABLE_SALOMEOBJECT)
+ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../OBJECT)
+ SET(COMMON_LIBS ${COMMON_LIBS} SalomeObject)
+ IF(ENABLE_PLOT2DVIEWER)
+ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../SPlot2d)
+ SET(COMMON_LIBS ${COMMON_LIBS} SPlot2d)
+ ENDIF(ENABLE_PLOT2DVIEWER)
+
+ IF(ENABLE_OCCVIEWER)
+ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../SOCC)
+ SET(COMMON_LIBS ${COMMON_LIBS} SOCC)
+ ENDIF(ENABLE_OCCVIEWER)
+
+ IF(ENABLE_VTKVIEWER)
+ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../SVTK)
+ ENDIF(ENABLE_VTKVIEWER)
+ELSE(ENABLE_SALOMEOBJECT)
+ SET(COMMON_FLAGS "${COMMON_FLAGS} -DDISABLE_SALOMEOBJECT")
+ENDIF(ENABLE_SALOMEOBJECT)
+
+QT4_WRAP_CPP(GUI_HEADERS_MOC ${GUI_HEADERS})
+QT4_ADD_RESOURCES(RCC_SRCS ${RCCS})
+ADD_LIBRARY(LightApp SHARED ${LightApp_SOURCES} ${GUI_HEADERS_MOC} ${RCC_SRCS})
+SET_TARGET_PROPERTIES(LightApp PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}")
+TARGET_LINK_LIBRARIES(LightApp ${COMMON_LIBS})
+INSTALL(TARGETS LightApp DESTINATION ${GUI_salomelib_LIBS})
+
+INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${GUI_salomeinclude_HEADERS})
+QT4_INSTALL_TS_RESOURCES("${GUITS_SOURCES}" "${GUI_salomeres_DATA}")
+
+FILE(GLOB GUIPNG_DATA "${CMAKE_CURRENT_SOURCE_DIR}/resources/*.png")
+SET(GUI_DATA ${GUIPNG_DATA} ${CMAKE_CURRENT_SOURCE_DIR}/resources/LightApp.ini ${CMAKE_CURRENT_SOURCE_DIR}/resources/LightApp.xml)
+INSTALL(FILES ${GUI_DATA} DESTINATION ${GUI_salomeres_DATA})
QString vtlt = tr( QString( "NEW_WINDOW_%1" ).arg( suffix ).toLatin1().constData() );
QString tip = tr( "CREATING_NEW_WINDOW" ).arg( vtlt.remove( "&" ) );
QAction* a = createAction( id, // menu action id
- tip, // status tip
- QIcon(), // icon
- vtlt, // menu text
+ tip, // status tip
+ QIcon(), // icon
+ vtlt, // menu text
tip, // tooltip
accel, // shortcut
- desktop(), // parent
+ desktop(), // parent
false, // toggle flag
- this, // receiver
+ this, // receiver
SLOT( onNewWindow() ) ); // slot
createMenu( a, parentId, -1 );
}
QString helpFileName = fileIt.key();
// remove all '//' occurances
while ( helpFileName.contains( "//" ) )
- helpFileName.replace( "//", "" );
+ helpFileName.replace( "//", "" );
// obtain submenus hierarchy if given
QStringList smenus = helpFileName.split( "/" );
helpFileName = smenus.last();
0, desk, false, this, SLOT( onHelpContentsModule() ) );
a->setData( fileIt.value() );
if ( !helpSubMenu.isEmpty() ) {
- smenus.prepend( helpSubMenu );
+ smenus.prepend( helpSubMenu );
}
// create sub-menus hierarchy
int menuId = helpMenu;
// is defined. On Linux platform QWebKit doesn't work correctly without 'file://' protocol.
QtxWebBrowser::loadUrl(helpFile);
#else
- QtxWebBrowser::loadUrl(QString("file://%1").arg(helpFile));
+ QtxWebBrowser::loadUrl(QString("file://%1").arg(helpFile));
#endif
}
}
#ifdef WIN32
// On Win32 platform QWebKit of the Qt 4.6.3 hang up in case 'file://' protocol
// is defined. On Linux platform QWebKit doesn't work correctly without 'file://' protocol.
- QtxWebBrowser::loadUrl(helpFile, context);
+ QtxWebBrowser::loadUrl(helpFile, context);
#else
- QtxWebBrowser::loadUrl(QString("file://%1").arg(helpFile),context);
+ QtxWebBrowser::loadUrl(QString("file://%1").arg(helpFile),context);
#endif
}
vm = new OCCViewer_Viewer( true );
#endif
vm->setBackground( OCCViewer_ViewFrame::TOP_LEFT,
- resMgr->backgroundValue( "OCCViewer", "xz_background", vm->background(OCCViewer_ViewFrame::TOP_LEFT) ) );
+ resMgr->backgroundValue( "OCCViewer", "xz_background", vm->background(OCCViewer_ViewFrame::TOP_LEFT) ) );
vm->setBackground( OCCViewer_ViewFrame::TOP_RIGHT,
- resMgr->backgroundValue( "OCCViewer", "yz_background", vm->background(OCCViewer_ViewFrame::TOP_RIGHT) ) );
+ resMgr->backgroundValue( "OCCViewer", "yz_background", vm->background(OCCViewer_ViewFrame::TOP_RIGHT) ) );
vm->setBackground( OCCViewer_ViewFrame::BOTTOM_LEFT,
- resMgr->backgroundValue( "OCCViewer", "xy_background", vm->background(OCCViewer_ViewFrame::BOTTOM_LEFT) ) );
+ resMgr->backgroundValue( "OCCViewer", "xy_background", vm->background(OCCViewer_ViewFrame::BOTTOM_LEFT) ) );
vm->setBackground( OCCViewer_ViewFrame::BOTTOM_RIGHT,
- resMgr->backgroundValue( "OCCViewer", "background", vm->background(OCCViewer_ViewFrame::MAIN_VIEW) ) );
+ resMgr->backgroundValue( "OCCViewer", "background", vm->background(OCCViewer_ViewFrame::MAIN_VIEW) ) );
vm->setTrihedronSize( resMgr->doubleValue( "OCCViewer", "trihedron_size", vm->trihedronSize() ),
resMgr->booleanValue( "OCCViewer", "relative_size", vm->trihedronRelative() ));
SUIT_ProxyModel* proxyModel = dynamic_cast<SUIT_ProxyModel*>(treeModel);
if ( proxyModel ) {
connect( proxyModel, SIGNAL( dropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ),
- this, SLOT( onDropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ) );
+ this, SLOT( onDropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ) );
}
// temporary commented
// ... "Look and feel" group <<start>>
int lookGroup = pref->addPreference( tr( "PREF_GROUP_LOOK_AND_FEEL" ), genTab );
+ pref->setItemProperty( "columns", 2, lookGroup );
+ // .... -> show splash-screen
+ pref->addPreference( tr( "PREF_SHOW_SPLASH" ), lookGroup, LightApp_Preferences::Bool, "launch", "splash" );
// .... -> opaque resize
pref->addPreference( tr( "PREF_OPAQUE_RESIZE" ), lookGroup, LightApp_Preferences::Bool, "desktop", "opaque_resize" );
// .... -> drop-down buttons
foreach( int gid, idList ) anIndicesList << gid;
// .... -> 3D viewer background
int bgId = pref->addPreference( tr( "PREF_3DVIEWER_BACKGROUND" ), bgGroup,
- LightApp_Preferences::Background, "OCCViewer", "background" );
+ LightApp_Preferences::Background, "OCCViewer", "background" );
pref->setItemProperty( "gradient_names", aValuesList, bgId );
pref->setItemProperty( "gradient_ids", anIndicesList, bgId );
pref->setItemProperty( "texture_enabled", !txtList.isEmpty(), bgId );
pref->setItemProperty( "image_formats", formats, bgId );
// .... -> XZ viewer background
bgId = pref->addPreference( tr( "PREF_XZVIEWER_BACKGROUND" ), bgGroup,
- LightApp_Preferences::Background, "OCCViewer", "xz_background" );
+ LightApp_Preferences::Background, "OCCViewer", "xz_background" );
pref->setItemProperty( "gradient_names", aValuesList, bgId );
pref->setItemProperty( "gradient_ids", anIndicesList, bgId );
pref->setItemProperty( "texture_enabled", !txtList.isEmpty(), bgId );
pref->setItemProperty( "image_formats", formats, bgId );
// .... -> YZ viewer background
bgId = pref->addPreference( tr( "PREF_YZVIEWER_BACKGROUND" ), bgGroup,
- LightApp_Preferences::Background, "OCCViewer", "yz_background" );
+ LightApp_Preferences::Background, "OCCViewer", "yz_background" );
pref->setItemProperty( "gradient_names", aValuesList, bgId );
pref->setItemProperty( "gradient_ids", anIndicesList, bgId );
pref->setItemProperty( "texture_enabled", !txtList.isEmpty(), bgId );
pref->setItemProperty( "image_formats", formats, bgId );
// .... -> XY viewer background
bgId = pref->addPreference( tr( "PREF_XYVIEWER_BACKGROUND" ), bgGroup,
- LightApp_Preferences::Background, "OCCViewer", "xy_background" );
+ LightApp_Preferences::Background, "OCCViewer", "xy_background" );
pref->setItemProperty( "gradient_names", aValuesList, bgId );
pref->setItemProperty( "gradient_ids", anIndicesList, bgId );
pref->setItemProperty( "texture_enabled", !txtList.isEmpty(), bgId );
formats = SVTK_Viewer::backgroundData( aValuesList, idList, txtList );
foreach( int gid, idList ) anIndicesList << gid;
bgId = pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), vtkGen,
- LightApp_Preferences::Background, "VTKViewer", "background" );
+ LightApp_Preferences::Background, "VTKViewer", "background" );
pref->setItemProperty( "gradient_names", aValuesList, bgId );
pref->setItemProperty( "gradient_ids", anIndicesList, bgId );
pref->setItemProperty( "texture_enabled", !txtList.isEmpty(), bgId );
// scroll to each entry in the list
// (in optimized mode - to the last entry only)
QString anEntry;
- LightApp_DataObject* anObject;
+ LightApp_DataObject* anObject = 0;
while( anIter.hasNext() )
{
anEntry = anIter.next();
LightApp_Module* sMod = 0;
CAM_Module* mod = module( msgType );
if ( !mod )
- mod = module( moduleTitle( msgType ) );
+ mod = module( moduleTitle( msgType ) );
if ( mod && mod->inherits( "LightApp_Module" ) )
- sMod = (LightApp_Module*)mod;
+ sMod = (LightApp_Module*)mod;
if ( msgType.toLower() == "preferences" ) {
- // requested preferences change: should be given as "preferences/<section>/<name>/<value>"
- // for example "preferences/Study/multi_file_dump/true"
- if ( data.count() > 3 ) {
- QString section = data[1].trimmed();
- QString param = data[2].trimmed();
- QString value = QStringList( data.mid(3) ).join( sectionSeparator );
- resourceMgr()->setValue( section, param, value );
- }
+ // requested preferences change: should be given as "preferences/<section>/<name>/<value>"
+ // for example "preferences/Study/multi_file_dump/true"
+ if ( data.count() > 3 ) {
+ QString section = data[1].trimmed();
+ QString param = data[2].trimmed();
+ QString value = QStringList( data.mid(3) ).join( sectionSeparator );
+ resourceMgr()->setValue( section, param, value );
+ }
}
else if ( sMod ) {
- // received message for the module
- QString msg = QStringList( data.mid(1) ).join( sectionSeparator );
- sMod->message( msg );
+ // received message for the module
+ QString msg = QStringList( data.mid(1) ).join( sectionSeparator );
+ sMod->message( msg );
}
}
}
rid = idsRight[i].toInt( &okRight );
if ( okLeft && okRight ) {
// both seem to be correct integer ID
- return lid < rid;
+ if ( lid < rid ) return true;
}
else if ( okLeft || okRight ) {
// objects with correct (int) ID have higher priority
QAbstractButton* impBtn = userButton( insertButton( tr( "IMPORT_BTN_TEXT" ) ) );
if( impBtn )
connect( impBtn, SIGNAL( clicked() ), this, SLOT( onImportPref() ) );
+
+ setMinimumSize( 800, 600 );
}
/*!
<parameter name="image" value="${GUI_ROOT_DIR}/share/salome/resources/gui/icon_about.png" />
<parameter name="constant_info" value="%A [ %V ]" />
<parameter name="text_colors" value="#ffffff|#777777" />
- <parameter name="hide_on_click" value="no" />
+ <parameter name="hide_on_click" value="yes" />
<parameter name="show_progress" value="yes" />
<parameter name="show_message" value="yes" />
<parameter name="show_percents" value="yes" />
<source>PREF_GROUP_LOOK_AND_FEEL</source>
<translation>Look and feel</translation>
</message>
+ <message>
+ <source>PREF_SHOW_SPLASH</source>
+ <translation>Show splash screen at start-up</translation>
+ </message>
<message>
<source>PREF_OPAQUE_RESIZE</source>
<translation>Opaque resize</translation>
<source>PREF_GROUP_LOOK_AND_FEEL</source>
<translation>Aspect</translation>
</message>
+ <message>
+ <source>PREF_SHOW_SPLASH</source>
+ <translation>Afficher l'écran de démarrage</translation>
+ </message>
<message>
<source>PREF_OPAQUE_RESIZE</source>
<translation>Redimensionnement opaque</translation>
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/UseQT4EXT.cmake)
+
+INCLUDE_DIRECTORIES(
+ ${QT_INCLUDE_DIRS}
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Qtx
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SUIT
+)
+
+SET(GUI_HEADERS LogWindow.h)
+QT4_WRAP_CPP(GUI_HEADERS_MOC ${GUI_HEADERS})
+
+SET(GUITS_SOURCES
+ resources/LogWindow_msg_en.ts
+ resources/LogWindow_msg_fr.ts
+)
+
+ADD_LIBRARY(LogWindow SHARED LogWindow.cxx ${GUI_HEADERS_MOC})
+SET_TARGET_PROPERTIES(LogWindow PROPERTIES COMPILE_FLAGS "${QT_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+TARGET_LINK_LIBRARIES(LogWindow qtx suit ${QT_MT_LIBS})
+INSTALL(TARGETS LogWindow DESTINATION ${GUI_salomelib_LIBS})
+
+FILE(GLOB COMMON_HEADERS_H "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
+INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${GUI_salomeinclude_HEADERS})
+QT4_INSTALL_TS_RESOURCES("${GUITS_SOURCES}" "${GUI_salomeres_DATA}")
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE_DIRECTORIES(
+ ${PTHREAD_INCLUDE_DIRS}
+ ${CAS_INCLUDE_DIRS}
+ ${QT_INCLUDE_DIRS}
+ ${KERNEL_ROOT_DIR}/include/salome
+)
+
+SET(COMMON_LIBS
+ ${QT_LIBS}
+ ${CAS_LDPATH}
+ ${TKV3d}
+)
+
+SET(SalomeObject_SOURCES
+ SALOME_InteractiveObject.cxx
+ SALOME_AISShape.cxx
+ SALOME_AISObject.cxx
+ SALOME_ListIO_0.cxx
+ SALOME_ListIteratorOfListIO_0.cxx
+ SALOME_ListNodeOfListIO_0.cxx
+ SALOME_Filter.cxx
+ SALOME_TypeFilter.cxx
+ SALOME_DataMapOfIOMapOfInteger_0.cxx
+ SALOME_DataMapNodeOfDataMapOfIOMapOfInteger_0.cxx
+ SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger_0.cxx
+)
+
+ADD_LIBRARY(SalomeObject SHARED ${SalomeObject_SOURCES})
+SET_TARGET_PROPERTIES(SalomeObject PROPERTIES COMPILE_FLAGS "${QT_DEFINITIONS} ${CAS_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+TARGET_LINK_LIBRARIES(SalomeObject ${COMMON_LIBS})
+INSTALL(TARGETS SalomeObject DESTINATION ${GUI_salomelib_LIBS})
+
+FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
+INSTALL(FILES ${COMMON_HEADERS_HXX} SALOME_Selection.h DESTINATION ${GUI_salomeinclude_HEADERS})
--- /dev/null
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/UseQT4EXT.cmake)
+
+INCLUDE_DIRECTORIES(
+ ${CAS_INCLUDE_DIRS}
+ ${OGL_INCLUDE_DIRS}
+ ${QT_INCLUDE_DIRS}
+ ${PTHREAD_INCLUDE_DIRS}
+ ${KERNEL_ROOT_DIR}/include/salome
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SUIT
+ ${CMAKE_CURRENT_SOURCE_DIR}/../ViewerTools
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Qtx
+ ${CMAKE_CURRENT_SOURCE_DIR}/../OpenGLUtils
+ ${CMAKE_CURRENT_SOURCE_DIR}/../CASCatch
+)
+SET(COMMON_FLAGS "${QT_DEFINITIONS} ${CAS_DEFINITIONS} ${OGL_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+SET(COMMON_LIBS
+ qtx
+ suit
+ ViewerTools
+ OpenGLUtils
+ ${OGL_LIBS}
+ ${QT_MT_LIBS}
+ ${CAS_KERNEL}
+ ${CAS_VIEWER}
+)
+
+SET(GUI_HEADERS
+ OCCViewer_AISSelector.h
+ OCCViewer_ViewModel.h
+ OCCViewer_ViewPort3d.h
+ OCCViewer_ViewPort.h
+ OCCViewer_ViewSketcher.h
+ OCCViewer_ViewWindow.h
+ OCCViewer_ViewManager.h
+ OCCViewer_CreateRestoreViewDlg.h
+ OCCViewer_SetRotationPointDlg.h
+ OCCViewer_ClippingDlg.h
+ OCCViewer_AxialScaleDlg.h
+ OCCViewer_FontWidget.h
+ OCCViewer_CubeAxesDlg.h
+ OCCViewer_ToolTip.h
+ OCCViewer_ViewFrame.h
+)
+QT4_WRAP_CPP(GUI_HEADERS ${GUI_HEADERS})
+
+SET(OCCViewer_SOURCES
+ OCCViewer_AISSelector.cxx
+ OCCViewer_ViewManager.cxx
+ OCCViewer_ViewModel.cxx
+ OCCViewer_ViewPort3d.cxx
+ OCCViewer_ViewPort.cxx
+ OCCViewer_ViewSketcher.cxx
+ OCCViewer_ViewWindow.cxx
+ OCCViewer_VService.cxx
+ OCCViewer_CreateRestoreViewDlg.cxx
+ OCCViewer_SetRotationPointDlg.cxx
+ OCCViewer_ClippingDlg.cxx
+ OCCViewer_AxialScaleDlg.cxx
+ OCCViewer_Trihedron.cxx
+ OCCViewer_FontWidget.cxx
+ OCCViewer_CubeAxesDlg.cxx
+ OCCViewer_ToolTip.cxx
+ OCCViewer_ViewFrame.cxx
+)
+
+SET(GUITS_SOURCES
+ resources/OCCViewer_images.ts
+ resources/OCCViewer_msg_en.ts
+ resources/OCCViewer_msg_fr.ts
+)
+
+ADD_LIBRARY(OCCViewer SHARED ${OCCViewer_SOURCES} ${GUI_HEADERS})
+SET_TARGET_PROPERTIES(OCCViewer PROPERTIES COMPILE_FLAGS ${COMMON_FLAGS})
+TARGET_LINK_LIBRARIES(OCCViewer ${COMMON_LIBS})
+INSTALL(TARGETS OCCViewer DESTINATION ${GUI_salomelib_LIBS})
+SET(COMMON_HEADERS_H
+ OCCViewer_AISSelector.h
+ OCCViewer_ViewManager.h
+ OCCViewer_ViewModel.h
+ OCCViewer_ViewPort3d.h
+ OCCViewer_ViewPort.h
+ OCCViewer_ViewSketcher.h
+ OCCViewer_ViewWindow.h
+ OCCViewer_VService.h
+ OCCViewer_CreateRestoreViewDlg.h
+ OCCViewer.h
+ OCCViewer_ClippingDlg.h
+ OCCViewer_AxialScaleDlg.h
+ OCCViewer_SetRotationPointDlg.h
+ OCCViewer_Trihedron.h
+ OCCViewer_FontWidget.h
+ OCCViewer_CubeAxesDlg.h
+ OCCViewer_ToolTip.h
+ OCCViewer_ViewFrame.h
+)
+INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${GUI_salomeinclude_HEADERS})
+QT4_INSTALL_TS_RESOURCES("${GUITS_SOURCES}" "${GUI_salomeres_DATA}")
+
+FILE(GLOB GUIPNG_DATA "${CMAKE_CURRENT_SOURCE_DIR}/resources/*.png")
+INSTALL(FILES ${GUIPNG_DATA} DESTINATION ${GUI_salomeres_DATA})
*/
OCCViewer_Viewer::~OCCViewer_Viewer()
{
+ myAISContext.Nullify();
+ myV3dViewer.Nullify();
+ myV3dCollector.Nullify();
}
/*!
initView( vw );
// set default background for view window
vw->setBackground( background(0) ); // 0 means MAIN_VIEW (other views are not yet created here)
+ // connect signal from viewport
+ connect(view->getViewPort(), SIGNAL(vpClosed()), this, SLOT(onViewClosed()));
return view;
}
emit selectionChanged();
}
+void OCCViewer_Viewer::onViewClosed()
+{
+ Standard_Integer aViewsNb = 0;
+ for ( myV3dViewer->InitActiveViews(); myV3dViewer->MoreActiveViews(); myV3dViewer->NextActiveViews())
+ ++aViewsNb;
+ if ( aViewsNb < 2 ) {
+ //clean up presentations before last view is closed
+ myAISContext->RemoveAll(Standard_False);
+ }
+}
+
int OCCViewer_Viewer::getTopLayerId()
{
#if OCC_VERSION_LARGE > 0x06050200
virtual void onMouseMove(SUIT_ViewWindow*, QMouseEvent*);
virtual void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
virtual void onKeyPress(SUIT_ViewWindow*, QKeyEvent*);
+ virtual void onViewClosed();
void onDumpView();
void onChangeBackground();
*/
OCCViewer_ViewPort3d::~OCCViewer_ViewPort3d()
{
+ emit vpClosed();
Handle(V3d_View) aView = activeView();
if (!aView.IsNull())
aView->Remove();
signals:
void vpChangeBackground( const Qtx::BackgroundData& );
+ void vpClosed();
public slots:
virtual bool synchronize( OCCViewer_ViewPort* );
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/UseQT4EXT.cmake)
+
+INCLUDE_DIRECTORIES(
+ ${QT_INCLUDE_DIRS}
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Qtx
+)
+
+SET(GUI_HEADERS OB_Browser.h)
+QT4_WRAP_CPP(GUI_HEADERS ${GUI_HEADERS})
+SET(ObjBrowser_SOURCES
+ OB_Browser.cxx
+)
+
+SET(GUITS_SOURCES
+ resources/OB_msg_en.ts
+ resources/OB_msg_fr.ts
+)
+
+ADD_LIBRARY(ObjBrowser SHARED ${ObjBrowser_SOURCES} ${GUI_HEADERS})
+SET_TARGET_PROPERTIES(ObjBrowser PROPERTIES COMPILE_FLAGS "${QT_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+TARGET_LINK_LIBRARIES(ObjBrowser qtx ${QT_MT_LIBS})
+INSTALL(TARGETS ObjBrowser DESTINATION ${GUI_salomelib_LIBS})
+
+SET(COMMON_HEADERS_H
+ OB.h
+ OB_Browser.h
+)
+INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${GUI_salomeinclude_HEADERS})
+QT4_INSTALL_TS_RESOURCES("${GUITS_SOURCES}" "${GUI_salomeres_DATA}")
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE_DIRECTORIES(
+ ${PTHREAD_INCLUDE_DIRS}
+ ${KERNEL_ROOT_DIR}/include/salome
+)
+
+SET(COMMON_FLAGS "${PLATFORM_DEFINITIONS}")
+SET(COMMON_LIBS ${OGL_LIBS} ${SALOMELocalTrace})
+
+ADD_LIBRARY(OpenGLUtils SHARED OpenGLUtils_FrameBuffer.cxx)
+SET_TARGET_PROPERTIES(OpenGLUtils PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}")
+TARGET_LINK_LIBRARIES(OpenGLUtils ${COMMON_LIBS})
+INSTALL(TARGETS OpenGLUtils DESTINATION ${GUI_salomelib_LIBS})
+
+SET(COMMON_HEADERS_H
+ OpenGLUtils.h
+ OpenGLUtils_FrameBuffer.h
+)
+
+INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${GUI_salomeinclude_HEADERS})
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/UseQT4EXT.cmake)
+
+INCLUDE_DIRECTORIES(
+ ${QWT_INCLUDE_DIRS}
+ ${QT_INCLUDE_DIRS}
+ ${BOOST_INCLUDE_DIRS}
+ ${PYTHON_INCLUDE_DIRS}
+ ${KERNEL_ROOT_DIR}/include/salome
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Qtx
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SUIT
+)
+
+SET(COMMON_FLAGS "${QT_DEFINITIONS} ${QWT_DEFINITIONS} ${PYTHON_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+SET(COMMON_LIBS ${QWT_LIBS} ${QT_MT_LIBS} ${PYTHON_LIBS} suit)
+
+SET(GUI_HEADERS
+ Plot2d_FitDataDlg.h
+ Plot2d_SetupViewDlg.h
+ Plot2d_ViewFrame.h
+ Plot2d_ViewManager.h
+ Plot2d_ViewModel.h
+ Plot2d_ViewWindow.h
+ Plot2d_SetupCurveDlg.h
+ Plot2d_Algorithm.h
+ Plot2d_NormalizeAlgorithm.h
+ Plot2d_SetupCurveScaleDlg.h
+ Plot2d_ToolTip.h
+)
+
+SET(Plot2d_SOURCES
+ Plot2d.cxx
+ Plot2d_PlotItems.cxx
+ Plot2d_Object.cxx
+ Plot2d_Curve.cxx
+ Plot2d_Histogram.cxx
+ Plot2d_FitDataDlg.cxx
+ Plot2d_Prs.cxx
+ Plot2d_SetupViewDlg.cxx
+ Plot2d_ViewFrame.cxx
+ Plot2d_ViewManager.cxx
+ Plot2d_ViewModel.cxx
+ Plot2d_ViewWindow.cxx
+ Plot2d_Algorithm.cxx
+ Plot2d_NormalizeAlgorithm.cxx
+ Plot2d_SetupCurveDlg.cxx
+ Plot2d_SetupCurveScaleDlg.cxx
+ Plot2d_ToolTip.cxx
+)
+
+SET(GUITS_SOURCES
+ resources/Plot2d_images.ts
+ resources/Plot2d_msg_en.ts
+ resources/Plot2d_msg_fr.ts
+)
+
+# header files
+SET(COMMON_HEADERS_H
+ Plot2d.h
+ Plot2d_PlotItems.h
+ Plot2d_Object.h
+ Plot2d_Curve.h
+ Plot2d_Histogram.h
+ Plot2d_FitDataDlg.h
+ Plot2d_Prs.h
+ Plot2d_SetupViewDlg.h
+ Plot2d_ViewFrame.h
+ Plot2d_ViewManager.h
+ Plot2d_ViewModel.h
+ Plot2d_ViewWindow.h
+ Plot2d_Algorithm.h
+ Plot2d_NormalizeAlgorithm.h
+ Plot2d_SetupCurveDlg.h
+ Plot2d_ToolTip.h
+ Plot2d_SetupCurveScaleDlg.h
+)
+
+IF(ENABLE_PYCONSOLE)
+ SET(COMMON_HEADERS_H
+ ${COMMON_HEADERS_H}
+ Plot2d_AnalyticalCurve.h
+ Plot2d_AnalyticalCurveDlg.h
+ Plot2d_AnalyticalParser.h
+ )
+ SET(Plot2d_SOURCES
+ ${Plot2d_SOURCES}
+ Plot2d_AnalyticalCurve.cxx
+ Plot2d_AnalyticalCurveDlg.cxx
+ Plot2d_AnalyticalParser.cxx
+ )
+ SET(GUI_HEADERS
+ ${GUI_HEADERS}
+ Plot2d_AnalyticalCurveDlg.h
+ )
+ENDIF(ENABLE_PYCONSOLE)
+
+QT4_WRAP_CPP(GUI_HEADERS_MOC ${GUI_HEADERS})
+
+ADD_LIBRARY(Plot2d SHARED ${Plot2d_SOURCES} ${GUI_HEADERS_MOC})
+SET_TARGET_PROPERTIES(Plot2d PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}")
+TARGET_LINK_LIBRARIES(Plot2d ${COMMON_LIBS})
+INSTALL(TARGETS Plot2d DESTINATION ${GUI_salomelib_LIBS})
+
+INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${GUI_salomeinclude_HEADERS})
+QT4_INSTALL_TS_RESOURCES("${GUITS_SOURCES}" "${GUI_salomeres_DATA}")
+
+FILE(GLOB GUIPNG_DATA "${CMAKE_CURRENT_SOURCE_DIR}/resources/*.png")
+INSTALL(FILES ${GUIPNG_DATA} DESTINATION ${GUI_salomeres_DATA})
#include <QXmlStreamReader>
#include <qwt_math.h>
+#include <qwt_plot_layout.h>
#include <qwt_plot_canvas.h>
#include <qwt_scale_div.h>
#include <qwt_plot_marker.h>
#include <qwt_curve_fitter.h>
#include <stdlib.h>
+#include <limits>
#include <qprinter.h>
#include <qwt_legend.h>
"................................",
"................................",
"................................"};
+
+#ifdef WIN32
+ #ifdef max
+ #undef max
+ #endif
+
+ #ifdef min
+ #undef min
+ #endif
+#endif
/*!
Constructor
myLNormAlgo = new Plot2d_NormalizeAlgorithm(this);
/* Plot 2d View */
QVBoxLayout* aLayout = new QVBoxLayout( this );
+ aLayout->setMargin(0);
myPlot = new Plot2d_Plot2d( this );
new Plot2d_ToolTip( this );
Plot2d_QwtPlotPicker *picker = myPlot->getPicker();
// Clear points markers list and associations (marker,tooltip)
- picker->pMarkers.clear(); // QList<QwtPlotMarker*>
- picker->pMarkersToolTip.clear(); // QMap<QwtPlotMarker*, QwtText>
+ if ( picker ) {
+ picker->pMarkers.clear(); // QList<QwtPlotMarker*>
+ picker->pMarkersToolTip.clear(); // QMap<QwtPlotMarker*, QwtText>
+ }
// 3)- Erase all QwtPlotCurve associated with the Plot2d_Curve
return info;
}
-/*!
- * Create markers and tooltips associated with curve points
- */
-void Plot2d_ViewFrame::createCurveTooltips( Plot2d_Curve *curve,
- Plot2d_QwtPlotPicker *picker)
-{
- // Dans Plot2d.h : pointList == QList<Plot2d_Point>
- double x, y;
- QString tooltip;
-
- pointList points = curve->getPointList();
- QColor color = curve->getColor();
-
- // Point marker
- QwtSymbol symbol;
- symbol.setStyle(QwtSymbol::Ellipse);
- symbol.setSize(1,1);
- symbol.setPen( QPen(color));
- symbol.setBrush( QBrush(color));
-
- for (int ip=0; ip < points.count(); ip++)
- {
- x = points[ip].x;
- y = points[ip].y;
- tooltip = points[ip].text;
-
- QwtPlotMarker *marker = myPlot->createMarkerAndTooltip( symbol,
- x,
- y,
- tooltip,
- picker);
- // To deallocate in EraseAll()
- myMarkerList.append( marker);
- }
-}
-
-
/*!
* Display curves of the list of lists by systems and components
* - the first level list contains NbSytems lists of second level
*
* Draw points markers and create associated tooltips.
* Draw connection segments (intermittent line) between all the curves of a component.
+ * \return the list of underlying plot curve that defines the complex cuve at once. In case of success the vector is at least of size 1. The first one is the curve used by the legend.
*/
-void Plot2d_ViewFrame::displayPlot2dCurveList( QList< QList<Plot2d_Curve*> > sysCoCurveList,
- Plot2d_QwtPlotPicker* picker,
- bool displayLegend)
+QVector< QVector<QwtPlotCurve *> > Plot2d_ViewFrame::displayPlot2dCurveList( const QList< QList<Plot2d_Curve*> >& sysCoCurveList,
+ bool displayLegend,
+ const QList< QList<bool> >& sides)
{
//std::cout << "Plot2d_ViewFrame::displayPlot2dCurveList() 1" << std::endl;
int nbComponent = (sysCoCurveList.at(0)).size();
// Total number of curves
- //int nbAllCurve = nbSystem*nbComponent;
-
- //std::cout << " Number of systems = " << nbSystem << std::endl;
- //std::cout << " Number of components = " << nbComponent << std::endl;
- //std::cout << " Number total of courbes = " << nbAllCurve << std::endl;
// 1)- Construction of a list by component and by system
// | syst1 syst2 ... systN | syst1 syst2 ... systN | ..... | syst1 syst2 ... systN |
QList<Plot2d_Curve*> plot2dCurveCoSysList;
-
- //std::cout << " Liste par composant et par systeme :" << std::endl;
-
+ QList<bool> sidesList;
for (int icom = 0; icom < nbComponent; icom++)
{
for (int isys = 0; isys < nbSystem; isys++)
{
- //std::cout << " icom= " << icom << " idev= " << isys << std::endl;
-
// The system curves list
- QList<Plot2d_Curve*> sysCurveList = sysCoCurveList.at(isys);
-
- Plot2d_Curve *curve = sysCurveList.at(icom);
-
- plot2dCurveCoSysList.append( curve);
+ const QList<Plot2d_Curve*>& sysCurveList=sysCoCurveList.at(isys);
+ plot2dCurveCoSysList.append(sysCurveList.at(icom));
+ //
+ const QList<bool>& sysSideList=sides.at(isys);
+ sidesList.append(sysSideList.at(icom));
}
}
-
// 2)- Display list curves by a component's curves group
// Draw connection segments (intermittent line) between the curves
-
- displayPlot2dCurveList( plot2dCurveCoSysList, nbSystem, picker, displayLegend);
-
+ QVector< QVector<QwtPlotCurve *> > ret=displayPlot2dCurveList( plot2dCurveCoSysList, nbSystem, displayLegend, sidesList);
// 3)- Size of graduations labels and texts under X axis
-
QwtScaleWidget *wid = myPlot->axisWidget( QwtPlot::xBottom);
- wid->setTitle( " "); // indispensable pour que les noms des systemes apparaissent
- // sous l'axe des X !!
-
+ wid->setTitle(" "); // to make the names readable under X axis.
QFont xFont = myPlot->axisFont(QwtPlot::xBottom);
xFont.setPointSize(8);
- myPlot->setAxisFont( QwtPlot::xBottom, xFont);
-
- //std::cout << "Ok for Plot2d_ViewFrame::displayPlot2dCurveList() 1" << std::endl;
+ myPlot->setAxisFont(QwtPlot::xBottom, xFont);
+ return ret;
}
*
* Draw points markers and create associated tooltips
* Draw connection segments (intermittent line) between the curves
+ * \param [in] sides sorted as in \b curveList. If true->right if false->left
+ * \return the list of underlying plot curve that defines the complex cuve at once. In case of success the vector is at least of size 1. The first one is the curve used by the legend.
*/
-void Plot2d_ViewFrame::displayPlot2dCurveList( QList<Plot2d_Curve*> curveList,
- int groupSize,
- Plot2d_QwtPlotPicker* picker,
- bool displayLegend)
+QVector< QVector<QwtPlotCurve *> > Plot2d_ViewFrame::displayPlot2dCurveList( const QList<Plot2d_Curve*>& curveList,
+ int groupSize,
+ bool displayLegend, const QList< bool >& sides)
{
- //std::cout << "Plot2d_ViewFrame::displayPlot2dCurveList() 2" << std::endl;
-
// Consider the new legend's entries
// (PB: to update the legend we must remove it and put a new QwtLegend in the QwtPlot)
myPlot->insertLegend( (QwtLegend*)NULL); // we remove here, we shall put at the end
int nbAllCurves = curveList.size();
int nbGroups = nbAllCurves / groupSize;
+ QVector< QVector<QwtPlotCurve *> > vectCurve(nbGroups);
int ig, icur;
int icur1, icur2; // curves indices in a group
- //std::cout << " " << nbGroups << " groupes a " << groupSize << " courbes" << std::endl;
// I)- Compute X range and Y range for all the curves' points of all groups
// In the graphic view, set the Y range 's bounds for all groups of curves
// For all groups of curves
- double XallGroupMin, XallGroupMax;
- double YallGroupMin, YallGroupMax;
- bool isFirstGroup = true;
-
+ double XallGroupMin=std::numeric_limits<double>::max(), XallGroupMax=-std::numeric_limits<double>::max();
+ double YRightallGroupMin=std::numeric_limits<double>::max(), YRightallGroupMax=-std::numeric_limits<double>::max();
+ double YLeftallGroupMin=std::numeric_limits<double>::max(), YLeftallGroupMax=-std::numeric_limits<double>::max();
icur1 = 0;
for (ig=0; ig < nbGroups; ig++) //*1*
{
int nbPoints;
// Compute X range and Y range for all the curves' points in the group
-
+ bool side=false;
for (icur=icur1; icur <= icur2; icur++) //*2*
{
Plot2d_Curve *plot2dCurve = curveList.at(icur);
-
+ side=sides.at(icur);
// Curve points
nbPoints = plot2dCurve->getData( &Xval, &Yval); // dynamic allocation
delete [] Xval;
delete [] Yval;
- //std::cout << " Pour la courbe d'indice " << icur << " :" << std::endl;
- //std::cout << " Xmin= " << XcurveMin << " Xmax= " << XcurveMax << std::endl;
- //std::cout << " Ymin= " << YcurveMin << " Ymax= " << YcurveMax << std::endl;
-
if (icur == icur1) // first curve
{
XgroupMin = XcurveMin; XgroupMax = XcurveMax;
}
} //*2*
- //std::cout << " Pour les courbes du groupe d'indice " << ig << " :" << std::endl;
- //std::cout << " Xmin= " << XgroupMin << " Xmax= " << XgroupMax << std::endl;
- //std::cout << " Ymin= " << YgroupMin << " Ymax= " << YgroupMax << std::endl;
-
- if (isFirstGroup)
- {
- XallGroupMin = XgroupMin; XallGroupMax = XgroupMax;
- YallGroupMin = YgroupMin; YallGroupMax = YgroupMax;
- isFirstGroup = false;
- }
+ if (XgroupMin < XallGroupMin) XallGroupMin = XgroupMin;
+ if (XgroupMax > XallGroupMax) XallGroupMax = XgroupMax;
+ if(side)
+ {
+ if (YgroupMin < YRightallGroupMin) YRightallGroupMin = YgroupMin;
+ if (YgroupMax > YRightallGroupMax) YRightallGroupMax = YgroupMax;
+ }
else
- {
- if (XgroupMin < XallGroupMin) XallGroupMin = XgroupMin;
- if (XgroupMax > XallGroupMax) XallGroupMax = XgroupMax;
- if (YgroupMin < YallGroupMin) YallGroupMin = YgroupMin;
- if (YgroupMax > YallGroupMax) YallGroupMax = YgroupMax;
- }
-
+ {
+ if (YgroupMin < YLeftallGroupMin) YLeftallGroupMin = YgroupMin;
+ if (YgroupMax > YLeftallGroupMax) YLeftallGroupMax = YgroupMax;
+ }
// First curve of the following group
icur1 = icur2 + 1;
} //*1*
-
- //std::cout << " Pour tous les groupes de courbes :" << std::endl;
- //std::cout << " Xmin= " << XallGroupMin << " Xmax= " << XallGroupMax << std::endl;
- //std::cout << " Ymin= " << YallGroupMin << " Ymax= " << YallGroupMax << std::endl;
-
- double deltaY = YallGroupMax - YallGroupMin;
-
// Set the XY range 's bounds for all groups of curves
-//myPlot->setAxisScale( QwtPlot::xBottom, XallGroupMin, XallGroupMax);
- myPlot->setAxisScale( QwtPlot::yLeft, YallGroupMin - 0.05*deltaY, YallGroupMax + 0.05*deltaY);
-
+ if(YRightallGroupMin!=std::numeric_limits<double>::max())
+ {
+ double deltaY = YRightallGroupMax - YRightallGroupMin;
+ YRightallGroupMin-=0.05*deltaY; YRightallGroupMax+= 0.05*deltaY;
+ myPlot->setAxisScale( QwtPlot::yRight, YRightallGroupMin,YRightallGroupMax);
+ }
+ if(YLeftallGroupMin!=std::numeric_limits<double>::max())
+ {
+ double deltaY = YLeftallGroupMax - YLeftallGroupMin;
+ YLeftallGroupMin-=0.05*deltaY; YLeftallGroupMax+= 0.05*deltaY;
+ myPlot->setAxisScale( QwtPlot::yLeft, YLeftallGroupMin, YLeftallGroupMax);
+ }
// II)- Drawing curves, points markers and connection segments
icur1 = 0;
for (ig=0; ig < nbGroups; ig++)
{
- icur2 = icur1 + groupSize -1;
-
- //std::cout << " Indices des courbes du groupe " << ig << " : " << icur1
- // << " a " << icur2 << std::endl;
- int nbCurves = icur2 - icur1 + 1;
- //std::cout << " groupe a " << nbCurves << " courbes" << std::endl;
-
// 1)- Graphical attributs of group's curves
// Graphical attributes of the first group's curve
Plot2d::LineType linetype1 = plot2dCurve1->getLine();
int lineWidth1 = plot2dCurve1->getLineWidth();
QwtSymbol::Style symbolStyle1 = plot2dCurve1->getMarkerStyle();
-
- if (nbCurves > 1)
- {
- // We attribute to the current group's curve, the color, the line's kind
- // and the marker's kind of the first group's curve
-
- for (icur=icur1 +1; icur <= icur2; icur++)
- {
- Plot2d_Curve *plot2dCurve = curveList.at(icur);
- //
- plot2dCurve->setColor( color1);
- plot2dCurve->setLine( linetype1, lineWidth1);
- plot2dCurve->setMarkerStyle( symbolStyle1);
- }
- }
+ // We attribute to the current group's curve, the color, the line's kind
+ // and the marker's kind of the first group's curve
+
+ for (icur=icur1+1; icur<icur1+groupSize; icur++)
+ {
+ Plot2d_Curve *plot2dCurve = curveList.at(icur);
+ //
+ plot2dCurve->setColor(color1);
+ plot2dCurve->setLine(linetype1,lineWidth1);
+ plot2dCurve->setMarkerStyle(symbolStyle1);
+ }
// 2)- Display the group's curves
- for (icur=icur1; icur <= icur2; icur++)
+ for (icur=icur1; icur<icur1+groupSize; icur++)
{
Plot2d_Curve *plot2dCurve = curveList.at(icur);
QString title = plot2dCurve->getVerTitle();
std::string std_title = title.toStdString();
- //const char *c_title = std_title.c_str();
- //std::cout << " courbe d'indice " << icur << " : |" << c_title << "|" << std::endl;
-
// Create the graphic curve (QwtPlotCurve) et display it in the drawing zone
// (Qwtplot)
- displayCurve( plot2dCurve);
-
- // Draw the points' markers and create the associated tooltips
- createCurveTooltips( plot2dCurve, picker);
+ displayCurve(plot2dCurve);
// Get the graphic curve
- QwtPlotCurve* plotCurve = dynamic_cast<QwtPlotCurve *>( getPlotObject( plot2dCurve));
-
+ QwtPlotCurve* plotCurve = dynamic_cast<QwtPlotCurve *>(getPlotObject(plot2dCurve));
+ vectCurve[ig].push_back(plotCurve);
// Modify the points' markers
- QwtSymbol symbol (plotCurve->symbol()) ;
- symbol.setStyle( symbolStyle1);
- symbol.setPen( QPen( color1, lineWidth1));
- symbol.setBrush( QBrush( color1));
- QSize size = 0.5*(symbol.size());
- symbol.setSize(size);
+ QwtSymbol symbol(plotCurve->symbol()) ;
+ symbol.setStyle(symbolStyle1);
+ symbol.setPen(QPen(color1,lineWidth1));
+ //symbol.setBrush( QBrush( color1));
+ //QSize size = 0.5*(symbol.size());
+ //symbol.setSize(size);
//
- plotCurve->setPen( QPen( color1, lineWidth1));
- plotCurve->setSymbol( symbol);
+ plotCurve->setPen(QPen(color1,lineWidth1));
+ plotCurve->setSymbol(symbol);
if (icur > icur1)
{
// 3)- Intermittent segments to connect all the group's curves
- if (nbCurves > 1)
+ if (groupSize > 1)
{
double *Xval;
double *Yval;
int nbPoints;
double Xseg[2], Yseg[2];
Plot2d_Curve *plot2dCurve1 = curveList.at(icur1);
-
+ bool side = sides.at(icur1);
// Last point of the first curve
nbPoints = plot2dCurve1->getData( &Xval, &Yval); // dynamic allocation
Xseg[0] = Xval[ nbPoints -1];
delete [] Xval;
delete [] Yval;
- for (icur=icur1 +1; icur <= icur2; icur++)
+ for (icur=icur1+1; icur<icur1+groupSize; icur++)
{
Plot2d_Curve *plot2dCurve = curveList.at(icur);
Xseg[1] = Xval[0];
Yseg[1] = Yval[0];
- createSegment( Xseg, Yseg, 2,
- Qt::DotLine,
- lineWidth1,
- color1,
- QwtSymbol::NoSymbol);
+ vectCurve[ig].push_back(createSegment(Xseg,Yseg,2,Qt::DotLine,lineWidth1,color1,QwtSymbol::NoSymbol,side));
// Last curve's point
Xseg[0] = Xval[ nbPoints -1];
}
}
// First curve of the following group
- icur1 = icur2 + 1;
+ icur1 += groupSize;
}
if (displayLegend)
{
// Consider the new legend's entries
- showLegend( true, true); // show, update
+ if(!curveList.empty())
+ showLegend( true, true); // show, update
}
-
- //std::cout << "Ok for Plot2d_ViewFrame::displayPlot2dCurveList() 2" << std::endl;
+ return vectCurve;
}
}
displayCurve( plot2dCurve);
- // plot points marker create associated tooltips
- createCurveTooltips( plot2dCurve, picker);
-
// Get the graphical curve
QwtPlotCurve* plotCurve = dynamic_cast<QwtPlotCurve *>( getPlotObject( plot2dCurve));
/*!
* Create and display a segment with nbPoint=2 points
*/
-void Plot2d_ViewFrame::createSegment( double *X, double *Y, int nbPoint,
- Qt::PenStyle lineKind,
- int lineWidth,
- QColor & lineColor,
- QwtSymbol::Style markerKind)
+QwtPlotCurve *Plot2d_ViewFrame::createSegment( double *X, double *Y, int nbPoint,
+ Qt::PenStyle lineKind,
+ int lineWidth,
+ QColor & lineColor,
+ QwtSymbol::Style markerKind, bool side)
{
QwtPlotCurve* aPCurve = new QwtPlotCurve();
// The segment must not have legend's entry
aPCurve->setItemAttribute( QwtPlotItem::Legend, false);
- aPCurve->attach( myPlot);
+ aPCurve->attach(myPlot);
+ aPCurve->setYAxis(side ? QwtPlot::yRight : QwtPlot::yLeft);
// To deallocate in EraseAll()
- myIntermittentSegmentList.append( aPCurve);
+ myIntermittentSegmentList.append(aPCurve);
+ return aPCurve;
}
/*!
if ( hasPlotObject( object ) ) {
QwtPlotItem* anObject = getPlotObject( object );
- anObject->hide();
- anObject->detach();
- myObjects.remove( anObject );
- updateTitles();
- myPlot->updateYAxisIdentifiers();
- if ( update )
- myPlot->replot();
+ eraseBasicObject(anObject,update);
}
if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
}
+void Plot2d_ViewFrame::eraseBasicObject( QwtPlotItem *object, bool update )
+{
+ if(!object)
+ return;
+ object->hide();
+ object->detach();
+ myObjects.remove(object);
+ updateTitles();
+ myPlot->updateYAxisIdentifiers();
+ if ( update )
+ myPlot->replot();
+}
+
/*!
Erases objects
*/
if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
}
+void Plot2d_ViewFrame::eraseBasicObjects( const QList<QwtPlotItem*> &objects, bool update)
+{
+ foreach ( QwtPlotItem* object, objects )
+ eraseBasicObject( object, false );
+ // fitAll();
+ if ( update )
+ myPlot->replot();
+ if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
+}
+
/*!
Updates objects attributes
*/
*/
void Plot2d_ViewFrame::wheelEvent(QWheelEvent* event)
{
+ QwtPlotLayout* pl = myPlot->plotLayout();
+
+ // compute zooming factor
double aDelta = event->delta();
double aScale = (aDelta < 0) ? 100./(-aDelta) : aDelta/100.;
- QwtScaleMap xMap = myPlot->canvasMap( QwtPlot::xBottom );
- QwtScaleMap yMap = myPlot->canvasMap( QwtPlot::yLeft );
-
- if ( ((yMap.s2() - yMap.s1()) < 10e-13 || (xMap.s2() - xMap.s1()) < 10e-13 ) && aScale < 1 )
- return;
+ bool scaleXBottom = pl->scaleRect(QwtPlot::xBottom).contains( event->pos() ) ||
+ pl->canvasRect().contains( event->pos() );
+ bool scaleYLeft = pl->scaleRect(QwtPlot::yLeft).contains( event->pos() ) ||
+ pl->canvasRect().contains( event->pos() );
+ bool scaleYRight = mySecondY && ( pl->scaleRect(QwtPlot::yRight).contains( event->pos() ) ||
+ pl->canvasRect().contains( event->pos() ) );
+
+ // scale x bottom axis
+ if ( scaleXBottom ) {
+ QwtScaleMap xMap = myPlot->canvasMap( QwtPlot::xBottom );
+ if ( xMap.s2() - xMap.s1() > 1.0e-12 || aScale > 1 )
+ myPlot->setAxisScale( QwtPlot::xBottom, xMap.s1(), xMap.s1() + aScale*(xMap.s2() - xMap.s1()) );
+ }
+
+ // scale y left axis
+ if ( scaleYLeft ) {
+ QwtScaleMap yMap = myPlot->canvasMap( QwtPlot::yLeft );
+ if ( yMap.s2() - yMap.s1() > 1.0e-12 || aScale > 1 )
+ myPlot->setAxisScale( QwtPlot::yLeft, yMap.s1(), yMap.s1() + aScale*(yMap.s2() - yMap.s1()) );
+ }
- myPlot->setAxisScale( QwtPlot::yLeft, yMap.s1(), yMap.s1() + aScale*(yMap.s2() - yMap.s1()) );
- myPlot->setAxisScale( QwtPlot::xBottom, xMap.s1(), xMap.s1() + aScale*(xMap.s2() - xMap.s1()) );
- if (mySecondY) {
- QwtScaleMap y2Map = myPlot->canvasMap( QwtPlot::yRight );
- if ( ((y2Map.s2() - y2Map.s1()) < 10e-13 ) && aScale < 1 ) return;
- myPlot->setAxisScale( QwtPlot::yRight, y2Map.s1(), y2Map.s1() + aScale*(y2Map.s2() - y2Map.s1()) );
+ // scale y right axis (note: mySecondY value is checked above)
+ if ( scaleYRight ) {
+ QwtScaleMap yMap = myPlot->canvasMap( QwtPlot::yRight );
+ if ( yMap.s2() - yMap.s1() > 10e-12 || aScale > 1 )
+ myPlot->setAxisScale( QwtPlot::yRight, yMap.s1(), yMap.s1() + aScale*(yMap.s2() - yMap.s1()) );
}
+
+ // redraw
myPlot->replot();
+ // update zoomer
if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
+ // store current mouse position
myPnt = event->pos();
+ // update analytical curves
updateAnalyticalCurves();
}
QColor tooltipColor( 253, 245, 230); // OldLace
text.setBackgroundBrush( QBrush(tooltipColor)); //, Qt::SolidPattern));
//
- picker->pMarkers.append( aPlotMarker);
- picker->pMarkersToolTip[ aPlotMarker] = text;
+ if ( picker ) {
+ picker->pMarkers.append( aPlotMarker);
+ picker->pMarkersToolTip[ aPlotMarker] = text;
+ }
return aPlotMarker;
}
{
CurveDict aCurves = getCurves();
CurveDict::iterator it = aCurves.begin();
- QwtPlotCurve* aCurve;
+ Plot2d_Curve* pCurve = 0;
+ distance = -1.;
for ( ; it != aCurves.end(); it++ ) {
- aCurve = it.key();
+ QwtPlotCurve* aCurve = it.key();
if ( !aCurve )
continue;
- index = aCurve->closestPoint( p, &distance );
- if ( index > -1 )
- return it.value();
+ double d;
+ int i = aCurve->closestPoint( p, &d );
+ if ( index > -1 && ( distance < 0 || d < distance ) ) {
+ pCurve = it.value();
+ distance = d;
+ index = i;
+ }
}
- return 0;
+ return pCurve;
}
/*!
void setTitle( const QString& );
QString getTitle() const;
- /* addition MultiX */
- void createCurveTooltips( Plot2d_Curve *curve,
- Plot2d_QwtPlotPicker *picker);
-
- void displayPlot2dCurveList( QList< QList<Plot2d_Curve*> > sysCoCurveList,
- Plot2d_QwtPlotPicker* picker,
- bool displayLegend);
+ QVector< QVector<QwtPlotCurve *> > displayPlot2dCurveList( const QList< QList<Plot2d_Curve*> >& sysCoCurveList,
+ bool displayLegend,
+ const QList< QList<bool> >& sides);
- void displayPlot2dCurveList( QList<Plot2d_Curve*> curveList,
- int groupsize,
- Plot2d_QwtPlotPicker* picker,
- bool displayLegend);
+ QVector< QVector<QwtPlotCurve *> > displayPlot2dCurveList( const QList<Plot2d_Curve*>& curveList,
+ int groupsize,
+ bool displayLegend,
+ const QList< bool >& sides);
Plot2d_Curve* createPlot2dCurve( QString & title,
QString & unit,
QColor getPlot2dCurveColor( Plot2d_Curve* plot2dCurve);
- void createSegment( double *X, double *Y, int nbPoint,
- Qt::PenStyle lineKind,
- int lineWidth,
- QColor & lineColor,
- QwtSymbol::Style markerKind);
+ QwtPlotCurve *createSegment( double *X, double *Y, int nbPoint,
+ Qt::PenStyle lineKind,
+ int lineWidth,
+ QColor & lineColor,
+ QwtSymbol::Style markerKind,
+ bool side=false);
/* curves operations [ obsolete ] */
void displayCurve( Plot2d_Curve*, bool = false );
void displayObjects( const objectList&, bool = false );
void eraseObject( Plot2d_Object*, bool = false );
void eraseObjects( const objectList&, bool = false );
+ void eraseBasicObject( QwtPlotItem*, bool = false );
+ void eraseBasicObjects( const QList<QwtPlotItem*> &, bool = false );
int getObjects( objectList& ) const;
bool isVisible( Plot2d_Object* ) const;
void updateObject( Plot2d_Object*, bool = false );
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+ADD_LIBRARY(SalomePrs SHARED SALOME_Prs.cxx)
+SET_TARGET_PROPERTIES(SalomePrs PROPERTIES COMPILE_FLAGS "${PLATFORM_DEFINITIONS}")
+INSTALL(TARGETS SalomePrs DESTINATION ${GUI_salomelib_LIBS})
+
+INSTALL(FILES SALOME_Prs.h DESTINATION ${GUI_salomeinclude_HEADERS})
+
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/UseQT4EXT.cmake)
+
+INCLUDE_DIRECTORIES(
+ ${QT_INCLUDE_DIRS}
+ ${PTHREAD_INCLUDE_DIRS}
+ ${PYTHON_INCLUDE_DIRS}
+ ${KERNEL_ROOT_DIR}/include/salome
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Qtx
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SUIT
+ ${CMAKE_CURRENT_SOURCE_DIR}/../PyInterp
+)
+
+SET(COMMON_FLAGS "${QT_DEFINITIONS} ${PYTHON_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+SET(COMMON_LIBS ${PYTHON_LIBS} ${QT_LIBS} ${SALOMELocalTrace} qtx suit PyInterp)
+
+SET(GUI_HEADERS
+ PyConsole_Editor.h
+ PyConsole_Console.h
+)
+QT4_WRAP_CPP(GUI_HEADERS_MOC ${GUI_HEADERS})
+
+SET(PyConsole_SOURCES
+ PyConsole_Console.cxx
+ PyConsole_Editor.cxx
+ PyConsole_Interp.cxx
+)
+
+SET(GUITS_SOURCES
+ resources/PyConsole_msg_en.ts
+ resources/PyConsole_msg_fr.ts
+)
+
+ADD_LIBRARY(PyConsole SHARED ${PyConsole_SOURCES} ${GUI_HEADERS_MOC})
+SET_TARGET_PROPERTIES(PyConsole PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}")
+TARGET_LINK_LIBRARIES(PyConsole ${COMMON_LIBS})
+INSTALL(TARGETS PyConsole DESTINATION ${GUI_salomelib_LIBS})
+
+SET(COMMON_HEADERS_H
+ PyConsole.h
+ PyConsole_Console.h
+ PyConsole_Editor.h
+ PyConsole_Interp.h
+)
+INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${GUI_salomeinclude_HEADERS})
+QT4_INSTALL_TS_RESOURCES("${GUITS_SOURCES}" "${GUI_salomeres_DATA}")
+
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/UseQT4EXT.cmake)
+
+INCLUDE_DIRECTORIES(
+ ${QT_INCLUDE_DIRS}
+ ${PYTHON_INCLUDE_DIRS}
+ ${KERNEL_ROOT_DIR}/include/salome
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Event
+)
+
+SET(COMMON_FLAGS "${QT_DEFINITIONS} ${PYTHON_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+SET(COMMON_LIBS ${PYTHON_LIBS} ${QT_LIBS} Event)
+
+SET(GUI_HEADERS PyInterp_Watcher.h)
+QT4_WRAP_CPP(GUI_HEADERS_MOC ${GUI_HEADERS})
+
+SET(PyInterp_SOURCES
+ PyInterp_Interp.cxx
+ PyInterp_Dispatcher.cxx
+)
+
+ADD_LIBRARY(PyInterp SHARED ${PyInterp_SOURCES} ${GUI_HEADERS_MOC})
+SET_TARGET_PROPERTIES(PyInterp PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}")
+TARGET_LINK_LIBRARIES(PyInterp ${COMMON_LIBS})
+INSTALL(TARGETS PyInterp DESTINATION ${GUI_salomelib_LIBS})
+
+SET(COMMON_HEADERS_H
+ PyInterp.h
+ PyInterp_Interp.h
+ PyInterp_Dispatcher.h
+)
+INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${GUI_salomeinclude_HEADERS})
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/UseQT4EXT.cmake)
+
+INCLUDE_DIRECTORIES(
+ ${CAS_INCLUDE_DIRS}
+ ${PTHREAD_INCLUDE_DIRS}
+ ${QT_INCLUDE_DIRS}
+ ${KERNEL_ROOT_DIR}/include/salome
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Qtx
+ ${CMAKE_CURRENT_SOURCE_DIR}/../DDS
+)
+
+SET(COMMON_FLAGS "${QT_DEFINITIONS} ${CAS_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+SET(COMMON_LIBS ${QT_MT_LIBS} ${CAS_KERNEL} DDS qtx)
+
+SET(GUI_HEADERS
+ QDS_CheckBox.h
+ QDS_ComboBox.h
+ QDS_Datum.h
+ QDS_LineEdit.h
+ QDS_SpinBox.h
+ QDS_SpinBoxDbl.h
+ QDS_TextEdit.h
+ QDS_RadioBox.h
+)
+QT4_WRAP_CPP(GUI_HEADERS_MOC ${GUI_HEADERS})
+
+SET(QDS_SOURCES
+ QDS.cxx
+ QDS_CheckBox.cxx
+ QDS_ComboBox.cxx
+ QDS_Datum.cxx
+ QDS_LineEdit.cxx
+ QDS_SpinBox.cxx
+ QDS_SpinBoxDbl.cxx
+ QDS_TextEdit.cxx
+ QDS_Validator.cxx
+ QDS_RadioBox.cxx
+)
+
+SET(GUITS_SOURCES
+ resources/QDS_msg_en.ts
+ resources/QDS_msg_fr.ts
+)
+
+ADD_LIBRARY(QDS SHARED ${QDS_SOURCES} ${GUI_HEADERS_MOC})
+SET_TARGET_PROPERTIES(QDS PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}")
+TARGET_LINK_LIBRARIES(QDS ${COMMON_LIBS})
+INSTALL(TARGETS QDS DESTINATION ${GUI_salomelib_LIBS})
+
+SET(COMMON_HEADERS_H
+ QDS.h
+ QDS_CheckBox.h
+ QDS_ComboBox.h
+ QDS_Datum.h
+ QDS_LineEdit.h
+ QDS_SpinBox.h
+ QDS_SpinBoxDbl.h
+ QDS_TextEdit.h
+ QDS_Validator.h
+ QDS_RadioBox.h
+)
+
+INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${GUI_salomeinclude_HEADERS})
+QT4_INSTALL_TS_RESOURCES("${GUITS_SOURCES}" "${GUI_salomeres_DATA}")
+
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/UseQT4EXT.cmake)
+
+INCLUDE_DIRECTORIES(
+ ${QT_INCLUDE_DIRS}
+)
+
+SET(GUI_HEADERS
+ QtxAction.h
+ QtxActionGroup.h
+ QtxActionMenuMgr.h
+ QtxActionMgr.h
+ QtxActionSet.h
+ QtxActionToolMgr.h
+ QtxBackgroundTool.h
+ QtxBiColorTool.h
+ QtxColorButton.h
+ QtxColorScale.h
+ QtxComboBox.h
+ QtxDialog.h
+ QtxDockAction.h
+ QtxDockWidget.h
+ QtxDoubleSpinBox.h
+ QtxFontEdit.h
+ QtxGridBox.h
+ QtxGroupBox.h
+ QtxIntSpinBox.h
+ QtxListAction.h
+ QtxTreeView.h
+ QtxLogoMgr.h
+ QtxMainWindow.h
+ QtxMenu.h
+ QtxMultiAction.h
+ QtxMRUAction.h
+ QtxPagePrefMgr.h
+ QtxPathDialog.h
+ QtxPathEdit.h
+ QtxPathListEdit.h
+ QtxPopupMgr.h
+ QtxRubberBand.h
+ QtxSearchTool.h
+ QtxShortcutEdit.h
+ QtxSplash.h
+ QtxToolBar.h
+ QtxToolTip.h
+ QtxValidator.h
+ QtxWorkspace.h
+ QtxWorkspaceAction.h
+ QtxWorkstack.h
+ QtxWorkstackAction.h
+ QtxWebBrowser.h
+)
+QT4_WRAP_CPP(GUI_HEADERS_MOC ${GUI_HEADERS})
+
+SET(qtx_SOURCES
+ Qtx.cxx
+ QtxAction.cxx
+ QtxActionGroup.cxx
+ QtxActionMenuMgr.cxx
+ QtxActionMgr.cxx
+ QtxActionSet.cxx
+ QtxActionToolMgr.cxx
+ QtxBackgroundTool.cxx
+ QtxBiColorTool.cxx
+ QtxColorButton.cxx
+ QtxColorScale.cxx
+ QtxComboBox.cxx
+ QtxDialog.cxx
+ QtxDockAction.cxx
+ QtxDockWidget.cxx
+ QtxDoubleSpinBox.cxx
+ QtxEvalExpr.cxx
+ QtxFontEdit.cxx
+ QtxGridBox.cxx
+ QtxGroupBox.cxx
+ QtxIntSpinBox.cxx
+ QtxListAction.cxx
+ QtxTreeView.cxx
+ QtxLogoMgr.cxx
+ QtxMainWindow.cxx
+ QtxMenu.cxx
+ QtxMultiAction.cxx
+ QtxMRUAction.cxx
+ QtxPagePrefMgr.cxx
+ QtxPathDialog.cxx
+ QtxPathEdit.cxx
+ QtxPathListEdit.cxx
+ QtxPopupMgr.cxx
+ QtxPreferenceMgr.cxx
+ QtxResourceMgr.cxx
+ QtxRubberBand.cxx
+ QtxSearchTool.cxx
+ QtxShortcutEdit.cxx
+ QtxSplash.cxx
+ QtxToolBar.cxx
+ QtxToolTip.cxx
+ QtxTranslator.cxx
+ QtxValidator.cxx
+ QtxWorkspace.cxx
+ QtxWorkspaceAction.cxx
+ QtxWorkstack.cxx
+ QtxWorkstackAction.cxx
+ QtxWebBrowser.cxx
+)
+SET(GUITS_SOURCES
+ resources/Qtx_msg_fr.ts
+)
+
+ADD_LIBRARY(qtx SHARED ${qtx_SOURCES} ${GUI_HEADERS_MOC})
+SET_TARGET_PROPERTIES(qtx PROPERTIES COMPILE_FLAGS "${QT_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+TARGET_LINK_LIBRARIES(qtx ${QT_MT_LIBS} ${OGL_LIBS})
+INSTALL(TARGETS qtx DESTINATION ${GUI_salomelib_LIBS})
+
+SET(COMMON_HEADERS_H
+ Qtx.h
+ QtxAction.h
+ QtxActionGroup.h
+ QtxActionMenuMgr.h
+ QtxActionMgr.h
+ QtxActionSet.h
+ QtxActionToolMgr.h
+ QtxBackgroundTool.h
+ QtxBiColorTool.h
+ QtxColorButton.h
+ QtxColorScale.h
+ QtxComboBox.h
+ QtxDialog.h
+ QtxDockAction.h
+ QtxDockWidget.h
+ QtxDoubleSpinBox.h
+ QtxEvalExpr.h
+ QtxFontEdit.h
+ QtxGridBox.h
+ QtxGroupBox.h
+ QtxIntSpinBox.h
+ QtxListAction.h
+ QtxTreeView.h
+ QtxLogoMgr.h
+ QtxMainWindow.h
+ QtxMap.h
+ QtxMenu.h
+ QtxMultiAction.h
+ QtxMRUAction.h
+ QtxPagePrefMgr.h
+ QtxPathDialog.h
+ QtxPathEdit.h
+ QtxPathListEdit.h
+ QtxPopupMgr.h
+ QtxPreferenceMgr.h
+ QtxResourceMgr.h
+ QtxRubberBand.h
+ QtxSearchTool.h
+ QtxShortcutEdit.h
+ QtxSplash.h
+ QtxToolBar.h
+ QtxToolTip.h
+ QtxTranslator.h
+ QtxValidator.h
+ QtxWorkspace.h
+ QtxWorkspaceAction.h
+ QtxWorkstack.h
+ QtxWorkstackAction.h
+ QtxWebBrowser.h
+)
+INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${GUI_salomeinclude_HEADERS})
+QT4_INSTALL_TS_RESOURCES("${GUITS_SOURCES}" "${GUI_salomeres_DATA}")
if ( withExt )
return QFileInfo( fPath ).fileName();
else
- return QFileInfo( fPath ).baseName();
+ return QFileInfo( fPath ).completeBaseName();
}
/*!
#include <QPainter>
#include <QSlider>
#include <QStyle>
+#include <QStylePainter>
+#include <QStyleOptionButton>
const int BICOLOR_MAX_DELTA = 100;
public:
ColorLabel( QWidget* parent) : QFrame( parent )
{
- setFrameStyle( QFrame::Box | QFrame::Plain );
- setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ setFrameStyle( QFrame::Panel | QFrame::Raised );
+ //setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
}
~ColorLabel() {}
QSize sizeHint() const
}
QSize minimumSizeHint() const
{
- int pm = style()->pixelMetric(QStyle::PM_ButtonMargin);
- QFontMetrics fm ( font() );
- return QSize( fm.height() + pm, fm.height() + pm );
+ if ( !mySizeHint.isValid() ) {
+ int is = style()->pixelMetric( QStyle::PM_ButtonIconSize, 0, this );
+ int pm = style()->pixelMetric( QStyle::PM_ButtonMargin );
+ ColorLabel* that = const_cast<ColorLabel*>( this );
+ that->mySizeHint = QSize( is + pm, is + pm );
+ }
+ return mySizeHint;
}
void paintEvent( QPaintEvent* e )
{
- QPainter p( this );
- drawFrame( &p );
- QRect r = contentsRect();
+ QStylePainter sp(this);
+ QStyleOptionButton option;
+ option.initFrom(this);
+ option.features = QStyleOptionButton::None;
+ option.state |= QStyle::State_Raised;
+ sp.drawControl( QStyle::CE_PushButton, option );
+
+ QRect r = rect();
+ r.setTopLeft( r.topLeft() + QPoint( 2, 2 ) );
+ r.setBottomRight( r.bottomRight() - QPoint( 2, 2 ) );
+
+ QPixmap pix( r.size() );
+ pix.fill( palette().color( backgroundRole() ) );
+
if ( myColor.isValid() ) {
- p.fillRect( r, QBrush( myColor ) );
+ QPainter pixp( &pix );
+ pixp.setPen( isEnabled() ? Qt::black : palette().mid().color() );
+ pixp.fillRect( 1, 1, pix.width()-3, pix.height()- 3, QBrush( isEnabled() ? myColor : palette().mid().color() ) );
+ pixp.drawRect( 1, 1, pix.width()-3, pix.height()- 3 );
+ pixp.end();
}
else {
- p.fillRect( r, QBrush( palette().color( foregroundRole() ), Qt::BDiagPattern ) );
+ QPainter pixp( &pix );
+ pixp.setPen( palette().color( isEnabled() ? QPalette::WindowText : QPalette::Mid ) );
+ pixp.drawRect( 2, 2, pix.width() - 4, pix.height() - 4 );
+ pixp.fillRect( 3, 3, pix.width() - 6, pix.height() - 6,
+ QBrush( palette().color( isEnabled() ? QPalette::WindowText : QPalette::Mid ), Qt::BDiagPattern ) );
+ pixp.end();
}
+
+ QPainter p( this );
+ p.drawPixmap( r, pix );
p.end();
}
void setColor( const QColor& c )
}
private:
+ QSize mySizeHint;
QColor myColor;
};
l->setSpacing( 5 );
myMainColor = new QtxColorButton( this );
- myMainColor->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ //myMainColor->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
myExtraText = new QLabel( this );
myRuler = new QSlider( Qt::Horizontal, this );
myRuler->setMinimum( -BICOLOR_MAX_DELTA );
l->addWidget( myExtraText );
l->addWidget( myRuler );
l->addWidget( myDelta );
+ myRuler->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
connect( myMainColor, SIGNAL( changed( QColor ) ), this, SLOT( updateState() ) );
connect( myRuler, SIGNAL( valueChanged( int ) ), this, SLOT( updateState() ) );
myExtraText->setText( txt );
}
+/*!
+ \brief Get access to the internal label use for drawing
+ auxiliary test assigned to the widget
+*/
+QLabel* QtxBiColorTool::label()
+{
+ return myExtraText;
+}
+
/*!
\brief Update widget state
*/
QString text() const;
void setText( const QString& );
+ QLabel* label();
+
private slots:
void updateState();
#include <QDateTimeEdit>
#include <QStackedWidget>
#include <QSlider>
+#include <QScrollArea>
#include <stdio.h>
\param param resource file parameter associated with the preference item
*/
QtxPagePrefFrameItem::QtxPagePrefFrameItem( const QString& title, QtxPreferenceItem* parent,
- const QString& sect, const QString& param )
+ const QString& sect, const QString& param, const bool scrollable )
: QtxPagePrefItem( title, parent, sect, param )
{
QWidget* main = new QWidget();
base->setSpacing( 0 );
base->addWidget( myBox = new QtxGridBox( 1, Qt::Horizontal, main, 5, 5 ) );
- base->addItem( new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding ) );
+ base->addStretch();
+
+ if ( scrollable ) {
+ QScrollArea* scroll = new QScrollArea();
+ scroll->setWidget( main );
+ scroll->setWidgetResizable( true );
+ base->layout()->setSizeConstraint(QLayout::SetMinAndMaxSize);
+ main = scroll;
+ }
setWidget( main );
}
{
public:
QtxPagePrefFrameItem( const QString&, QtxPreferenceItem* = 0,
- const QString& = QString(), const QString& = QString() );
+ const QString& = QString(), const QString& = QString(), const bool = false );
virtual ~QtxPagePrefFrameItem();
virtual void updateContents();
#ifdef WIN32
fileName = QString( "%1.%2" ).arg( appName ).arg( currentFormat() );
#else
- fileName = QString( ".%1rc" ).arg( appName );
+ fileName = QString( "%1rc" ).arg( appName );
+ // VSR 24/09/2012: issue 0021781: do not prepend filename with "."
+ // when user file is stored in ~/.config/<appname> directory
+ if ( cfgAppName.isEmpty() )
+ fileName.prepend( "." );
#endif
if ( !fileName.isEmpty() )
view->emitSortingEnabled( a->isChecked() );
if ( a->isChecked() ) {
connect( this, SIGNAL( sectionClicked( int ) ), view, SLOT( onHeaderClicked( int ) ) );
+ setSortIndicator( 0, Qt::AscendingOrder );
view->sortByColumn( sortIndicatorSection(), sortIndicatorOrder() );
}
else {
QWidget* frame = new QWidget( this );
myWebView = new QWebView( frame );
+
+ QAction *copyAction = myWebView->pageAction(QWebPage::Copy);
+ copyAction->setShortcut(QKeySequence::Copy);
+ myWebView->addAction(copyAction);
+
+
myWebView->page()->setLinkDelegationPolicy( QWebPage::DelegateAllLinks );
myFindPanel = new QtxSearchTool( frame, myWebView,
QtxSearchTool::Basic | QtxSearchTool::Case | QtxSearchTool::Wrap,
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/UseQT4EXT.cmake)
+
+INCLUDE_DIRECTORIES(
+ ${CAS_INCLUDE_DIRS}
+ ${QT_INCLUDE_DIRS}
+ ${BOOST_INCLUDE_DIRS}
+ ${PYTHON_INCLUDE_DIRS}
+ ${KERNEL_ROOT_DIR}/include/salome
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Qtx
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SUIT
+)
+
+SET(COMMON_FLAGS "${QT_DEFINITIONS} ${CAS_DEFINITIONS} ${BOOST_DEFINITIONS} ${PYTHON_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+SET(COMMON_LIBS ${QT_MT_LIBS} suit)
+
+SET(GUI_HEADERS
+ QxGraph_Canvas.h
+ QxGraph_CanvasView.h
+ QxGraph_ViewWindow.h
+ QxGraph_ViewManager.h
+ QxGraph_ViewModel.h
+)
+QT4_WRAP_CPP(GUI_HEADERS_MOC ${GUI_HEADERS})
+
+SET(QxGraph_SOURCES
+ QxGraph_Prs.cxx
+ QxGraph_Canvas.cxx
+ QxGraph_CanvasView.cxx
+ QxGraph_ViewWindow.cxx
+ QxGraph_ViewManager.cxx
+ QxGraph_ViewModel.cxx
+)
+
+SET(GUITS_SOURCES
+ resources/QxGraph_images.ts
+ resources/QxGraph_msg_en.ts
+ resources/QxGraph_msg_fr.ts
+)
+
+ADD_LIBRARY(QxGraph SHARED ${QxGraph_SOURCES} ${GUI_HEADERS_MOC})
+SET_TARGET_PROPERTIES(QxGraph PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}")
+TARGET_LINK_LIBRARIES(QxGraph ${COMMON_LIBS})
+INSTALL(TARGETS QxGraph DESTINATION ${GUI_salomelib_LIBS})
+
+SET(COMMON_HEADERS_H
+ QxGraph_ActiveItem.h
+ QxGraph_Prs.h
+ QxGraph_Canvas.h
+ QxGraph_CanvasView.h
+ QxGraph_ViewWindow.h
+ QxGraph_ViewManager.h
+ QxGraph_ViewModel.h
+ QxGraph_Def.h
+ QxGraph.h
+)
+
+INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${GUI_salomeinclude_HEADERS})
+QT4_INSTALL_TS_RESOURCES("${GUITS_SOURCES}" "${GUI_salomeres_DATA}")
+
+FILE(GLOB GUIPNG_DATA "${CMAKE_CURRENT_SOURCE_DIR}/resources/*.png")
+INSTALL(FILES ${GUIPNG_DATA} DESTINATION ${GUI_salomeres_DATA})
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/UseQT4EXT.cmake)
+
+INCLUDE_DIRECTORIES(
+ ${CAS_INCLUDE_DIRS}
+ ${QT_INCLUDE_DIRS}
+ ${BOOST_INCLUDE_DIRS}
+ ${PYTHON_INCLUDE_DIRS}
+ ${KERNEL_ROOT_DIR}/include/salome
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Qtx
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SUIT
+)
+
+SET(COMMON_FLAGS "${QT_DEFINITIONS} ${CAS_DEFINITIONS} ${BOOST_DEFINITIONS} ${PYTHON_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+SET(COMMON_LIBS ${QT_MT_LIBS} suit)
+
+SET(GUI_HEADERS
+ QxScene_ViewWindow.h
+ QxScene_ViewManager.h
+ QxScene_ViewModel.h
+)
+QT4_WRAP_CPP(GUI_HEADERS_MOC ${GUI_HEADERS})
+
+SET(QxScene_SOURCES
+ QxScene_ViewWindow.cxx
+ QxScene_ViewManager.cxx
+ QxScene_ViewModel.cxx
+)
+
+SET(GUITS_SOURCES
+ resources/QxSceneViewer_images.ts
+ resources/QxSceneViewer_msg_en.ts
+ resources/QxSceneViewer_msg_fr.ts
+)
+
+ADD_LIBRARY(QxScene SHARED ${QxScene_SOURCES} ${GUI_HEADERS_MOC})
+SET_TARGET_PROPERTIES(QxScene PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}")
+TARGET_LINK_LIBRARIES(QxScene ${COMMON_LIBS})
+INSTALL(TARGETS QxScene DESTINATION ${GUI_salomelib_LIBS})
+
+SET(COMMON_HEADERS_H
+ QxScene_ViewWindow.h
+ QxScene_ViewManager.h
+ QxScene_ViewModel.h
+ QxScene_Def.h
+ QxScene.h
+)
+
+INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${GUI_salomeinclude_HEADERS})
+QT4_INSTALL_TS_RESOURCES("${GUITS_SOURCES}" "${GUI_salomeres_DATA}")
+
+FILE(GLOB GUIPNG_DATA "${CMAKE_CURRENT_SOURCE_DIR}/resources/*.png")
+INSTALL(FILES ${GUIPNG_DATA} DESTINATION ${GUI_salomeres_DATA})
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE_DIRECTORIES(
+ ${QT_INCLUDE_DIRS}
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Qtx
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SUIT
+)
+
+SET(COMMON_FLAGS "${QT_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+
+SET(COMMON_LIBS qtx suit ${QT_LIBS})
+
+ADD_EXECUTABLE(ResourceExporter ResourceExporter.cxx)
+SET_TARGET_PROPERTIES(ResourceExporter PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}")
+TARGET_LINK_LIBRARIES(ResourceExporter SUITApp ${COMMON_LIBS})
+INSTALL(TARGETS ResourceExporter DESTINATION ${GUI_salomebin_BINS})
+
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE_DIRECTORIES(
+ ${CAS_INCLUDE_DIRS}
+ ${QT_INCLUDE_DIRS}
+ ${PYTHON_INCLUDE_DIRS}
+ ${BOOST_INCLUDE_DIRS}
+ ${VTK_INCLUDE_DIRS}
+ ${PTHREAD_INCLUDE_DIRS}
+ ${KERNEL_ROOT_DIR}/include/salome
+ ${CMAKE_CURRENT_SOURCE_DIR}/../LightApp
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Event
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Session
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SVTK
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Qtx
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SUIT
+ ${CMAKE_CURRENT_SOURCE_DIR}/../CAM
+ ${CMAKE_CURRENT_SOURCE_DIR}/../STD
+ ${CMAKE_CURRENT_SOURCE_DIR}/../VTKViewer
+ ${CMAKE_CURRENT_SOURCE_DIR}/../OBJECT
+)
+
+SET(COMMON_FLAGS "-DHAVE_CONFIG_H ${CAS_DEFINITIONS} ${QT_DEFINITIONS} ${BOOST_DEFINITIONS} ${VTK_DEFINITIONS} ${PYTHON_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+
+SET(COMMON_LIBS
+ ${PYTHON_LIBS}
+ ${QT_MT_LIBS}
+ ${VTK_LIBS}
+ ${OGL_LIBS}
+ LightApp
+ ${vtkCommonPythonD}
+ ${vtkGraphicsPythonD}
+ ${vtkImagingPythonD}
+ ${vtkPythonCore}
+)
+
+ADD_LIBRARY(SalomePy SHARED SalomePy.cxx)
+SET_TARGET_PROPERTIES(SalomePy PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}")
+TARGET_LINK_LIBRARIES(SalomePy ${COMMON_LIBS})
+INSTALL(TARGETS SalomePy DESTINATION ${GUI_salomelib_LIBS})
+
+IF(WINDOWS)
+ IF(CMAKE_BUILD_TYPE STREQUAL Release)
+ INSTALL(FILES ${CMAKE_INSTALL_PREFIX}/${GUI_salomelib_LIBS}/SalomePy.dll DESTINATION ${GUI_salomelib_LIBS} RENAME libSalomePy.pyd)
+ ELSE(CMAKE_BUILD_TYPE STREQUAL Release)
+ INSTALL(FILES ${CMAKE_INSTALL_PREFIX}/${GUI_salomelib_LIBS}/SalomePy.dll DESTINATION ${GUI_salomelib_LIBS} RENAME libSalomePy_d.pyd)
+ ENDIF(CMAKE_BUILD_TYPE STREQUAL Release)
+ENDIF(WINDOWS)
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+ADD_SUBDIRECTORY(SALOME_PYQT_GUILight)
+ADD_SUBDIRECTORY(SalomePyQt)
+
+IF(GUI_ENABLE_CORBA)
+ ADD_SUBDIRECTORY(SALOME_PYQT_GUI)
+ENDIF(GUI_ENABLE_CORBA)
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE_DIRECTORIES(
+ ${CAS_INCLUDE_DIRS}
+ ${QT_INCLUDE_DIRS}
+ ${PTHREAD_INCLUDE_DIRS}
+ ${PYTHON_INCLUDE_DIRS}
+ ${SIP_INCLUDE_DIRS}
+ ${BOOST_INCLUDE_DIRS}
+ ${PYTHON_INCLUDE_DIRS}
+ ${VTK_INCLUDE_DIRS}
+ ${OMNIORB_INCLUDE_DIRS}
+ ${KERNEL_ROOT_DIR}/include/salome
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../PyInterp
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../SalomeApp
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../SUIT
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../Qtx
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../LightApp
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SALOME_PYQT_GUILight
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../Plot2d
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../OCCViewer
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../SalomeApp
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../CAM
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../STD
+)
+
+SET(COMMON_FLAGS "-DCALL_OLD_METHODS -DHAVE_CONFIG_H ${QT_DEFINITIONS} ${PYTHON_DEFINITIONS} ${CAS_DEFINITIONS} ${BOOST_DEFINITIONS} ${VTK_DEFINITIONS} ${CORBA_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+SET(COMMON_LIBS
+ ${PYTHON_LIBS}
+ ${PYQT_LIBS}
+ ${VTK_LIBS}
+ ${OGL_LIBS}
+ ${PLATFORM_LIBS}
+ PyInterp
+ SalomeApp
+ OCCViewer
+ Plot2d
+ SalomePyQtGUILight
+)
+
+SET(GUI_HEADERS SALOME_PYQT_Module.h)
+QT4_WRAP_CPP(GUI_HEADERS_MOC ${GUI_HEADERS})
+
+ADD_LIBRARY(SalomePyQtGUI SHARED SALOME_PYQT_Module.cxx ${GUI_HEADERS_MOC})
+SET_TARGET_PROPERTIES(SalomePyQtGUI PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}")
+TARGET_LINK_LIBRARIES(SalomePyQtGUI ${COMMON_LIBS})
+INSTALL(TARGETS SalomePyQtGUI DESTINATION ${GUI_salomelib_LIBS})
+
+SET(COMMON_HEADERS_H
+ SALOME_PYQT_GUI.h
+ SALOME_PYQT_Module.h
+)
+
+INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${GUI_salomeinclude_HEADERS})
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE_DIRECTORIES(
+ ${CAS_INCLUDE_DIRS}
+ ${QT_INCLUDE_DIRS}
+ ${SIP_INCLUDE_DIRS}
+ ${BOOST_INCLUDE_DIRS}
+ ${PYTHON_INCLUDE_DIRS}
+ ${VTK_INCLUDE_DIRS}
+ ${PTHREAD_INCLUDE_DIRS}
+ ${KERNEL_ROOT_DIR}/include/salome
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../PyInterp
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../PyConsole
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../SUIT
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../Qtx
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../LightApp
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../Plot2d
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../OCCViewer
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../CAM
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../STD
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../SUITApp
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../CAM
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../STD
+)
+
+SET(COMMON_FLAGS "-DHAVE_CONFIG_H -DCALL_OLD_METHODS ${QT_DEFINITIONS} ${CAS_DEFINITIONS} ${BOOST_DEFINITIONS} ${VTK_DEFINITIONS} ${PYTHON_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+SET(COMMON_LIBS ${PYTHON_LIBS} ${PYQT_LIBS} ${VTK_LIBS} ${OGL_LIBS} PyInterp LightApp)
+
+IF(GUI_ENABLE_CORBA)
+ INCLUDE_DIRECTORIES(
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../SalomeApp
+ ${OMNIORB_INCLUDE_DIRS}
+ )
+ SET(COMMON_LIBS ${COMMON_LIBS} SalomeApp ${SalomeContainer})
+ELSE(GUI_ENABLE_CORBA)
+ SET(COMMON_FLAGS "${COMMON_FLAGS} -DGUI_DISABLE_CORBA")
+ENDIF(GUI_ENABLE_CORBA)
+
+SET(GUI_HEADERS SALOME_PYQT_ModuleLight.h SALOME_PYQT_DataModelLight.h)
+QT4_WRAP_CPP(GUI_HEADERS_MOC ${GUI_HEADERS})
+
+# extra source files (generated by sip)
+SET(SIP_SRC
+ sipAPISalomePyQtGUILight.h
+ sipSalomePyQtGUILightcmodule.cc
+)
+# Sip definition file
+SET(SIP_FILES
+ SALOME_PYQT_GUILight.sip
+)
+FOREACH(input ${SIP_FILES})
+ SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${input})
+ SET(output)
+ FOREACH(out ${SIP_SRC})
+ SET(output ${output} ${CMAKE_CURRENT_BINARY_DIR}/${out})
+ ENDFOREACH(out ${SIP_SRC})
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${output}
+ COMMAND ${SIP_EXECUTABLE} ${PYQT_SIPFLAGS} ${input}
+ MAIN_DEPENDENCY ${input}
+ )
+ENDFOREACH(input ${SIP_FILES})
+
+
+SET(SalomePyQtGUI_SOURCES
+ SALOME_PYQT_ModuleLight.cxx
+ SALOME_PYQT_DataObjectLight.cxx
+ SALOME_PYQT_DataModelLight.cxx
+ SALOME_PYQT_PyInterp.cxx
+)
+ADD_LIBRARY(SalomePyQtGUILight SHARED ${SalomePyQtGUI_SOURCES} ${GUI_HEADERS_MOC} ${SIP_SRC})
+SET_TARGET_PROPERTIES(SalomePyQtGUILight PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}")
+TARGET_LINK_LIBRARIES(SalomePyQtGUILight ${COMMON_LIBS})
+INSTALL(TARGETS SalomePyQtGUILight DESTINATION ${GUI_salomelib_LIBS})
+
+SET(COMMON_HEADERS_H
+ SALOME_PYQT_GUILight.h
+ SALOME_PYQT_ModuleLight.h
+ SALOME_PYQT_DataObjectLight.h
+ SALOME_PYQT_DataModelLight.h
+ SALOME_PYQT_PyInterp.h
+)
+INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${GUI_salomeinclude_HEADERS})
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE_DIRECTORIES(
+ ${CAS_INCLUDE_DIRS}
+ ${QT_INCLUDE_DIRS}
+ ${QWT_INCLUDE_DIRS}
+ ${SIP_INCLUDE_DIRS}
+ ${BOOST_INCLUDE_DIRS}
+ ${PYTHON_INCLUDE_DIRS}
+ ${PTHREAD_INCLUDE_DIRS}
+ ${VTK_INCLUDE_DIRS}
+ ${KERNEL_ROOT_DIR}/include/salome
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_BINARY_DIR}/idl
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../SUIT
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../CAM
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../STD
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../Qtx
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../Event
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../LogWindow
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../VTKViewer
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../OCCViewer
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../Plot2d
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SALOME_PYQT_GUILight
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../PyInterp
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../LightApp
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../ObjBrowser
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../OBJECT
+)
+# -DHAVE_CONFIG_H
+SET(COMMON_FLAGS "${QWT_DEFINITIONS} ${QT_DEFINITIONS} ${CAS_DEFINITIONS} ${BOOST_DEFINITIONS} ${VTK_DEFINITIONS} ${PYTHON_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+SET(COMMON_LIBS
+ ${PYTHON_LIBS}
+ ${SIP_LIBS}
+ ${PYQT_LIBS}
+ ${VTK_LIBS}
+ ${QWT_LIBS}
+ ${OGL_LIBS}
+ suit
+ CAM
+ std
+ qtx
+ Event
+ LogWindow
+ VTKViewer
+ SalomePyQtGUILight
+ OCCViewer
+ Plot2d
+)
+
+SET(GUI_HEADERS SalomePyQt.h)
+QT4_WRAP_CPP(GUI_HEADERS_MOC ${GUI_HEADERS})
+
+# extra source files (generated by sip)
+SET(SIP_SRC
+ sipAPISalomePyQt.h
+ sipSalomePyQtSalomePyQt.cc
+ sipSalomePyQtSALOME_Selection.cc
+ sipSalomePyQtQtxAction.cc
+ sipSalomePyQtQtxActionGroup.cc
+ sipSalomePyQtQtxActionSet.cc
+ sipSalomePyQtcmodule.cc
+)
+# Sip definition file
+SET(SIP_FILES
+ SalomePyQt.sip
+)
+FOREACH(input ${SIP_FILES})
+ SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${input})
+ SET(output)
+ FOREACH(out ${SIP_SRC})
+ SET(output ${output} ${CMAKE_CURRENT_BINARY_DIR}/${out})
+ ENDFOREACH(out ${SIP_SRC})
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${output}
+ COMMAND ${SIP_EXECUTABLE} ${PYQT_SIPFLAGS} ${input}
+ MAIN_DEPENDENCY ${input}
+ )
+ENDFOREACH(input ${SIP_FILES})
+
+SET(SalomePyQt_SOURCES SalomePyQt.cxx)
+
+ADD_LIBRARY(SalomePyQt SHARED ${SalomePyQt_SOURCES} ${GUI_HEADERS_MOC} ${SIP_SRC})
+SET_TARGET_PROPERTIES(SalomePyQt PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}")
+TARGET_LINK_LIBRARIES(SalomePyQt ${COMMON_LIBS})
+INSTALL(TARGETS SalomePyQt DESTINATION ${GUI_salomelib_LIBS})
+
+IF(WINDOWS)
+ IF(CMAKE_BUILD_TYPE STREQUAL Release)
+ INSTALL(FILES ${CMAKE_INSTALL_PREFIX}/${GUI_salomelib_LIBS}/SalomePyQt.dll DESTINATION ${GUI_salomelib_LIBS} RENAME SalomePyQt.pyd)
+ ELSE(CMAKE_BUILD_TYPE STREQUAL Release)
+ INSTALL(FILES ${CMAKE_INSTALL_PREFIX}/${GUI_salomelib_LIBS}/SalomePyQt.dll DESTINATION ${GUI_salomelib_LIBS} RENAME SalomePyQt_d.pyd)
+ ENDIF(CMAKE_BUILD_TYPE STREQUAL Release)
+ELSE(WINDOWS)
+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libSalomePyQt.so DESTINATION ${GUI_salomelib_LIBS} RENAME SalomePyQt.so)
+ENDIF(WINDOWS)
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+FIND_PACKAGE(SWIG REQUIRED)
+INCLUDE(${SWIG_USE_FILE})
+INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/SalomeMacros.cmake)
+
+SET_SOURCE_FILES_PROPERTIES(libSALOME_Swig.i PROPERTIES CPLUSPLUS ON)
+SET_SOURCE_FILES_PROPERTIES(libSALOME_Swig.i PROPERTIES SWIG_DEFINITIONS "-shadow")
+SET_SOURCE_FILES_PROPERTIES(libSALOME_SwigPYTHON_wrap.cxx PROPERTIES COMPILE_FLAGS "-DHAVE_CONFIG_H")
+
+INCLUDE_DIRECTORIES(
+ ${PYTHON_INCLUDE_DIRS}
+ ${CAS_INCLUDE_DIRS}
+ ${QT_INCLUDE_DIRS}
+ ${QWT_INCLUDE_DIRS}
+ ${VTK_INCLUDE_DIRS}
+ ${BOOST_INCLUDE_DIRS}
+ ${PTHREAD_INCLUDE_DIRS}
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_BINARY_DIR}/salome_adm
+ ${CMAKE_BINARY_DIR}/idl
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/../LightApp
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Qtx
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SUIT
+ ${CMAKE_CURRENT_SOURCE_DIR}/../ObjBrowser
+ ${CMAKE_CURRENT_SOURCE_DIR}/../LightApp
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SOCC
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SVTK
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Event
+ ${CMAKE_CURRENT_SOURCE_DIR}/../OBJECT
+ ${CMAKE_CURRENT_SOURCE_DIR}/../CAM
+ ${CMAKE_CURRENT_SOURCE_DIR}/../STD
+ ${CMAKE_CURRENT_SOURCE_DIR}/../OCCViewer
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Prs
+ ${CMAKE_CURRENT_SOURCE_DIR}/../VTKViewer
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SPlot2d
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Plot2d
+)
+
+SET(COMMON_FLAGS "${PYTHON_DEFINITIONS} ${CAS_DEFINITIONS} ${QT_DEFINITIONS} ${QWT_DEFINITIONS} ${VTK_DEFINITIONS} ${BOOST_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+
+SWIG_ADD_MODULE(libSALOME_Swig python libSALOME_Swig.i SALOMEGUI_Swig.cxx)
+SWIG_LINK_LIBRARIES(libSALOME_Swig LightApp ${PYTHON_LIBS})
+SET_TARGET_PROPERTIES(_libSALOME_Swig PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}")
+
+IF(WINDOWS)
+ SET_TARGET_PROPERTIES(_libSALOME_Swig PROPERTIES DEBUG_OUTPUT_NAME _libSALOME_Swig_d)
+ENDIF(WINDOWS)
+
+INSTALL(TARGETS _libSALOME_Swig DESTINATION ${GUI_salomepythondir})
+
+SET(COMMON_HEADERS
+ libSALOME_Swig.i
+ SALOMEGUI_Swig.hxx
+ SALOMEGUI_Swig.i
+)
+INSTALL(FILES ${COMMON_HEADERS} DESTINATION ${GUI_salomeinclude_HEADERS})
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libSALOME_Swig.py DESTINATION ${GUI_salomepythondir})
+
+#
+# ===============================================================
+# Files to be installed
+# ===============================================================
+#
+SET(PYTHON_FILES
+ examplevtk1.py
+ test_table.py
+ test_big_table.py
+ test_many_objects.py
+ test_remove_ref.py
+)
+SALOME_INSTALL_SCRIPTS("${PYTHON_FILES}" ${GUI_salomescript_DATA})
+SALOME_INSTALL_SCRIPTS("SALOMEGUI_shared_modules.py" ${GUI_sharedpkgpython_PYTHON})
+
+CONFIGURE_FILE(supervisionexample.py.in supervisionexample.py @ONLY)
+CONFIGURE_FILE(supervisiongeomexample.py.in supervisiongeomexample.py @ONLY)
+SET(script_DATA
+ ${CMAKE_CURRENT_BINARY_DIR}/libSALOME_Swig.py
+ ${CMAKE_CURRENT_BINARY_DIR}/supervisionexample.py
+ ${CMAKE_CURRENT_BINARY_DIR}/supervisiongeomexample.py
+)
+INSTALL(FILES ${script_DATA} DESTINATION ${GUI_salomescript_DATA}
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE_DIRECTORIES(
+ ${CAS_INCLUDE_DIRS}
+ ${QT_INCLUDE_DIRS}
+ ${BOOST_INCLUDE_DIRS}
+ ${PTHREAD_INCLUDE_DIRS}
+ ${KERNEL_ROOT_DIR}/include/salome
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SUIT
+ ${CMAKE_CURRENT_SOURCE_DIR}/../OBJECT
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Prs
+ ${CMAKE_CURRENT_SOURCE_DIR}/../OCCViewer
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Qtx
+)
+
+SET(COMMON_FLAGS "${QT_DEFINITIONS} ${CAS_DEFINITIONS} ${BOOST_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+SET(COMMON_LIBS ${QT_LIBS} qtx suit SalomeObject SalomePrs OCCViewer)
+
+SET(GUI_HEADERS
+ SOCC_ViewModel.h
+ SOCC_ViewWindow.h
+)
+QT4_WRAP_CPP(GUI_HEADERS_MOC ${GUI_HEADERS})
+
+SET(SOCC_SOURCES
+ SOCC_ViewModel.cxx
+ SOCC_Prs.cxx
+ SOCC_ViewWindow.cxx
+)
+
+ADD_LIBRARY(SOCC SHARED ${SOCC_SOURCES} ${GUI_HEADERS_MOC})
+SET_TARGET_PROPERTIES(SOCC PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}")
+TARGET_LINK_LIBRARIES(SOCC ${COMMON_LIBS})
+INSTALL(TARGETS SOCC DESTINATION ${GUI_salomelib_LIBS})
+
+SET(COMMON_HEADERS_H
+ SOCC.h
+ SOCC_ViewModel.h
+ SOCC_Prs.h
+ SOCC_ViewWindow.h
+)
+
+INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${GUI_salomeinclude_HEADERS})
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE_DIRECTORIES(
+ ${CAS_INCLUDE_DIRS}
+ ${QT_INCLUDE_DIRS}
+ ${BOOST_INCLUDE_DIRS}
+ ${QWT_INCLUDE_DIRS}
+ ${PTHREAD_INCLUDE_DIRS}
+ ${KERNEL_ROOT_DIR}/include/salome
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Qtx
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SUIT
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Plot2d
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Prs
+ ${CMAKE_CURRENT_SOURCE_DIR}/../OBJECT
+)
+
+SET(COMMON_FLAGS "${QT_DEFINITIONS} ${CAS_DEFINITIONS} ${BOOST_DEFINITIONS} ${QWT_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+SET(COMMON_LIBS suit Plot2d SalomePrs SalomeObject)
+
+SET(GUI_HEADERS
+ SPlot2d_ViewModel.h
+ SPlot2d_ViewWindow.h
+)
+QT4_WRAP_CPP(GUI_HEADERS_MOC ${GUI_HEADERS})
+
+SET(SPlot2d_SOURCES
+ SPlot2d_Curve.cxx
+ SPlot2d_Histogram.cxx
+ SPlot2d_Prs.cxx
+ SPlot2d_ViewModel.cxx
+ SPlot2d_ViewWindow.cxx
+)
+
+ADD_LIBRARY(SPlot2d SHARED ${SPlot2d_SOURCES} ${GUI_HEADERS_MOC})
+SET_TARGET_PROPERTIES(SPlot2d PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}")
+TARGET_LINK_LIBRARIES(SPlot2d ${COMMON_LIBS})
+INSTALL(TARGETS SPlot2d DESTINATION ${GUI_salomelib_LIBS})
+
+SET(COMMON_HEADERS_H
+ SPlot2d.h
+ SPlot2d_Curve.h
+ SPlot2d_Histogram.h
+ SPlot2d_Prs.h
+ SPlot2d_ViewModel.h
+ SPlot2d_ViewWindow.h
+)
+
+INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${GUI_salomeinclude_HEADERS})
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/UseQT4EXT.cmake)
+
+INCLUDE_DIRECTORIES(
+ ${QT_INCLUDE_DIRS}
+ ${KERNEL_ROOT_DIR}/include/salome
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Qtx
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SUIT
+)
+
+SET(COMMON_FLAGS "${QT_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+SET(COMMON_LIBS ${QT_MT_LIBS} suit qtx)
+
+SET(GUI_HEADERS
+ STD_Application.h
+ STD_MDIDesktop.h
+ STD_SDIDesktop.h
+ STD_TabDesktop.h
+)
+QT4_WRAP_CPP(GUI_HEADERS_MOC ${GUI_HEADERS})
+
+SET(std_SOURCES
+ STD_Application.cxx
+ STD_MDIDesktop.cxx
+ STD_SDIDesktop.cxx
+ STD_TabDesktop.cxx
+)
+
+SET(GUITS_SOURCES
+ resources/STD_images.ts
+ resources/STD_msg_en.ts
+ resources/STD_msg_fr.ts
+)
+
+ADD_LIBRARY(std SHARED ${std_SOURCES} ${GUI_HEADERS_MOC})
+SET_TARGET_PROPERTIES(std PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}")
+TARGET_LINK_LIBRARIES(std ${COMMON_LIBS})
+INSTALL(TARGETS std DESTINATION ${GUI_salomelib_LIBS})
+
+SET(COMMON_HEADERS_H
+ STD.h
+ STD_Application.h
+ STD_MDIDesktop.h
+ STD_SDIDesktop.h
+ STD_TabDesktop.h
+)
+
+INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${GUI_salomeinclude_HEADERS})
+QT4_INSTALL_TS_RESOURCES("${GUITS_SOURCES}" "${GUI_salomeres_DATA}")
+
+FILE(GLOB GUIPNG_DATA "${CMAKE_CURRENT_SOURCE_DIR}/resources/*.png")
+SET(GUIPNG_DATA ${GUIPNG_DATA} ${CMAKE_CURRENT_SOURCE_DIR}/resources/std.ini)
+INSTALL(FILES ${GUIPNG_DATA} DESTINATION ${GUI_salomeres_DATA})
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/UseQT4EXT.cmake)
+
+INCLUDE_DIRECTORIES(
+ ${QT_INCLUDE_DIRS}
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Qtx
+ ${CMAKE_CURRENT_SOURCE_DIR}/../ObjBrowser
+)
+
+SET(COMMON_LIBS
+ qtx
+ ObjBrowser
+ ${QT_LIBS}
+ ${PLATFORM_LIBS}
+)
+SET(COMMON_FLAGS "${PLATFORM_DEFINITIONS}")
+IF(ENABLE_TESTRECORDER)
+ SET(COMMON_FLAGS "${COMMON_FLAGS} -DENABLE_TESTRECORDER ${TESTRECORDER_DEFINITIONS}")
+ SET(COMMON_LIBS ${COMMON_LIBS} ${TESTRECORDER_LIBS})
+ENDIF(ENABLE_TESTRECORDER)
+
+SET(GUI_HEADERS
+ SUIT_Accel.h
+ SUIT_ActionOperation.h
+ SUIT_Application.h
+ SUIT_DataBrowser.h
+ SUIT_DataObject.h
+ SUIT_Desktop.h
+ SUIT_LicenseDlg.h
+ SUIT_FileDlg.h
+ SUIT_Operation.h
+ SUIT_PopupClient.h
+ SUIT_PreferenceMgr.h
+ SUIT_SelectionMgr.h
+ SUIT_Selector.h
+ SUIT_Session.h
+ SUIT_Study.h
+ SUIT_TreeModel.h
+ SUIT_ViewManager.h
+ SUIT_ViewModel.h
+ SUIT_ViewWindow.h
+ SUIT_ShortcutMgr.h
+)
+QT4_WRAP_CPP(GUI_HEADERS_MOC ${GUI_HEADERS})
+
+SET(suit_SOURCES
+ SUIT_Accel.cxx
+ SUIT_ActionOperation.cxx
+ SUIT_Application.cxx
+ SUIT_DataBrowser.cxx
+ SUIT_DataObject.cxx
+ SUIT_DataObjectIterator.cxx
+ SUIT_DataObjectKey.cxx
+ SUIT_DataOwner.cxx
+ SUIT_Desktop.cxx
+ SUIT_ExceptionHandler.cxx
+ SUIT_FileDlg.cxx
+ SUIT_LicenseDlg.cxx
+ SUIT_FileValidator.cxx
+ SUIT_MessageBox.cxx
+ SUIT_Operation.cxx
+ SUIT_OverrideCursor.cxx
+ SUIT_PopupClient.cxx
+ SUIT_PreferenceMgr.cxx
+ SUIT_ResourceMgr.cxx
+ SUIT_SelectionFilter.cxx
+ SUIT_SelectionMgr.cxx
+ SUIT_Selector.cxx
+ SUIT_Session.cxx
+ SUIT_Study.cxx
+ SUIT_Tools.cxx
+ SUIT_TreeModel.cxx
+ SUIT_ViewManager.cxx
+ SUIT_ViewModel.cxx
+ SUIT_ViewWindow.cxx
+ SUIT_ShortcutMgr.cxx
+)
+SET(GUITS_SOURCES
+ resources/SUIT_msg_en.ts
+ resources/SUIT_msg_fr.ts
+ resources/SUIT_images.ts
+)
+
+ADD_LIBRARY(suit SHARED ${suit_SOURCES} ${GUI_HEADERS_MOC})
+SET_TARGET_PROPERTIES(suit PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}")
+TARGET_LINK_LIBRARIES(suit ${COMMON_LIBS})
+INSTALL(TARGETS suit DESTINATION ${GUI_salomelib_LIBS})
+
+FILE(GLOB COMMON_HEADERS_H "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
+INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${GUI_salomeinclude_HEADERS})
+QT4_INSTALL_TS_RESOURCES("${GUITS_SOURCES}" "${GUI_salomeres_DATA}")
+
+FILE(GLOB GUIPNG_DATA "${CMAKE_CURRENT_SOURCE_DIR}/resources/*.png")
+INSTALL(FILES ${GUIPNG_DATA} DESTINATION ${GUI_salomeres_DATA})
+
item = new QtxPagePrefTabsItem( title, parent, sect, param );
break;
case 2:
- item = new QtxPagePrefFrameItem( title, parent, sect, param );
+ item = new QtxPagePrefFrameItem( title, parent, sect, param, true );
break;
case 3:
item = new QtxPagePrefGroupItem( title, parent, sect, param );
long id, appr = -1;
+ QStringList all_files;
+
// get all files from the same dir where use file is (should be) situated
QDir d( QFileInfo( fname ).dir() );
if ( d.exists() ) {
d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks );
QStringList l = d.entryList();
- for( QStringList::const_iterator anIt = l.begin(), aLast = l.end(); anIt!=aLast; anIt++ )
- {
- id = userFileId( *anIt );
- if ( id < 0 )
- continue;
- if( appr < 0 || qAbs( id-id0 ) < qAbs( appr-id0 ) )
- {
- appr = id;
- appr_file = d.absoluteFilePath( *anIt );
- }
- }
+ foreach( QString ll, l )
+ all_files << d.absoluteFilePath( ll );
}
-
// backward compatibility: check also user's home directory (if it differs from above one)
QDir home = QDir::home();
if ( home.exists() && d.canonicalPath() != home.canonicalPath() ) {
home.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks );
QStringList l = home.entryList();
+ foreach( QString ll, l )
+ all_files << home.absoluteFilePath( ll );
+ }
+
+ for( QStringList::const_iterator anIt = all_files.begin(), aLast = all_files.end(); anIt!=aLast; anIt++ )
+ {
+ id = userFileId( *anIt );
+ if ( id < 0 )
+ continue;
- for( QStringList::const_iterator anIt = l.begin(), aLast = l.end(); anIt!=aLast; anIt++ )
+ if( appr < 0 || qAbs( id-id0 ) < qAbs( appr-id0 ) )
{
- id = userFileId( *anIt );
- if ( id < 0 )
- continue;
- if( appr < 0 || qAbs( id-id0 ) < qAbs( appr-id0 ) )
- {
- appr = id;
+ appr = id;
+ appr_file = d.absoluteFilePath( *anIt );
+ }
+ else if ( qAbs( id-id0 ) == qAbs( appr-id0 ) ) {
+ // appr == id that means that another file with equal version id is detected
+ // this can happen, e.g. if one file begins with "." and other one - not
+ // ...
+ // VSR 24/09/2012: issue 0021781: since version 6.6.0 user filename is not prepended with "."
+ // when it is stored in the ~/.config/<appname> directory;
+ // for backward compatibility we also check files prepended with "." with lower priority
+ if ( !QFileInfo( *anIt ).fileName().startsWith(".") )
appr_file = home.absoluteFilePath( *anIt );
- }
}
}
if(sitem==0)
{
//end of item list
- if(kitem==0)
- sitem=createItemAtPos(sobj,item,0);
- else
- sitem=createItemAtPos(sobj,item,kitem);
+ sitem=createItemAtPos(sobj,item,kitem);
updateTreeModel(sobj,sitem);
kobj++;
kitem++;
else
{
// obj : new object
- createItemAtPos(sobj,item,kitem);
+ sitem=createItemAtPos(sobj,item,kitem);
+ updateTreeModel(sobj,sitem);
kobj++;
kitem++;
sobj=obj->childObject(kobj);
//obj and item are synchronised : go to next ones
updateTreeModel(sobj,sitem);
if(sobj->modified()) updateItem(sitem, true);
- if( sobj ) sobj->update();
+ sobj->update();
kobj++;
kitem++;
sobj=obj->childObject(kobj);
SUIT_TreeModel::TreeItem* item = new TreeItem( obj, parent, after );
myItems[ obj ] = item;
- for(int pos=row;pos < parent->childCount();pos++)
- parent->child(pos)->setPosition(pos);
+ for(int ppos=row;ppos < parent->childCount();ppos++)
+ parent->child(ppos)->setPosition(ppos);
endInsertRows();
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/UseQT4EXT.cmake)
+
+INCLUDE_DIRECTORIES(
+ ${QT_INCLUDE_DIRS}
+ ${PTHREAD_INCLUDE_DIRS}
+ ${PYTHON_INCLUDE_DIRS}
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Qtx
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SUIT
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Style
+)
+
+SET(COMMON_FLAGS "${QT_DEFINITIONS} ${PYTHON_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+
+SET(COMMON_LIBS
+ qtx
+ suit
+ SalomeStyle
+ ${QT_MT_LIBS}
+)
+
+SET(GUI_HEADERS SUITApp_Application.h)
+QT4_WRAP_CPP(GUI_HEADERS_MOC ${GUI_HEADERS})
+
+SET(SUITApp_SOURCES
+ SUITApp.cxx
+ SUITApp_Application.cxx
+)
+SET(COMMON_HEADERS_HXX)
+IF(ENABLE_PYCONSOLE)
+ SET(COMMON_HEADERS_HXX
+ ${COMMON_HEADERS_HXX}
+ SUITApp_init_python.hxx
+ )
+ SET(SUITApp_SOURCES
+ ${SUITApp_SOURCES}
+ SUITApp_init_python.cxx
+ )
+ SET(COMMON_LIBS
+ ${COMMON_LIBS}
+ ${PYTHON_LIBS}
+ )
+ENDIF(ENABLE_PYCONSOLE)
+
+IF(ENABLE_TESTRECORDER)
+ SET(COMMON_FLAGS
+ ${COMMON_FLAGS}
+ -DENABLE_TESTRECORDER
+ ${TESTRECORDER_DEFINITIONS}
+ )
+ SET(COMMON_LIBS
+ ${COMMON_LIBS}
+ ${TESTRECORDER_LIBS}
+ )
+ENDIF(ENABLE_TESTRECORDER)
+
+SET(GUITS_SOURCES
+ resources/SUITApp_msg_en.ts
+ resources/SUITApp_msg_fr.ts
+)
+
+ADD_LIBRARY(SUITApp SHARED ${SUITApp_SOURCES} ${GUI_HEADERS_MOC})
+SET_TARGET_PROPERTIES(SUITApp PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}")
+TARGET_LINK_LIBRARIES(SUITApp ${COMMON_LIBS})
+INSTALL(TARGETS SUITApp DESTINATION ${GUI_salomelib_LIBS})
+
+ADD_EXECUTABLE(TestSUITApp SUITApp.cxx)
+SET_TARGET_PROPERTIES(TestSUITApp PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}" OUTPUT_NAME "SUITApp")
+TARGET_LINK_LIBRARIES(TestSUITApp SUITApp ${COMMON_LIBS})
+INSTALL(TARGETS TestSUITApp DESTINATION ${GUI_salomebin_BINS})
+
+FILE(GLOB COMMON_HEADERS_H "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
+SET(COMMON_HEADERS ${COMMON_HEADERS_H} ${COMMON_HEADERS_HXX})
+INSTALL(FILES ${COMMON_HEADERS} DESTINATION ${GUI_salomeinclude_HEADERS})
+QT4_INSTALL_TS_RESOURCES("${GUITS_SOURCES}" "${GUI_salomeres_DATA}")
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/UseQT4EXT.cmake)
+
+INCLUDE_DIRECTORIES(
+ ${CAS_INCLUDE_DIRS}
+ ${QT_INCLUDE_DIRS}
+ ${BOOST_INCLUDE_DIRS}
+ ${PTHREAD_INCLUDE_DIRS}
+ ${QT_INCLUDE_DIRS}
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Qtx
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SUIT
+ ${CMAKE_CURRENT_SOURCE_DIR}/../OBJECT
+)
+
+SET(SUPERVGraph_SOURCES
+ SUPERVGraph.cxx
+ SUPERVGraph_ViewFrame.cxx
+ SUPERVGraph_ViewManager.cxx
+ SUPERVGraph_ViewModel.cxx
+)
+
+SET(GUI_HEADERS
+ SUPERVGraph.h
+ SUPERVGraph_ViewFrame.h
+ SUPERVGraph_ViewManager.h
+ SUPERVGraph_ViewModel.h
+)
+QT4_WRAP_CPP(GUI_HEADERS_MOC ${GUI_HEADERS})
+
+SET(dist_salomeres_DATA
+ resources/superv_view_pan.png
+ resources/superv_view_reset.png
+)
+
+SET(GUITS_SOURCES
+ resources/SUPERVGraph_images.ts
+ resources/SUPERVGraph_msg_en.ts
+ resources/SUPERVGraph_msg_fr.ts
+)
+
+ADD_LIBRARY(SUPERVGraph SHARED ${SUPERVGraph_SOURCES} ${GUI_HEADERS_MOC})
+SET_TARGET_PROPERTIES(SUPERVGraph PROPERTIES COMPILE_FLAGS "${QT_DEFINITIONS} ${CAS_DEFINITIONS} ${PYTHON_DEFINITIONS} ${BOOST_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+TARGET_LINK_LIBRARIES(SUPERVGraph ${QT_MT_LIBS} suit SalomeObject)
+INSTALL(TARGETS SUPERVGraph DESTINATION ${GUI_salomelib_LIBS})
+
+FILE(GLOB COMMON_HEADERS_H "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
+INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${GUI_salomeinclude_HEADERS})
+QT4_INSTALL_TS_RESOURCES("${GUITS_SOURCES}" "${GUI_salomeres_DATA}")
+
+FILE(GLOB GUIPNG_DATA "${CMAKE_CURRENT_SOURCE_DIR}/resources/*.png")
+INSTALL(FILES ${GUIPNG_DATA} DESTINATION ${GUI_salomeres_DATA})
+
+
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/UseQT4EXT.cmake)
+
+INCLUDE_DIRECTORIES(
+ ${CAS_INCLUDE_DIRS}
+ ${QT_INCLUDE_DIRS}
+ ${VTK_INCLUDE_DIRS}
+ ${PTHREAD_INCLUDE_DIRS}
+ ${BOOST_INCLUDE_DIRS}
+ ${KERNEL_ROOT_DIR}/include/salome
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Qtx
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SUIT
+ ${CMAKE_CURRENT_SOURCE_DIR}/../ViewerTools
+ ${CMAKE_CURRENT_SOURCE_DIR}/../OBJECT
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Prs
+ ${CMAKE_CURRENT_SOURCE_DIR}/../VTKViewer
+ ${CMAKE_CURRENT_SOURCE_DIR}/../OpenGLUtils
+)
+SET(COMMON_FLAGS "${QT_DEFINITIONS} ${CAS_DEFINITIONS} ${VTK_DEFINITIONS} ${BOOST_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+SET(COMMON_LIBS
+ qtx
+ suit
+ ViewerTools
+ SalomeObject
+ SalomePrs
+ VTKViewer
+ OpenGLUtils
+ ${SALOMELocalTrace}
+ ${OpUtil}
+ ${VTK_LIBS}
+ ${OGL_LIBS}
+ ${QT_MT_LIBS}
+ ${CAS_KERNEL}
+ ${CAS_VIEWER}
+)
+
+SET(GUI_HEADERS SVTK_GenericRenderWindowInteractor.h SVTK_RenderWindowInteractor.h SVTK_NonIsometricDlg.h
+ SVTK_UpdateRateDlg.h SVTK_CubeAxesDlg.h SVTK_FontWidget.h SVTK_ViewModelBase.h SVTK_ViewManager.h
+ SVTK_ViewWindow.h SVTK_ViewModel.h SVTK_View.h SVTK_SetRotationPointDlg.h SVTK_ViewParameterDlg.h
+ SVTK_ComboAction.h SVTK_RecorderDlg.h)
+QT4_WRAP_CPP(GUI_HEADERS ${GUI_HEADERS})
+
+SET(SVTK_SOURCES
+ SVTK_Prs.cxx
+ SVTK_Actor.cxx
+ SALOME_Actor.cxx
+ SVTK_RectPicker.cxx
+ SVTK_DeviceActor.cxx
+ SVTK_CubeAxesActor2D.cxx
+ SVTK_NonIsometricDlg.cxx
+ SVTK_UpdateRateDlg.cxx
+ SVTK_CubeAxesDlg.cxx
+ SVTK_FontWidget.cxx
+ SVTK_Trihedron.cxx
+ SVTK_View.cxx
+ SVTK_ViewManager.cxx
+ SVTK_ViewModel.cxx
+ SVTK_Renderer.cxx
+ SVTK_ViewWindow.cxx
+ SVTK_InteractorStyle.cxx
+ SVTK_KeyFreeInteractorStyle.cxx
+ SVTK_RenderWindowInteractor.cxx
+ SVTK_GenericRenderWindowInteractor.cxx
+ SVTK_SpaceMouse.cxx
+ SVTK_Selector.cxx
+ SVTK_SetRotationPointDlg.cxx
+ SVTK_ViewParameterDlg.cxx
+ SVTK_ComboAction.cxx
+ SVTK_Recorder.cxx
+ SVTK_RecorderDlg.cxx
+ SVTK_ImageWriter.cxx
+ SVTK_ImageWriterMgr.cxx
+ SVTK_Utils.cxx
+ vtkPVAxesActor.h
+ vtkPVAxesActor.cxx
+ vtkPVAxesWidget.h
+ vtkPVAxesWidget.cxx
+)
+
+SET(GUITS_SOURCES
+ resources/SVTK_msg_en.ts
+ resources/SVTK_msg_fr.ts
+ resources/SVTK_images.ts
+)
+
+ADD_LIBRARY(SVTK SHARED ${SVTK_SOURCES} ${GUI_HEADERS})
+SET_TARGET_PROPERTIES(SVTK PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}")
+TARGET_LINK_LIBRARIES(SVTK ${COMMON_LIBS})
+INSTALL(TARGETS SVTK DESTINATION ${GUI_salomelib_LIBS})
+
+#ADD_EXECUTABLE(TestSVTK SVTK.cxx)
+#SET_TARGET_PROPERTIES(TestSVTK PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}" OUTPUT_NAME "SVTK")
+#TARGET_LINK_LIBRARIES(TestSVTK SVTK ${COMMON_LIBS})
+#INSTALL(TARGETS TestSVTK DESTINATION ${GUI_salomebin_BINS})
+
+SET(COMMON_HEADERS_H
+ SVTK.h
+ SVTK_Prs.h
+ SVTK_Actor.h
+ SALOME_Actor.h
+ SVTK_RectPicker.h
+ SVTK_DeviceActor.h
+ SVTK_FontWidget.h
+ SVTK_CubeAxesActor2D.h
+ SVTK_Functor.h
+ SVTK_View.h
+ SVTK_ViewManager.h
+ SVTK_ViewModel.h
+ SVTK_ViewWindow.h
+ SVTK_Renderer.h
+ SVTK_InteractorStyle.h
+ SVTK_KeyFreeInteractorStyle.h
+ SVTK_RenderWindowInteractor.h
+ SVTK_GenericRenderWindowInteractor.h
+ SVTK_Selector.h
+ SVTK_Selection.h
+ SVTK_SelectionEvent.h
+ SVTK_SpaceMouse.h
+ SVTK_Event.h
+ SVTK_ViewModelBase.h
+ SVTK_SetRotationPointDlg.h
+ SVTK_ViewParameterDlg.h
+ SVTK_ComboAction.h
+ SVTK_Recorder.h
+ SVTK_RecorderDlg.h
+ SVTK_ImageWriter.h
+ SVTK_ImageWriterMgr.h
+ SVTK_Utils.h
+)
+INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${GUI_salomeinclude_HEADERS})
+QT4_INSTALL_TS_RESOURCES("${GUITS_SOURCES}" "${GUI_salomeres_DATA}")
+
+FILE(GLOB GUIPNG_DATA "${CMAKE_CURRENT_SOURCE_DIR}/resources/*.png")
+INSTALL(FILES ${GUIPNG_DATA} DESTINATION ${GUI_salomeres_DATA})
+
SVTK_Recorder.h \
SVTK_RecorderDlg.h \
SVTK_ImageWriter.h \
- SVTK_ImageWriterMgr.h
+ SVTK_ImageWriterMgr.h \
+ SVTK_Utils.h
dist_libSVTK_la_SOURCES= \
SVTK_Prs.cxx \
SVTK_RecorderDlg.cxx \
SVTK_ImageWriter.cxx \
SVTK_ImageWriterMgr.cxx \
+ SVTK_Utils.cxx \
vtkPVAxesActor.h \
vtkPVAxesActor.cxx \
vtkPVAxesWidget.h \
SALOME_Actor *theActor,
vtkIdType theObjId)
{
- switch(theMode){
+ switch(theMode) {
case CellSelection:
return true;
case EdgeSelection:
return ( theActor->GetObjDimension( theObjId ) == 2 );
case VolumeSelection:
return ( theActor->GetObjDimension( theObjId ) == 3 );
+ case Elem0DSelection:
+ return ((theActor->GetObjDimension( theObjId ) == 0) &&
+ theActor->GetElemCell(theObjId) &&
+ (theActor->GetElemCell(theObjId)->GetCellType() == VTK_VERTEX));
+ case BallSelection:
+ return ((theActor->GetObjDimension( theObjId ) == 0) &&
+ theActor->GetElemCell(theObjId) &&
+ (theActor->GetElemCell(theObjId)->GetCellType() == VTK_POLY_VERTEX));
+
};
return false;
}
myRenderer = theRenderer;
- theRenderer->AddActor( myPreHighlightActor.GetPointer() );
- theRenderer->AddActor( myHighlightActor.GetPointer() );
+ myHighlightActor->AddToRender(theRenderer);
+ myPreHighlightActor->AddToRender(theRenderer);
theRenderer->AddActor( myOutlineActor.GetPointer() );
theRenderer->AddActor( myNameActor.GetPointer() );
}
{
Superclass::RemoveFromRender(theRenderer);
+ myHighlightActor->RemoveFromRender(theRenderer);
+ myPreHighlightActor->RemoveFromRender(theRenderer);
+
theRenderer->RemoveActor( myPreHighlightActor.GetPointer() );
theRenderer->RemoveActor( myHighlightActor.GetPointer() );
theRenderer->RemoveActor( myOutlineActor.GetPointer() );
case EdgeSelection:
case FaceSelection:
case VolumeSelection:
+ case Elem0DSelection:
+ case BallSelection:
myHighlightActor->GetProperty()->SetRepresentationToSurface();
myHighlightActor->MapCells( this, aMapIndex );
break;
case EdgeSelection:
case FaceSelection:
case VolumeSelection:
+ case Elem0DSelection:
+ case BallSelection:
{
SVTK::TPickLimiter aPickLimiter( myCellPicker, this );
myCellPicker->Pick( x, y, z, aRenderer );
case EdgeSelection:
case FaceSelection:
case VolumeSelection:
+ case Elem0DSelection:
+ case BallSelection:
{
SVTK::TPickLimiter aPickLimiter( myCellPicker, this );
myCellPicker->Pick( x, y, z, aRenderer );
case EdgeSelection:
case FaceSelection:
case VolumeSelection:
+ case Elem0DSelection:
+ case BallSelection:
{
SVTK::TPickLimiter aPickLimiter( myCellRectPicker, this );
myCellRectPicker->Pick( x1, y1, z1, x2, y2, z2, aRenderer );
#include "SVTK_Actor.h"
#include "SALOME_Actor.h"
+#include "SVTK_Utils.h"
#include "SALOME_InteractiveObject.hxx"
#include "Utils_SALOME_Exception.hxx"
#include "utilities.h"
-static
-void
-CopyPoints(vtkUnstructuredGrid* theGrid, vtkDataSet *theSourceDataSet)
-{
- vtkPoints *aPoints = vtkPoints::New();
- vtkIdType iEnd = theSourceDataSet->GetNumberOfPoints();
- aPoints->SetNumberOfPoints(iEnd);
- for(vtkIdType i = 0; i < iEnd; i++){
- aPoints->SetPoint(i,theSourceDataSet->GetPoint(i));
- }
- theGrid->SetPoints(aPoints);
- aPoints->Delete();
-}
vtkStandardNewMacro(SVTK_Actor);
myUnstructuredGrid->Allocate();
vtkDataSet *aSourceDataSet = theMapActor->GetInput();
- CopyPoints(GetSource(),aSourceDataSet);
+ SVTK::CopyPoints(GetSource(),aSourceDataSet);
int aNbOfParts = theMapIndex.Extent();
for(int ind = 1; ind <= aNbOfParts; ind++){
myUnstructuredGrid->Allocate();
vtkDataSet *aSourceDataSet = theMapActor->GetInput();
- CopyPoints(GetSource(),aSourceDataSet);
+ SVTK::CopyPoints(GetSource(),aSourceDataSet);
if(theMapIndex.Extent() == 2){
myMapIndex = theMapIndex;
}
+
+/*!
+ To publish the actor an all its internal devices
+*/
+void
+SVTK_Actor
+::AddToRender(vtkRenderer* theRenderer)
+{
+ theRenderer->AddActor(this);
+}
+
+void
+SVTK_Actor
+::RemoveFromRender(vtkRenderer* theRenderer)
+{
+ theRenderer->RemoveActor(this);
+}
vtkTypeMacro(SVTK_Actor,SVTK_DeviceActor);
//! Initialiaze the instance completely
- void
+ virtual void
Initialize();
//! Allows to set an external source
vtkUnstructuredGrid*
GetSource();
+ virtual void
+ AddToRender(vtkRenderer* theRenderer);
+
+ virtual void
+ RemoveFromRender(vtkRenderer* theRenderer);
+
+
//! Allow to recostruct selected cells from source SALOME_Actor and map of subindexes
- void
+ virtual void
MapCells(SALOME_Actor* theMapActor,
const TColStd_IndexedMapOfInteger& theMapIndex);
//! Allow to recostruct selected points from source SALOME_Actor and map of subindexes
- void
+ virtual void
MapPoints(SALOME_Actor* theMapActor,
const TColStd_IndexedMapOfInteger& theMapIndex);
//! Allow to recostruct selected edges from source SALOME_Actor and map of subindexes
- void
+ virtual void
MapEdge(SALOME_Actor* theMapActor,
const TColStd_IndexedMapOfInteger& theMapIndex);
bool SVTK_DeviceActor::IsCoincident3DAllowed() const {
return myGeomFilter->GetAppendCoincident3D();
}
+
+void
+SVTK_DeviceActor
+::SetResolveCoincidentTopology(bool theIsResolve)
+{
+ myIsResolveCoincidentTopology = theIsResolve;
+}
virtual
bool
IsCoincident3DAllowed() const;
+
+ void
+ SetResolveCoincidentTopology(bool theIsResolve);
+
protected:
const Selection_Mode FaceSelection = 4;
const Selection_Mode VolumeSelection = 5;
const Selection_Mode ActorSelection = 6;
+const Selection_Mode Elem0DSelection = 7;
+const Selection_Mode BallSelection = 8;
#endif
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
+// File : SVTK_Utils.cxx
+// Author : Roman NIKOLAEV
+
+#include "SVTK_Utils.h"
+
+#include <vtkUnstructuredGrid.h>
+
+namespace SVTK {
+ void CopyPoints(vtkUnstructuredGrid* theGrid, vtkDataSet *theSourceDataSet)
+ {
+ vtkPoints *aPoints = vtkPoints::New();
+ vtkIdType iEnd = theSourceDataSet->GetNumberOfPoints();
+ aPoints->SetNumberOfPoints(iEnd);
+ for(vtkIdType i = 0; i < iEnd; i++){
+ aPoints->SetPoint(i,theSourceDataSet->GetPoint(i));
+ }
+ theGrid->SetPoints(aPoints);
+ aPoints->Delete();
+ }
+}
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
+// File : SVTK_Utils.h
+// Author : Roman NIKOLAEV
+
+#ifndef SVTK_UTILS_H
+#define SVTK_UTILS_H
+
+#include "SVTK.h"
+
+class vtkUnstructuredGrid;
+class vtkDataSet;
+
+namespace SVTK {
+
+ SVTK_EXPORT void CopyPoints(vtkUnstructuredGrid* theGrid, vtkDataSet *theSourceDataSet);
+
+}
+
+#endif
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+ADD_SUBDIRECTORY(pluginsdemo)
+
+IF(CPPUNIT_IS_OK)
+ IF(GUI_ENABLE_CORBA)
+ ADD_SUBDIRECTORY(Test)
+ ENDIF(GUI_ENABLE_CORBA)
+ENDIF(CPPUNIT_IS_OK)
+
+INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/UseQT4EXT.cmake)
+INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/SalomeMacros.cmake)
+
+INCLUDE_DIRECTORIES(
+ ${CAS_INCLUDE_DIRS}
+ ${QT_INCLUDE_DIRS}
+ ${VTK_INCLUDE_DIRS}
+ ${QWT_INCLUDE_DIRS}
+ ${BOOST_INCLUDE_DIRS}
+ ${PYTHON_INCLUDE_DIRS}
+ ${OMNIORB_INCLUDE_DIRS}
+ ${LIBXML_INCLUDE_DIRS}
+ ${PTHREAD_INCLUDE_DIRS}
+ ${KERNEL_ROOT_DIR}/include/salome
+ ${CMAKE_CURRENT_SOURCE_DIR}/../LightApp
+ ${CMAKE_CURRENT_SOURCE_DIR}/../CAM
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Qtx
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SUIT
+ ${CMAKE_CURRENT_SOURCE_DIR}/../OBJECT
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SVTK
+ ${CMAKE_CURRENT_SOURCE_DIR}/../STD
+ ${CMAKE_CURRENT_SOURCE_DIR}/../VTKViewer
+ ${CMAKE_CURRENT_SOURCE_DIR}/../ObjBrowser
+ ${CMAKE_CURRENT_SOURCE_DIR}/../PyConsole
+ ${CMAKE_CURRENT_SOURCE_DIR}/../TOOLSGUI
+ ${CMAKE_CURRENT_SOURCE_DIR}/../PyInterp
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Session
+ ${CMAKE_BINARY_DIR}/idl
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Event
+ ${CMAKE_CURRENT_SOURCE_DIR}/../CASCatch
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Prs
+)
+
+SET(COMMON_FLAGS "${QT_DEFINITIONS} ${LIBXML_DEFINITIONS} ${CORBA_DEFINITIONS} ${VTK_DEFINITIONS} ${QWT_DEFINITIONS} ${CAS_DEFINITIONS} ${BOOST_DEFINITIONS} ${PYTHON_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+SET(COMMON_LIBS
+ ${PYTHON_LIBS}
+ ${QT_MT_LIBS}
+ ${OpUtil}
+ ${SALOMELocalTrace}
+ ${SalomeDSClient}
+ suit
+ std
+ CAM
+ ObjBrowser
+ SalomePrs
+ SPlot2d
+ GLViewer
+ OCCViewer
+ VTKViewer
+ SalomeObject
+ SVTK
+ SOCC
+ PyInterp
+ PyConsole
+ LogWindow
+ LightApp
+ ToolsGUI
+ SalomeSession
+ Event
+ CASCatch
+ SalomePrs
+ ${CAS_KERNEL}
+)
+
+SET(GUI_HEADERS
+ SalomeApp_Application.h
+ SalomeApp_DataModel.h
+ SalomeApp_Module.h
+ SalomeApp_LoadStudiesDlg.h
+ SalomeApp_Study.h
+ SalomeApp_StudyPropertiesDlg.h
+ SalomeApp_ListView.h
+ SalomeApp_CheckFileDlg.h
+ SalomeApp_ExitDlg.h
+ SalomeApp_NoteBookDlg.h
+ SalomeApp_DoubleSpinBox.h
+ SalomeApp_IntSpinBox.h
+)
+QT4_WRAP_CPP(GUI_HEADERS_MOC ${GUI_HEADERS})
+
+SET(SalomeApp_SOURCES
+ SalomeApp_Module.cxx
+ SalomeApp_Application.cxx
+ SalomeApp_DataModel.cxx
+ SalomeApp_DataObject.cxx
+ SalomeApp_LoadStudiesDlg.cxx
+ SalomeApp_Study.cxx
+ SalomeApp_ExceptionHandler.cxx
+ SalomeApp_PyInterp.cxx
+ SalomeApp_Tools.cxx
+ SalomeApp_ImportOperation.cxx
+ SalomeApp_Filter.cxx
+ SalomeApp_TypeFilter.cxx
+ SalomeApp_StudyPropertiesDlg.cxx
+ SalomeApp_ListView.cxx
+ SalomeApp_CheckFileDlg.cxx
+ SalomeApp_VisualState.cxx
+ SalomeApp_ExitDlg.cxx
+ SalomeApp_NoteBookDlg.cxx
+ SalomeApp_DoubleSpinBox.cxx
+ SalomeApp_IntSpinBox.cxx
+)
+
+SET(GUITS_SOURCES
+ resources/SalomeApp_images.ts
+ resources/SalomeApp_msg_en.ts
+ resources/SalomeApp_msg_fr.ts
+)
+
+ADD_LIBRARY(SalomeApp SHARED ${SalomeApp_SOURCES} ${GUI_HEADERS_MOC})
+SET_TARGET_PROPERTIES(SalomeApp PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}")
+TARGET_LINK_LIBRARIES(SalomeApp ${COMMON_LIBS})
+INSTALL(TARGETS SalomeApp DESTINATION ${GUI_salomelib_LIBS})
+
+SET(COMMON_HEADERS_H
+ SalomeApp.h
+ SalomeApp_Application.h
+ SalomeApp_DataModel.h
+ SalomeApp_DataObject.h
+ SalomeApp_LoadStudiesDlg.h
+ SalomeApp_Module.h
+ SalomeApp_Study.h
+ SalomeApp_ExceptionHandler.h
+ SalomeApp_PyInterp.h
+ SalomeApp_Tools.h
+ SalomeApp_ImportOperation.h
+ SalomeApp_Filter.h
+ SalomeApp_TypeFilter.h
+ SalomeApp_StudyPropertiesDlg.h
+ SalomeApp_CheckFileDlg.h
+ SalomeApp_VisualState.h
+ SalomeApp_ExitDlg.h
+ SalomeApp_NoteBookDlg.h
+ SalomeApp_DoubleSpinBox.h
+ SalomeApp_IntSpinBox.h
+)
+
+INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${GUI_salomeinclude_HEADERS})
+QT4_INSTALL_TS_RESOURCES("${GUITS_SOURCES}" "${GUI_salomeres_DATA}")
+
+FILE(GLOB GUIPNG_DATA "${CMAKE_CURRENT_SOURCE_DIR}/resources/*.png")
+SET(INST_DATA ${GUIPNG_DATA} resources/SalomeApp.ini resources/SalomeApp.xml)
+INSTALL(FILES ${INST_DATA} DESTINATION ${GUI_salomeres_DATA})
+
+# python modules
+SALOME_INSTALL_SCRIPTS("salome_pluginsmanager.py" ${GUI_salomepythondir})
+SALOME_INSTALL_SCRIPTS("addvars2notebook.py" ${GUI_salomescript_PYTHON})
-I$(srcdir)/../Event -I$(srcdir)/../CASCatch -I$(srcdir)/../Prs \
@CORBA_CXXFLAGS@ @CORBA_INCLUDES@ @LIBXML_INCLUDES@
libSalomeApp_la_LDFLAGS = $(PYTHON_LIBS) $(QT_MT_LIBS)
-libSalomeApp_la_LIBADD = $(KERNEL_LDFLAGS) -lOpUtil -lSALOMELocalTrace -lSalomeDSClient \
+libSalomeApp_la_LIBADD = $(KERNEL_LDFLAGS) -lOpUtil -lSALOMELocalTrace -lSalomeLifeCycleCORBA -lSalomeDSClient \
../SUIT/libsuit.la ../STD/libstd.la ../CAM/libCAM.la ../ObjBrowser/libObjBrowser.la \
../Prs/libSalomePrs.la ../SPlot2d/libSPlot2d.la ../GLViewer/libGLViewer.la \
../OCCViewer/libOCCViewer.la ../VTKViewer/libVTKViewer.la ../OBJECT/libSalomeObject.la \
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE_DIRECTORIES(
+ ${CPPUNIT_INCLUDE_DIRS}
+ ${KERNEL_ROOT_DIR}/include/salome
+)
+
+SET(COMMON_LIBS ${CPPUNIT_LIBS} ${PLATFORM_LIBS})
+SET(COMMON_FLAGS "${CPPUNIT_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+
+ADD_LIBRARY(SalomeAppTest SHARED SalomeAppTest.cxx)
+SET_TARGET_PROPERTIES(SalomeAppTest PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}")
+TARGET_LINK_LIBRARIES(SalomeAppTest ${COMMON_LIBS})
+INSTALL(TARGETS SalomeAppTest DESTINATION ${GUI_salomelib_LIBS})
+
+ADD_EXECUTABLE(TestSalomeApp TestSalomeApp.cxx)
+SET_TARGET_PROPERTIES(TestSalomeApp PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}")
+TARGET_LINK_LIBRARIES(TestSalomeApp SalomeAppTest ${COMMON_LIBS})
+INSTALL(TARGETS TestSalomeApp DESTINATION ${GUI_salomebin_BINS})
+
+INSTALL(FILES SalomeAppTest.hxx DESTINATION ${GUI_salomeinclude_HEADERS})
+SALOME_INSTALL_SCRIPTS("TestSalomeApp.py" ${GUI_salomescript_PYTHON})
#include <cppunit/extensions/HelperMacros.h>
-class SalomeAppTest : public CppUnit::TestFixture
+#ifdef WIN32
+# if defined SALOMEAPPTEST_EXPORTS || defined SalomeAppTest_EXPORTS
+# define SALOMEAPPTEST_EXPORT __declspec( dllexport )
+# else
+# define SALOMEAPPTEST_EXPORT __declspec( dllimport )
+# endif
+#else
+# define SALOMEAPPTEST_EXPORT
+#endif
+
+class SALOMEAPPTEST_EXPORT SalomeAppTest : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE( SalomeAppTest );
CPPUNIT_TEST( testSalomeApp );
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+#
+# Note that the plugins files should be installed in the directory
+# <salomepluginsdir> (ROOT_DIR/share/salome/plugins) or one of this
+# sub-directories (the search of plugins by the plugin manager is
+# recurcive from this folder, in each SALOME module, i.e. each
+# variable *_ROOT_DIR).
+#
+
+INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/SalomeMacros.cmake)
+
+SET(plugins_PYTHON
+ salome_plugins.py
+ smesh_plugins.py
+ trihedron.py
+ tubedialog_ui.py
+ tubedialog.py
+ tubebuilder.py
+ xalome.py
+ minmax_dialog.py
+ minmax_plugin.py
+)
+
+SALOME_INSTALL_SCRIPTS("${plugins_PYTHON}" ${GUI_salomepluginsdir}/demo DEF_PERMS)
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE_DIRECTORIES(
+ ${QT_INCLUDE_DIRS}
+ ${LIBXML_INCLUDE_DIRS}
+ ${PYTHON_INCLUDE_DIRS}
+ ${HDF5_INCLUDE_DIRS}
+ ${BOOST_INCLUDE_DIRS}
+ ${CAS_INCLUDE_DIRS}
+ ${OMNIORB_INCLUDE_DIRS}
+ ${PTHREAD_INCLUDE_DIRS}
+ ${KERNEL_ROOT_DIR}/include/salome
+ ${CMAKE_BINARY_DIR}/idl
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Qtx
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SUIT
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Event
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Style
+ ${CMAKE_CURRENT_SOURCE_DIR}/../CASCatch
+)
+
+SET(COMMON_LIBS
+ ${SalomeNS}
+ ${SalomeLifeCycleCORBA}
+ ${OpUtil}
+ ${SALOMELocalTrace}
+ ${SalomeCatalog}
+ ${SalomeDSClient}
+ ${CAS_KERNEL}
+ ${with_loggerTraceCollector}
+ ${SalomeIDLKernel}
+ ${SalomeContainer}
+ ${TOOLSDS}
+ ${SalomeLauncher}
+ ${Registry}
+ ${SALOMEBasics}
+ suit
+ Event
+ SalomeIDLGUI
+ SalomeStyle
+ ${QT_LIBS}
+)
+SET(COMMON_FLAGS "${QT_DEFINITIONS} ${LIBXML_DEFINITIONS} ${PYTHON_DEFINITIONS} ${HDF5_DEFINITIONS} ${BOOST_DEFINITIONS} ${CAS_DEFINITIONS} ${CORBA_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+
+IF(ENABLE_TESTRECORDER)
+ SET(COMMON_FLAGS "${COMMON_FLAGS} -DENABLE_TESTRECORDER ${TESTRECORDER_DEFINITIONS}")
+ SET(COMMON_LIBS ${COMMON_LIBS} ${TESTRECORDER_LIBS})
+ENDIF(ENABLE_TESTRECORDER)
+
+SET(SalomeSession_SOURCES
+ Session_Session_i.cxx
+ Session_ServerThread.cxx
+ Session_ServerLauncher.cxx
+ Session_ServerCheck.cxx
+ SalomeApp_Engine_i.cxx
+)
+ADD_LIBRARY(SalomeSession SHARED ${SalomeSession_SOURCES})
+SET_TARGET_PROPERTIES(SalomeSession PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}")
+TARGET_LINK_LIBRARIES(SalomeSession ${COMMON_LIBS})
+INSTALL(TARGETS SalomeSession DESTINATION ${GUI_salomelib_LIBS})
+
+SET(SALOME_Session_Server_LIBS
+ ${COMMON_LIBS}
+ ${SalomeContainer}
+ ${SalomeResourcesManager}
+ ${TOOLSDS}
+ ${SalomeHDFPersist}
+ ${SalomeDSImpl}
+ ${SalomeGenericObj}
+ ${Registry}
+ ${SalomeNotification}
+ ${SALOMEBasics}
+ ${SalomeLauncher}
+ qtx
+ SalomeIDLGUI
+ SalomeSession
+ ${HDF5_LIBS}
+ ${PYTHON_LIBS}
+ ${OMNIORB_LIBS}
+)
+ADD_EXECUTABLE(SALOME_Session_Server SALOME_Session_Server.cxx)
+SET_TARGET_PROPERTIES(SALOME_Session_Server PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}")
+TARGET_LINK_LIBRARIES(SALOME_Session_Server ${SALOME_Session_Server_LIBS})
+INSTALL(TARGETS SALOME_Session_Server DESTINATION ${GUI_salomebin_BINS})
+
+SET(COMMON_HEADERS_H
+ Session_Session_i.hxx
+ SALOME_Session.hxx
+ Session_ServerLauncher.hxx
+ Session_ServerThread.hxx
+ Session_ServerCheck.hxx
+ SalomeApp_Engine_i.hxx
+)
+INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${GUI_salomeinclude_HEADERS})
virtual long userFileId( const QString& _fname ) const
{
+ //////////////////////////////////////////////////////////////////////////////////////////////
+ // In SALOME and SALOME-based applications the user preferences file is named as
+ // - <AppName>.xml.<AppVersion> on Windows
+ // - <AppName>rc.<AppVersion> on Linux
+ // where
+ // * AppName is application name, default SalomeApp (can be customized in SALOME-based
+ // applications
+ // * AppVersion is application version
+ //
+ // Since version 6.5.0 of SALOME, user file is situated in the ~/.config/salome
+ // directory. For backward compatibility, when user preferences from nearest
+ // version of application is searched, user home directory is also looked through,
+ // with lower priority.
+ //
+ // Since version 6.6.0 of SALOME, user file name on Linux is no more prefixed by dot
+ // symbol since it is situated in hidden ~/.config/salome directory. Files with dot
+ // prefix also though taken into account (with lower priority) for backward compatibility.
+ //
+ // Notes:
+ // - Currently the following format of version number is supported:
+ // <major>[.<minor>[.<release>[<type><dev>]]]
+ // Parts in square brackets are considered optional. Here:
+ // * major - major version id
+ // * minor - minor version id
+ // * release - maintenance version id
+ // * type - dev or patch marker; it can be either one alphabetical symbol (from 'a' to 'z')
+ // or 'rc' to point release candidate (case-insensitive)
+ // * dev - dev version or patch number
+ // All numerical values must be of range [1-99].
+ // Examples: 1.0, 6.5.0, 1.2.0a1, 3.3.3rc3 (release candidate 3), 11.0.0p1 (patch 1)
+ //
+ // - Versioning approach can be customized by implementing and using own resource manager class,
+ // see QtxResurceMgr, SUIT_ResourceMgr classes.
+ //////////////////////////////////////////////////////////////////////////////////////////////
long id = -1;
if ( !myExtAppName.isEmpty() ) {
#ifdef WIN32
- QRegExp exp( QString( "%1\\.%2\\.([a-zA-Z0-9.]+)$" ).arg( myExtAppName ).arg( currentFormat() ) );
+ // On Windows, user file name is something like SalomeApp.xml.6.5.0 where
+ // - SalomeApp is an application name (can be customized)
+ // - xml is a file format (xml or ini)
+ // - 6.5.0 is an application version, can include alfa/beta/rc marks, e.g. 6.5.0a3, 6.5.0rc1
+ QRegExp exp( QString( "%1\\.%2\\.([a-zA-Z0-9.]+)" ).arg( myExtAppName ).arg( currentFormat() ) );
#else
- QRegExp exp( QString( "\\.%1rc\\.([a-zA-Z0-9.]+)$" ).arg( myExtAppName ) );
+ // On Linux, user file name is something like SalomeApprc.6.5.0 where
+ // - SalomeApp is an application name (can be customized)
+ // - 6.5.0 is an application version, can include alfa/beta/rc marks, e.g. 6.5.0a3, 6.5.0rc1
+
+ // VSR 24/09/2012: issue 0021781: since version 6.6.0 user filename is not prepended with "."
+ // when it is stored in the ~/.config/<appname> directory;
+ // for backward compatibility we also check files prepended with "." with lower priority
+ QRegExp exp( QString( "\\.?%1rc\\.([a-zA-Z0-9.]+)" ).arg( myExtAppName ) );
#endif
- QRegExp vers_exp( "^([0-9]+)([A-Za-z]?)([0-9]*)$" );
+ QRegExp vers_exp( "^([0-9]+)([A-Z]|RC)?([0-9]*)", Qt::CaseInsensitive );
QString fname = QFileInfo( _fname ).fileName();
if( exp.exactMatch( fname ) ) {
if ( vers.count() > 0 ) major = vers[0].toInt();
if ( vers.count() > 1 ) minor = vers[1].toInt();
if ( vers.count() > 2 ) {
- if( vers_exp.indexIn( vers[2] ) != -1 ) {
+ if ( vers_exp.indexIn( vers[2] ) != -1 ) {
release = vers_exp.cap( 1 ).toInt();
- dev1 = vers_exp.cap( 2 )[ 0 ].toLatin1();
- dev2 = vers_exp.cap( 3 ).toInt();
+ QString tag = vers_exp.cap( 2 ).toLower();
+ if ( !tag.isEmpty() ) {
+ if ( tag == "rc" ) // release candidate
+ dev1 = 49; // 'rc'=49
+ else // a, b, c, ...
+ dev1 = (int)( tag[ 0 ].toLatin1() ) - (int)( QChar('a').toLatin1() ) + 1; // 'a'=1, 'b'=2, ..., 'z'=26
+ }
+ if ( !vers_exp.cap( 3 ).isEmpty() )
+ dev2 = vers_exp.cap( 3 ).toInt();
}
}
id*=100; id+=minor;
id*=100; id+=release;
id*=10000;
- if ( dev > 0 ) id+=dev-10000;
+ if ( dev > 0 ) id-=dev;
}
}
return id;
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/UseQT4EXT.cmake)
+
+INCLUDE_DIRECTORIES(
+ ${QT_INCLUDE_DIRS}
+ ${KERNEL_ROOT_DIR}/include/salome
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Qtx
+)
+
+SET(COMMON_FLAGS "${QT_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+SET(COMMON_LIBS ${QT_MT_LIBS} qtx)
+
+SET(GUI_HEADERS
+ Style_PrefDlg.h
+ Style_Salome.h
+)
+QT4_WRAP_CPP(GUI_HEADERS_MOC ${GUI_HEADERS})
+
+SET(RCCS Style.qrc)
+QT4_ADD_RESOURCES(RCC_SRCS ${RCCS})
+
+SET(SalomeStyle_SOURCES
+ Style.h
+ Style_Model.h
+ Style_PrefDlg.h
+ Style_Salome.h
+ Style_Tools.h
+ Style_ResourceMgr.h
+ Style_Model.cxx
+ Style_PrefDlg.cxx
+ Style_ResourceMgr.cxx
+ Style_Salome.cxx
+ Style_Tools.cxx
+)
+
+SET(GUITS_SOURCES
+ resources/Style_msg_fr.ts
+)
+
+ADD_LIBRARY(SalomeStyle SHARED ${SalomeStyle_SOURCES} ${GUI_HEADERS_MOC} ${RCC_SRCS})
+SET_TARGET_PROPERTIES(SalomeStyle PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}")
+TARGET_LINK_LIBRARIES(SalomeStyle ${COMMON_LIBS})
+INSTALL(TARGETS SalomeStyle DESTINATION ${GUI_salomelib_LIBS})
+
+SET(COMMON_HEADERS_H
+ Style.h
+ Style_PrefDlg.h
+ Style_Salome.h
+)
+
+INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${GUI_salomeinclude_HEADERS})
+QT4_INSTALL_TS_RESOURCES("${GUITS_SOURCES}" "${GUI_salomeres_DATA}")
+
+INSTALL(FILES resources/SalomeStyle.xml DESTINATION ${GUI_salomeres_DATA})
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/UseQT4EXT.cmake)
+
+INCLUDE_DIRECTORIES(
+ ${CAS_INCLUDE_DIRS}
+ ${QT_INCLUDE_DIRS}
+ ${OMNIORB_INCLUDE_DIRS}
+ ${BOOST_INCLUDE_DIRS}
+ ${PTHREAD_INCLUDE_DIRS}
+ ${KERNEL_ROOT_DIR}/include/salome
+ ${CMAKE_BINARY_DIR}/idl
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Qtx
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SUIT)
+
+SET(COMMON_LIBS
+ ${QT_MT_LIBS}
+ suit
+ ${CAS_KERNEL}
+ ${SalomeIDLKernel}
+ ${SALOMELocalTrace}
+ ${SalomeNS}
+ ${OpUtil}
+ SalomeIDLGUI
+)
+
+SET(GUI_HEADERS ToolsGUI_CatalogGeneratorDlg.h ToolsGUI_RegWidget.h)
+QT4_WRAP_CPP(GUI_HEADERS ${GUI_HEADERS})
+SET(ToolsGUI_SOURCES
+ ToolsGUI_CatalogGeneratorDlg.cxx
+ ToolsGUI_RegWidget.cxx
+ ToolsGUI.cxx
+)
+
+SET(GUITS_SOURCES
+ resources/ToolsGUI_msg_en.ts
+ resources/ToolsGUI_msg_fr.ts
+)
+
+ADD_LIBRARY(ToolsGUI SHARED ${ToolsGUI_SOURCES} ${GUI_HEADERS})
+SET_TARGET_PROPERTIES(ToolsGUI PROPERTIES COMPILE_FLAGS "${QT_DEFINITIONS} ${CAS_DEFINITIONS} ${BOOST_DEFINITIONS} ${OMNIORB_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+TARGET_LINK_LIBRARIES(ToolsGUI ${COMMON_LIBS})
+INSTALL(TARGETS ToolsGUI DESTINATION ${GUI_salomelib_LIBS})
+
+FILE(GLOB COMMON_HEADERS_H "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
+INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${GUI_salomeinclude_HEADERS})
+QT4_INSTALL_TS_RESOURCES("${GUITS_SOURCES}" "${GUI_salomeres_DATA}")
+
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/UseQT4EXT.cmake)
+
+ADD_SUBDIRECTORY(Test)
+
+INCLUDE_DIRECTORIES(
+ ${CAS_INCLUDE_DIRS}
+ ${QT_INCLUDE_DIRS}
+ ${OMNIORB_INCLUDE_DIRS}
+ ${BOOST_INCLUDE_DIRS}
+ ${PTHREAD_INCLUDE_DIRS}
+ ${KERNEL_ROOT_DIR}/include/salome
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SalomeApp
+ ${CMAKE_CURRENT_SOURCE_DIR}/../LightApp
+ ${CMAKE_CURRENT_SOURCE_DIR}/../CAM
+ ${CMAKE_CURRENT_SOURCE_DIR}/../STD
+ ${CMAKE_CURRENT_SOURCE_DIR}/../ObjBrowser
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SUIT
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Qtx
+ ${CMAKE_CURRENT_SOURCE_DIR}/../GuiHelpers
+)
+
+SET(COMMON_FLAGS "${CAS_DEFINITIONS} ${QT_DEFINITIONS} ${BOOST_DEFINITIONS} ${OMNIORB_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+
+SET(COMMON_LIBS
+ ${CORBA_LIBS}
+ ${QT_LIBS}
+ ${KERNEL_LDFLAGS}
+ ${SalomeLifeCycleCORBA}
+ ${SalomeKernelHelpers}
+ SalomeApp
+ LightApp
+ suit
+ qtx
+ CAM
+ std
+ ObjBrowser
+)
+
+SET(GUI_HEADERS TreeModel.hxx TreeView.hxx TreeObserver.hxx)
+QT4_WRAP_CPP(GUI_HEADERS_MOC ${GUI_HEADERS})
+SET(SalomeTreeData_SOURCES
+ DockWidgets.cxx
+ TreeModel.cxx
+ TreeItem.cxx
+ TreeView.cxx
+ TreeObserver.cxx
+ DataModel.cxx
+ DataObject.cxx
+ DataProcessor.cxx
+ TreeGuiManager.cxx
+)
+
+ADD_LIBRARY(SalomeTreeData SHARED ${SalomeTreeData_SOURCES} ${GUI_HEADERS_MOC})
+SET_TARGET_PROPERTIES(SalomeTreeData PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}")
+TARGET_LINK_LIBRARIES(SalomeTreeData ${COMMON_LIBS})
+INSTALL(TARGETS SalomeTreeData DESTINATION ${GUI_salomelib_LIBS})
+
+FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
+INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${GUI_salomeinclude_HEADERS})
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/UseQT4EXT.cmake)
+
+INCLUDE_DIRECTORIES(
+ ${OMNIORB_INCLUDE_DIRS}
+ ${QT_INCLUDE_DIRS}
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${KERNEL_ROOT_DIR}/include/salome
+ ${CMAKE_SOURCE_DIR}/src/GuiHelpers
+ ${CMAKE_SOURCE_DIR}/src/TreeData
+)
+
+SET(COMMON_LIBS
+ ${CORBA_LIBS}
+ ${QT_LIBS}
+ SalomeTreeData
+ SalomeGuiHelpers
+ ${SalomeLifeCycleCORBA}
+ ${SalomeKernelHelpers}
+)
+
+SET(GUI_HEADERS mainwindow.hxx)
+QT4_WRAP_CPP(GUI_HEADERS ${GUI_HEADERS})
+SET(GUI_FORMS mainwindow.ui)
+QT4_WRAP_UI(GUI_FORMS_HEADERS ${GUI_FORMS})
+
+SET(TreeData_guitester_SOURCES
+ testhelper.hxx
+ testhelper.cxx
+ guitester.cxx
+ mainwindow.hxx
+ mainwindow.cxx
+ MyDataModel.hxx
+ MyDataModel.cxx
+)
+
+ADD_EXECUTABLE(TreeData_guitester ${TreeData_guitester_SOURCES} ${GUI_HEADERS} ${GUI_FORMS_HEADERS})
+SET_TARGET_PROPERTIES(TreeData_guitester PROPERTIES COMPILE_FLAGS "${OMNIORB_DEFINITIONS} ${QT_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+TARGET_LINK_LIBRARIES(TreeData_guitester ${COMMON_LIBS})
+
+SET(TreeData_tester_SOURCES
+ tester.cxx
+ MyDataModel.cxx
+)
+
+ADD_EXECUTABLE(TreeData_tester ${TreeData_tester_SOURCES})
+SET_TARGET_PROPERTIES(TreeData_tester PROPERTIES COMPILE_FLAGS "${OMNIORB_DEFINITIONS} ${QT_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+TARGET_LINK_LIBRARIES(TreeData_tester ${COMMON_LIBS})
+
+INSTALL(TARGETS TreeData_guitester TreeData_tester DESTINATION ${GUI_salomebin_BINS})
-Tuyauterie;RF1;T1\r
-Tuyauterie;RF1;T2\r
-Tuyauterie;RF1;T3\r
-Tuyauterie;RF2;T1\r
-Tuyauterie;RF3;T1\r
-Tuyauterie;RF3;T2\r
-Composansts;RF1;T1\r
-Composansts;RF1;T2\r
-Composansts;RF3;T2\r
-Genie Civil;RF1;T1\r
-Genie Civil;RF1;T2\r
-Genie Civil;RF1;T3\r
-Genie Civil;RF2;T1\r
-Genie Civil;RF3;T1\r
-Genie Civil;RF3;T2\r
+Tuyauterie;RF1;T1
+Tuyauterie;RF1;T2
+Tuyauterie;RF1;T3
+Tuyauterie;RF2;T1
+Tuyauterie;RF3;T1
+Tuyauterie;RF3;T2
+Composansts;RF1;T1
+Composansts;RF1;T2
+Composansts;RF3;T2
+Genie Civil;RF1;T1
+Genie Civil;RF1;T2
+Genie Civil;RF1;T3
+Genie Civil;RF2;T1
+Genie Civil;RF3;T1
+Genie Civil;RF3;T2
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/UseQT4EXT.cmake)
+
+INCLUDE_DIRECTORIES(
+ ${CAS_INCLUDE_DIRS}
+ ${QT_INCLUDE_DIRS}
+ ${VTK_INCLUDE_DIRS}
+ ${PTHREAD_INCLUDE_DIRS}
+ ${KERNEL_ROOT_DIR}/include/salome
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Qtx
+ ${CMAKE_CURRENT_SOURCE_DIR}/../SUIT
+)
+
+SET(COMMON_FLAGS "${VTK_DEFINITIONS} ${CAS_DEFINITIONS} ${QT_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+SET(COMMON_LIBS ${QT_MT_LIBS} ${OGL_LIBS} ${VTK_LIBS} ${CAS_KERNEL} qtx suit ${SALOMELocalTrace})
+
+SET(GUI_HEADERS
+ VTKViewer_RenderWindow.h
+ VTKViewer_RenderWindowInteractor.h
+ VTKViewer_ViewManager.h
+ VTKViewer_ViewModel.h
+ VTKViewer_ViewWindow.h
+ VTKViewer_MarkerWidget.h
+ VTKViewer_MarkerDlg.h
+)
+QT4_WRAP_CPP(GUI_HEADERS_MOC ${GUI_HEADERS})
+
+SET(RCCS VTKViewer.qrc)
+QT4_ADD_RESOURCES(RCC_SRCS ${RCCS})
+
+SET(VTKViewer_SOURCES
+ VTKViewer_CellLocationsArray.cxx
+ VTKViewer_Actor.cxx
+ VTKViewer_FramedTextActor.cxx
+ VTKViewer_ExtractUnstructuredGrid.cxx
+ VTKViewer_Filter.cxx
+ VTKViewer_GeometryFilter.cxx
+ VTKViewer_AppendFilter.cxx
+ VTKViewer_Algorithm.cxx
+ VTKViewer_InteractorStyle.cxx
+ VTKViewer_RenderWindow.cxx
+ VTKViewer_RenderWindowInteractor.cxx
+ VTKViewer_ShrinkFilter.cxx
+ VTKViewer_Transform.cxx
+ VTKViewer_TransformFilter.cxx
+ VTKViewer_Trihedron.cxx
+ VTKViewer_Utilities.cxx
+ VTKViewer_ViewManager.cxx
+ VTKViewer_ViewModel.cxx
+ VTKViewer_ConvexTool.cxx
+ VTKViewer_ViewWindow.cxx
+ VTKViewer_ArcBuilder.cxx
+ VTKViewer_MarkerUtils.cxx
+ VTKViewer_MarkerWidget.cxx
+ VTKViewer_MarkerDlg.cxx
+ VTKViewer_PolyDataMapper.cxx
+ VTKViewer_DataSetMapper.cxx
+ VTKViewer_Texture.cxx
+ VTKViewer_OpenGLRenderer.cxx
+ VTKViewer_CellCenters.cxx
+)
+
+SET(GUITS_SOURCES
+ resources/VTKViewer_images.ts
+ resources/VTKViewer_msg_en.ts
+ resources/VTKViewer_msg_fr.ts
+)
+
+ADD_LIBRARY(VTKViewer SHARED ${VTKViewer_SOURCES} ${GUI_HEADERS_MOC} ${RCC_SRCS})
+SET_TARGET_PROPERTIES(VTKViewer PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}")
+TARGET_LINK_LIBRARIES(VTKViewer ${COMMON_LIBS})
+INSTALL(TARGETS VTKViewer DESTINATION ${GUI_salomelib_LIBS})
+
+#ADD_EXECUTABLE(TestVTKViewer VTKViewer.cxx)
+#SET_TARGET_PROPERTIES(TestVTKViewer PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}" OUTPUT_NAME "VTKViewer")
+#TARGET_LINK_LIBRARIES(TestVTKViewer VTKViewer ${COMMON_LIBS})
+#INSTALL(TARGETS TestVTKViewer DESTINATION ${GUI_salomebin_BINS})
+
+SET(COMMON_HEADERS_H
+ VTKViewer.h
+ VTKViewer_CellLocationsArray.h
+ VTKViewer_Actor.h
+ VTKViewer_FramedTextActor.h
+ VTKViewer_ExtractUnstructuredGrid.h
+ VTKViewer_ConvexTool.h
+ VTKViewer_Filter.h
+ VTKViewer_GeometryFilter.h
+ VTKViewer_AppendFilter.h
+ VTKViewer_Algorithm.h
+ VTKViewer_InteractorStyle.h
+ VTKViewer_RenderWindow.h
+ VTKViewer_RenderWindowInteractor.h
+ VTKViewer_ShrinkFilter.h
+ VTKViewer_TransformFilter.h
+ VTKViewer_Transform.h
+ VTKViewer_Trihedron.h
+ VTKViewer_Utilities.h
+ VTKViewer_ViewManager.h
+ VTKViewer_ViewModel.h
+ VTKViewer_ViewWindow.h
+ VTKViewer_Functor.h
+ VTKViewer_ArcBuilder.h
+ VTKViewer_MarkerDef.h
+ VTKViewer_MarkerUtils.h
+ VTKViewer_MarkerWidget.h
+ VTKViewer_MarkerDlg.h
+ VTKViewer_PolyDataMapper.h
+ VTKViewer_DataSetMapper.h
+ VTKViewer_Texture.h
+ VTKViewer_OpenGLRenderer.h
+ VTKViewer_CellCenters.h
+)
+
+INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${GUI_salomeinclude_HEADERS})
+QT4_INSTALL_TS_RESOURCES("${GUITS_SOURCES}" "${GUI_salomeres_DATA}")
+
+FILE(GLOB GUIPNG_DATA "${CMAKE_CURRENT_SOURCE_DIR}/resources/*.png")
+INSTALL(FILES ${GUIPNG_DATA} DESTINATION ${GUI_salomeres_DATA})
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+// File : VTKViewer_MarkerDlg.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
#include "VTKViewer_MarkerDlg.h"
#include "VTKViewer_MarkerWidget.h"
#include <SUIT_Session.h>
#include <QFrame>
-#include <QHBoxLayout>
+#include <QVBoxLayout>
#include <QKeyEvent>
/*!
- * Class : VTKViewer_MarkerDlg
- * Description : Dialog for specifying point marker parameters
- */
+ \class VTKViewer_MarkerDlg
+ \brief Dialog for specifying of point marker parameters
+*/
/*!
- Constructor
+ \brief Constructor
+ \param parent parent widget
*/
-VTKViewer_MarkerDlg::VTKViewer_MarkerDlg( QWidget* theParent )
-: QtxDialog( theParent, true, true )
+VTKViewer_MarkerDlg::VTKViewer_MarkerDlg( QWidget* parent )
+: QtxDialog( parent, true, true )
{
+ // set title
setWindowTitle( tr( "SET_MARKER_TLT" ) );
- myMarkerWidget = new VTKViewer_MarkerWidget( mainFrame() );
+ // create widgets
+ QFrame* frame = new QFrame( mainFrame() );
+ frame->setFrameStyle( QFrame::Sunken | QFrame::Box );
+ myMarkerWidget = new VTKViewer_MarkerWidget( frame );
+
+ // layoting
+ QBoxLayout* vl = new QVBoxLayout( frame );
+ vl->setSpacing( 6 ) ;
+ vl->setMargin( 11 );
+ vl->addWidget( myMarkerWidget );
- QBoxLayout* aTopLayout = new QHBoxLayout( mainFrame() );
- aTopLayout->setSpacing( 0 );
- aTopLayout->setMargin( 0 );
- aTopLayout->addWidget( myMarkerWidget );
+ QBoxLayout* topLayout = new QVBoxLayout( mainFrame() );
+ topLayout->setSpacing( 0 ) ;
+ topLayout->setMargin( 0 );
+ topLayout->addWidget( frame );
+ // connect signals / slots
connect( this, SIGNAL( dlgHelp() ), this, SLOT( onHelp() ) );
}
/*!
- Destructor
+ \brief Destructor
*/
VTKViewer_MarkerDlg::~VTKViewer_MarkerDlg()
{
}
-void VTKViewer_MarkerDlg::setHelpData( const QString& theModuleName,
- const QString& theHelpFileName )
+/*!
+ \brief Associate documentation page with the dialog box
+ \param module module name
+ \param helpFile reference help file
+*/
+void VTKViewer_MarkerDlg::setHelpData( const QString& module,
+ const QString& helpFile )
{
- myModuleName = theModuleName;
- myHelpFileName = theHelpFileName;
+ myModule = module;
+ myHelpFile = helpFile;
}
+/*!
+ \brief Process key press event
+ \param e key press event
+*/
void VTKViewer_MarkerDlg::keyPressEvent( QKeyEvent* e )
{
QtxDialog::keyPressEvent( e );
if ( e->isAccepted() )
return;
+ // invoke Help on <F1> key presss
if ( e->key() == Qt::Key_F1 ) {
e->accept();
onHelp();
}
}
+/*!
+ \brief Activate help for the dialog box
+*/
void VTKViewer_MarkerDlg::onHelp()
{
- if( myModuleName.isNull() || myHelpFileName.isNull() )
- return;
-
- SUIT_Application* app = SUIT_Session::session()->activeApplication();
- if (app)
- app->onHelpContextModule(myModuleName, myHelpFileName);
- else {
- QString platform;
-#ifdef WIN32
- platform = "winapplication";
-#else
- platform = "application";
-#endif
- SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- platform)).
- arg(myHelpFileName));
+ if ( !myModule.isEmpty() && !myHelpFile.isEmpty() ) {
+ SUIT_Session::session()->activeApplication()->onHelpContextModule( myModule, myHelpFile );
}
}
-void VTKViewer_MarkerDlg::setCustomMarkerMap( VTK::MarkerMap theMarkerMap )
+/*!
+ \brief Set custom markers data
+ \param markerMap custom marker data (a map {index:texture})
+*/
+void VTKViewer_MarkerDlg::setCustomMarkers( const VTK::MarkerMap& markerMap )
{
- myMarkerWidget->setCustomMarkerMap( theMarkerMap );
+ myMarkerWidget->setCustomMarkers( markerMap );
}
-VTK::MarkerMap VTKViewer_MarkerDlg::getCustomMarkerMap()
+/*!
+ \brief Get custom markers data
+ \return custom marker data
+*/
+VTK::MarkerMap VTKViewer_MarkerDlg::customMarkers() const
{
- return myMarkerWidget->getCustomMarkerMap();
+ return myMarkerWidget->customMarkers();
}
-void VTKViewer_MarkerDlg::setStandardMarker( VTK::MarkerType theMarkerType, VTK::MarkerScale theMarkerScale )
+/*!
+ \brief Add standard marker
+ The marker type specified with \a type must be > VTK::MT_USER
+ \param type marker type
+ \param icon marker icon
+*/
+void VTKViewer_MarkerDlg::addMarker( VTK::MarkerType type, const QPixmap& icon )
{
- myMarkerWidget->setStandardMarker( theMarkerType, theMarkerScale );
+ myMarkerWidget->addMarker( type, icon );
}
-void VTKViewer_MarkerDlg::setCustomMarker( int theId )
+/*!
+ \brief Select specified standard marker as current one
+ \param type marker type
+ \param scale marker scale (optional parameter; can be omitted for extended markers)
+*/
+void VTKViewer_MarkerDlg::setMarker( VTK::MarkerType type, VTK::MarkerScale scale )
{
- myMarkerWidget->setCustomMarker( theId );
+ myMarkerWidget->setMarker( type, scale );
}
-VTK::MarkerType VTKViewer_MarkerDlg::getMarkerType() const
+/*!
+ \brief Select specified custom marker as current one
+ \param id custom marker identifier
+*/
+void VTKViewer_MarkerDlg::setCustomMarker( int id )
{
- return myMarkerWidget->getMarkerType();
+ myMarkerWidget->setCustomMarker( id );
}
-VTK::MarkerScale VTKViewer_MarkerDlg::getStandardMarkerScale() const
+/*!
+ \brief Get current marker's type.
+ For custom marker, VTK::MT_USER is returned and markerId() function
+ then returns its identifier.
+ \return currently selected marker type
+*/
+VTK::MarkerType VTKViewer_MarkerDlg::markerType() const
{
- return myMarkerWidget->getStandardMarkerScale();
+ return myMarkerWidget->markerType();
}
-int VTKViewer_MarkerDlg::getCustomMarkerID() const
+/*!
+ \brief Get current marker's scale size.
+ For custom marker return value is undefined.
+ \return currently selected marker scale size
+*/
+VTK::MarkerScale VTKViewer_MarkerDlg::markerScale() const
{
- return myMarkerWidget->getCustomMarkerID();
+ return myMarkerWidget->markerScale();
}
-void VTKViewer_MarkerDlg::addExtraStdMarker( VTK::MarkerType theMarkerType, const QPixmap& thePixmap )
+/*!
+ \bried Get currently selected custom marker's identifier.
+ For standard markers return value is VTK::MT_NONE.
+*/
+int VTKViewer_MarkerDlg::markerId() const
{
- myMarkerWidget->addExtraStdMarker( theMarkerType, thePixmap );
+ return myMarkerWidget->markerId();
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+// File : VTKViewer_MarkerDlg.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
#ifndef VTKVIEWER_MARKERDLG_H
#define VTKVIEWER_MARKERDLG_H
class VTKViewer_MarkerWidget;
-/*!
- * Class : VTKViewer_MarkerDlg
- * Description : Dialog for specifying point marker parameters
- */
class VTKVIEWER_EXPORT VTKViewer_MarkerDlg : public QtxDialog
{
Q_OBJECT
void setHelpData( const QString& theModuleName,
const QString& theHelpFileName );
- void setCustomMarkerMap( VTK::MarkerMap );
- VTK::MarkerMap getCustomMarkerMap();
+ void setCustomMarkers( const VTK::MarkerMap& );
+ VTK::MarkerMap customMarkers() const;
+ void addMarker( VTK::MarkerType, const QPixmap& );
- void setStandardMarker( VTK::MarkerType, VTK::MarkerScale );
+ void setMarker( VTK::MarkerType, VTK::MarkerScale );
void setCustomMarker( int );
- VTK::MarkerType getMarkerType() const;
- VTK::MarkerScale getStandardMarkerScale() const;
- int getCustomMarkerID() const;
-
- void addExtraStdMarker( VTK::MarkerType, const QPixmap& );
+ VTK::MarkerType markerType() const;
+ VTK::MarkerScale markerScale() const;
+ int markerId() const;
protected:
void keyPressEvent( QKeyEvent* );
private:
VTKViewer_MarkerWidget* myMarkerWidget;
-
- QString myModuleName;
- QString myHelpFileName;
+ QString myModule;
+ QString myHelpFile;
};
#endif
theImageData->GetExtent( extent );
int width = extent[1] - extent[0] + 1;
int height = extent[3] - extent[2] + 1;
+
+ const int wmin = 20;
+ const int hmin = 20;
+
+ int xshift = width < wmin ? (wmin-width)/2 : 0;
+ int yshift = height < hmin ? (hmin-height)/2 : 0;
- QImage anImage(width, height, QImage::Format_ARGB32);
+ QImage anImage(width < wmin ? wmin : width, height < hmin ? hmin : height, QImage::Format_ARGB32);
+ anImage.fill(qRgba(255,255,255,0));
for( int i = 0; i < height; i++ )
{
- QRgb* bits = reinterpret_cast<QRgb*>( anImage.scanLine(i) );
+ QRgb* bits = reinterpret_cast<QRgb*>( anImage.scanLine(i+yshift) );
unsigned char* row = static_cast<unsigned char*>(
theImageData->GetScalarPointer( extent[0], extent[2] + height - i - 1, extent[4] ) );
for( int j = 0; j < width; j++ )
{
unsigned char* data = &row[ j*4 ];
- bits[j] = qRgba( data[0], data[1], data[2], data[3] );
+ bits[j+xshift] = qRgba( data[0], data[1], data[2], data[3] );
}
}
return anImage;
#include "VTKViewer_MarkerWidget.h"
#include "VTKViewer_MarkerUtils.h"
-#include <QtxComboBox.h>
-
#include <SUIT_ResourceMgr.h>
#include <SUIT_Session.h>
#include <vtkImageData.h>
-#include <QButtonGroup>
-#include <QGridLayout>
+#include <QComboBox>
#include <QHBoxLayout>
#include <QLabel>
-#include <QPushButton>
-#include <QRadioButton>
-#include <QStackedWidget>
+#include <QSpinBox>
-#define MARGIN 9
-#define SPACING 6
+const int SPACING = 6;
+enum { TypeRole = Qt::UserRole, IdRole };
/*!
- * Class : VTKViewer_MarkerWidget
- * Description : Widget for specifying point marker parameters
- */
+ \class VTKViewer_MarkerWidget
+ \brief Widget for specifying point marker parameters
+*/
/*!
- Constructor
+ \brief Constructor
+ \param parent parent widget
*/
-VTKViewer_MarkerWidget::VTKViewer_MarkerWidget( QWidget* theParent )
-: QWidget( theParent )
+VTKViewer_MarkerWidget::VTKViewer_MarkerWidget( QWidget* parent )
+ : QWidget( parent ), myCurrentIdx( -1 )
{
- QRadioButton* aStandardTypeRB = new QRadioButton( tr( "STANDARD_MARKER" ), this );
- QRadioButton* aCustomTypeRB = new QRadioButton( tr( "CUSTOM_MARKER" ), this );
- myTypeGroup = new QButtonGroup( this );
- myTypeGroup->addButton( aStandardTypeRB, 0 );
- myTypeGroup->addButton( aCustomTypeRB, 1 );
-
- QHBoxLayout* aRadioLayout = new QHBoxLayout;
- aRadioLayout->setMargin( 0 );
- aRadioLayout->setSpacing( SPACING );
- aRadioLayout->addWidget( aStandardTypeRB );
- aRadioLayout->addWidget( aCustomTypeRB );
-
- // ---
-
- myWGStack = new QStackedWidget( this );
- myWGStack->setFrameStyle( QFrame::Box | QFrame::Sunken );
-
- // ---
-
- QWidget* aStdWidget = new QWidget( myWGStack );
-
- QLabel* aTypeLab = new QLabel( tr( "TYPE" ), aStdWidget );
- QLabel* aScaleLab = new QLabel( tr( "SCALE" ), aStdWidget );
-
- myStdTypeCombo = new QtxComboBox( aStdWidget );
- myStdScaleCombo = new QtxComboBox( aStdWidget );
-
- QGridLayout* aStdLayout = new QGridLayout;
- aStdLayout->setMargin( MARGIN );
- aStdLayout->setSpacing( SPACING );
- aStdLayout->addWidget( aTypeLab, 0, 0 );
- aStdLayout->addWidget( myStdTypeCombo, 0, 1 );
- aStdLayout->addWidget( aScaleLab, 1, 0 );
- aStdLayout->addWidget( myStdScaleCombo, 1, 1 );
- aStdWidget->setLayout( aStdLayout );
-
- // ---
-
- QWidget* aCustomWidget = new QWidget( myWGStack );
-
- QLabel* aCustomLab = new QLabel( tr( "CUSTOM" ), aCustomWidget );
- myCustomTypeCombo = new QtxComboBox( aCustomWidget );
- QPushButton* aBrowseBtn = new QPushButton( tr( "BROWSE" ), aCustomWidget );
-
- QGridLayout* aCustomLayout = new QGridLayout;
- aCustomLayout->setMargin( MARGIN );
- aCustomLayout->setSpacing( SPACING );
- aCustomLayout->addWidget( aCustomLab, 0, 0 );
- aCustomLayout->addWidget( myCustomTypeCombo, 0, 1 );
- aCustomLayout->addWidget( aBrowseBtn, 0, 2 );
- aCustomLayout->setRowStretch( 1, 5 );
- aCustomWidget->setLayout( aCustomLayout );
-
- // ---
-
- myWGStack->insertWidget( 0, aStdWidget );
- myWGStack->insertWidget( 1, aCustomWidget );
-
- // ---
-
- QVBoxLayout* aTopLayout = new QVBoxLayout;
- aTopLayout->setMargin( MARGIN );
- aTopLayout->setSpacing( SPACING );
- aTopLayout->addLayout( aRadioLayout );
- aTopLayout->addWidget( myWGStack );
- setLayout( aTopLayout );
-
- // ---
-
- connect( myTypeGroup, SIGNAL( buttonClicked( int ) ), myWGStack, SLOT( setCurrentIndex( int ) ) );
- connect( myStdTypeCombo, SIGNAL( currentIndexChanged( int ) ), this, SLOT( onStdMarkerChanged( int ) ) );
- connect( aBrowseBtn, SIGNAL( clicked() ), this, SLOT( onBrowse() ) );
-
- // ---
-
- aStandardTypeRB->setChecked( true );
+ // create widgets
+ myTypeLab = new QLabel( tr( "TYPE" ), this );
+ myScaleLab = new QLabel( tr( "SCALE" ), this );
+ myType = new QComboBox( this );
+ myScale = new QSpinBox( this );
+ // layouting
+ QHBoxLayout* ml = new QHBoxLayout( this );
+ ml->setMargin( 0 );
+ ml->setSpacing( SPACING );
+ ml->addWidget( myTypeLab );
+ ml->addWidget( myType );
+ ml->addWidget( myScaleLab );
+ ml->addWidget( myScale );
+ myType->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ myScale->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ // connect signals/slots
+ connect( myType, SIGNAL( currentIndexChanged( int ) ), this, SLOT( onTypeChanged( int ) ) );
+ // initialize
init();
}
/*!
- Destructor
+ \brief Destructor
*/
VTKViewer_MarkerWidget::~VTKViewer_MarkerWidget()
{
}
-void VTKViewer_MarkerWidget::setCustomMarkerMap( VTK::MarkerMap theMarkerMap )
+/*!
+ \brief Set custom markers data
+ \param markerMap custom marker data (a map {index:texture})
+*/
+void VTKViewer_MarkerWidget::setCustomMarkers( const VTK::MarkerMap& markerMap )
{
- myCustomMarkerMap = theMarkerMap;
-
- VTK::MarkerMap::const_iterator it = theMarkerMap.begin(), itEnd = theMarkerMap.end();
- for( ; it != itEnd; it++ )
+ // store custom markers data
+ myCustomMarkers = markerMap;
+ // clear current custom markers
+ for ( int i = myType->count()-1; i >= 0; i-- ) {
+ int type = myType->itemData( i, TypeRole ).toInt();
+ if ( type == VTK::MT_USER )
+ myType->removeItem( i );
+ }
+ // add custom markers
+ VTK::MarkerMap::const_iterator it;
+ for ( it = myCustomMarkers.begin(); it != myCustomMarkers.end(); ++it )
{
- int anId = it->first;
- VTK::MarkerData aMarkerData = it->second;
- QPixmap aPixmap = markerFromData( aMarkerData );
- if( !aPixmap.isNull() )
+ int id = it->first;
+ VTK::MarkerData markerData = it->second;
+ QPixmap icon = markerFromData( markerData );
+ if( !icon.isNull() )
{
- myCustomTypeCombo->addItem( aPixmap, QString::number( anId ) );
- myCustomTypeCombo->setId( myCustomTypeCombo->count()-1, anId );
+ int idx = myType->count()-1;
+ myType->insertItem( idx, icon, QString() );
+ myType->setItemData( idx, VTK::MT_USER, TypeRole );
+ myType->setItemData( idx, id, IdRole );
}
}
}
-VTK::MarkerMap VTKViewer_MarkerWidget::getCustomMarkerMap()
+/*!
+ \brief Get custom markers data
+ \return custom marker data
+*/
+VTK::MarkerMap VTKViewer_MarkerWidget::customMarkers() const
{
- return myCustomMarkerMap;
+ return myCustomMarkers;
}
-void VTKViewer_MarkerWidget::setStandardMarker( VTK::MarkerType theMarkerType, VTK::MarkerScale theMarkerScale )
+/*!
+ \brief Add standard marker
+ The marker type specified with \a type must be > VTK::MT_USER
+ \param type marker type
+ \param icon marker icon
+*/
+void VTKViewer_MarkerWidget::addMarker( VTK::MarkerType type, const QPixmap& icon )
{
- if ( ( theMarkerType > VTK::MT_NONE && theMarkerType < VTK::MT_USER ) ||
- myExtraMarkerList.contains( theMarkerType ) ) {
- myTypeGroup->button( 0 )->setChecked( true );
- myWGStack->setCurrentIndex( 0 );
- myStdTypeCombo->setCurrentId( theMarkerType );
- int aMarkerScale = std::max( (int)VTK::MS_10, std::min( (int)VTK::MS_70, (int)theMarkerScale ) );
- myStdScaleCombo->setCurrentId( aMarkerScale );
+ if ( type > VTK::MT_USER ) {
+ int idx = (int)VTK::MT_USER - 1;
+ // find insertion index
+ while ( idx < myType->count()-1 ) {
+ if ( myType->itemData( idx, TypeRole ) == VTK::MT_USER )
+ break;
+ ++idx;
+ }
+ myType->insertItem( idx, icon, QString() );
+ myType->setItemData( idx, type, TypeRole );
}
}
-void VTKViewer_MarkerWidget::setCustomMarker( int theId )
+/*!
+ \brief Select specified standard marker as current one
+ \param type marker type
+ \param scale marker scale (optional parameter; can be omitted for extended markers)
+*/
+void VTKViewer_MarkerWidget::setMarker( VTK::MarkerType type, VTK::MarkerScale scale )
{
- if ( theId > 0 ) {
- myTypeGroup->button( 1 )->setChecked( true );
- myWGStack->setCurrentIndex( 1 );
- addTexture( theId );
- myCustomTypeCombo->setCurrentId( theId );
+ if ( type != VTK::MT_USER ) {
+ for ( int i = 0; i < myType->count()-1; i++ ) {
+ if ( type == myType->itemData( i, TypeRole ).toInt() ) {
+ myType->setCurrentIndex( i );
+ break;
+ }
+ }
}
+ if ( scale != VTK::MS_NONE )
+ myScale->setValue( qMax( (int)VTK::MS_10, qMin( (int)VTK::MS_70, (int)scale ) ) );
}
-VTK::MarkerType VTKViewer_MarkerWidget::getMarkerType() const
+/*!
+ \brief Select specified custom marker as current one
+ \param id custom marker identifier
+*/
+void VTKViewer_MarkerWidget::setCustomMarker( int id )
{
- return myWGStack->currentIndex() == 0 ? (VTK::MarkerType)myStdTypeCombo->currentId() : VTK::MT_USER;
+ for ( int i = 0; i < myType->count()-1; i++ ) {
+ int type = myType->itemData( i, TypeRole ).toInt();
+ if ( type == VTK::MT_USER && id == myType->itemData( i, IdRole ).toInt() ) {
+ myType->setCurrentIndex( i );
+ break;
+ }
+ }
}
-VTK::MarkerScale VTKViewer_MarkerWidget::getStandardMarkerScale() const
+/*!
+ \brief Get current marker's type.
+ For custom marker, VTK::MT_USER is returned and markerId() function
+ then returns its identifier.
+ \return currently selected marker type
+*/
+VTK::MarkerType VTKViewer_MarkerWidget::markerType() const
{
- return myWGStack->currentIndex() == 0 ? (VTK::MarkerScale)myStdScaleCombo->currentId() : VTK::MS_NONE;
+ return myType->itemData( myType->currentIndex(), TypeRole ).toInt();
}
-int VTKViewer_MarkerWidget::getCustomMarkerID() const
+/*!
+ \brief Get current marker's scale size.
+ For custom marker return value is undefined.
+ \return currently selected marker scale size
+*/
+VTK::MarkerScale VTKViewer_MarkerWidget::markerScale() const
{
- return myWGStack->currentIndex() == 1 ? myCustomTypeCombo->currentId() : 0;
+ return myScale->value();
}
-void VTKViewer_MarkerWidget::addExtraStdMarker( VTK::MarkerType theMarkerType, const QPixmap& thePixmap )
+/*!
+ \bried Get currently selected custom marker's identifier.
+ For standard markers return value is VTK::MT_NONE.
+*/
+int VTKViewer_MarkerWidget::markerId() const
{
- if( myExtraMarkerList.isEmpty() )
- myStdTypeCombo->insertSeparator( myStdTypeCombo->count() );
- myStdTypeCombo->addItem( thePixmap, QString() );
- myStdTypeCombo->setId( myStdTypeCombo->count()-1, theMarkerType );
-
- myExtraMarkerList.append( theMarkerType );
+ int type = myType->itemData( myType->currentIndex(), TypeRole ).toInt();
+ return type == VTK::MT_USER ? myType->itemData( myType->currentIndex(), IdRole ).toInt() : VTK::MT_NONE;
}
-void VTKViewer_MarkerWidget::init()
+/*!
+ \brief Get access to the internal marker type label
+ \return marker type label widget
+*/
+QLabel* VTKViewer_MarkerWidget::typeLabel()
{
- SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
-
- for ( int i = VTK::MT_POINT; i < VTK::MT_USER; i++ ) {
- QString icoFile = QString( "ICON_VERTEX_MARKER_%1" ).arg( i );
- QPixmap pixmap = resMgr->loadPixmap( "VTKViewer", tr( qPrintable( icoFile ) ) );
- myStdTypeCombo->addItem( pixmap, QString() );
- myStdTypeCombo->setId( myStdTypeCombo->count()-1, i );
- }
-
- for ( int i = VTK::MS_10; i <= VTK::MS_70; i++ ) {
- myStdScaleCombo->addItem( QString::number( (i-1)*0.5 + 1.0 ) );
- myStdScaleCombo->setId( myStdScaleCombo->count()-1, i );
- }
+ return myTypeLab;
}
-void VTKViewer_MarkerWidget::addTexture( int id, bool select )
+/*!
+ \brief Get access to the internal marker scale label
+ \return marker scale label widget
+*/
+QLabel* VTKViewer_MarkerWidget::scaleLabel()
{
- if ( id > 0 && myCustomTypeCombo->index( id ) == -1 &&
- myCustomMarkerMap.find( id ) != myCustomMarkerMap.end() ) {
- VTK::MarkerData aMarkerData = myCustomMarkerMap[ id ];
- QPixmap pixmap = markerFromData( aMarkerData );
- if( !pixmap.isNull() ) {
- myCustomTypeCombo->addItem( pixmap, QString::number( id ) );
- myCustomTypeCombo->setId( myCustomTypeCombo->count()-1, id );
- if ( select ) myCustomTypeCombo->setCurrentId( id );
- }
- }
+ return myScaleLab;
}
-QPixmap VTKViewer_MarkerWidget::markerFromData( const VTK::MarkerData& theMarkerData )
+/*!
+ \brief Internal initialization
+*/
+void VTKViewer_MarkerWidget::init()
{
- const VTK::MarkerTexture& aMarkerTexture = theMarkerData.second;
- vtkSmartPointer<vtkImageData> anImageData = VTK::MakeVTKImage( aMarkerTexture, false );
+ myType->blockSignals( true );
- QImage anImage = VTK::ConvertToQImage( anImageData.GetPointer() );
- if( anImage.isNull() )
- return QPixmap();
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+ // standard marker types
+ for ( int type = VTK::MT_POINT; type < VTK::MT_USER; type++ ) {
+ QString icoFile = QString( "ICON_VERTEX_MARKER_%1" ).arg( type );
+ QPixmap pixmap = resMgr->loadPixmap( "VTKViewer", tr( qPrintable( icoFile ) ) );
+ myType->addItem( pixmap, QString() );
+ myType->setItemData( myType->count()-1, type, TypeRole );
+ }
+ // standard marker sizes
+ myScale->setMinimum( (int)VTK::MS_10 );
+ myScale->setMaximum( (int)VTK::MS_70 );
+ // add item for loading custom textures
+ myType->addItem( "..." );
+ myType->setItemData( myType->count()-1, VTK::MT_NONE, TypeRole );
- return QPixmap::fromImage( anImage );
+ myType->blockSignals( false );
+
+ // set current item to first type in the list
+ myType->setCurrentIndex( 0 );
}
-void VTKViewer_MarkerWidget::onStdMarkerChanged( int index )
+/*!
+ \brief Create icon from the custom marker data (texture)
+ \param markerData custom marker data
+ \return icon generated from texture specified with marker data
+*/
+QPixmap VTKViewer_MarkerWidget::markerFromData( const VTK::MarkerData& markerData )
{
- VTK::MarkerType aMarkerType = (VTK::MarkerType)myStdTypeCombo->id( index );
- bool anIsExtraMarker = myExtraMarkerList.contains( aMarkerType );
- myStdScaleCombo->setEnabled( !anIsExtraMarker );
+ // get texture data
+ const VTK::MarkerTexture& texture = markerData.second;
+ // generate VTK image
+ vtkSmartPointer<vtkImageData> image = VTK::MakeVTKImage( texture, false );
+ // convert VTK image to icon
+ QImage qimage = VTK::ConvertToQImage( image.GetPointer() );
+ return qimage.isNull() ? QPixmap() : QPixmap::fromImage( qimage );
}
-void VTKViewer_MarkerWidget::onBrowse()
+/*!
+ \brief Called when marker type is changed (by the user or programmatically)
+ \param index index of item being selected
+*/
+void VTKViewer_MarkerWidget::onTypeChanged( int index )
{
- QStringList filters;
- filters << tr( "Texture files (*.dat)" ) << tr( "All files (*)" );
- QString aFileName = SUIT_Session::session()->activeApplication()->getFileName( true, QString(), filters.join( ";;" ), tr( "LOAD_TEXTURE_TLT" ), this );
- if ( !aFileName.isEmpty() ) {
- VTK::MarkerTexture aMarkerTexture;
- if ( VTK::LoadTextureData( aFileName, VTK::MS_NONE, aMarkerTexture ) ) {
- int anId = VTK::GetUniqueId( myCustomMarkerMap );
- VTK::MarkerData& aMarkerData = myCustomMarkerMap[ anId ];
- aMarkerData.first = aFileName.toStdString();
- aMarkerData.second = aMarkerTexture;
- addTexture( anId, true );
+ if ( index == myType->count()-1 ) {
+ // browse new custom texture file item is selected
+ QStringList filters;
+ filters << tr( "Texture files (*.dat)" ) << tr( "All files (*)" );
+ QString fileName = SUIT_Session::session()->activeApplication()->getFileName( true,
+ QString(),
+ filters.join( ";;" ),
+ tr( "LOAD_TEXTURE_TLT" ),
+ parentWidget() );
+ if ( !fileName.isEmpty() ) {
+ // load texture and add new marker
+ VTK::MarkerTexture texture;
+ if ( VTK::LoadTextureData( fileName, VTK::MS_NONE, texture ) ) {
+ int id = VTK::GetUniqueId( myCustomMarkers );
+ VTK::MarkerData& markerData = myCustomMarkers[ id ];
+ markerData.first = fileName.toStdString();
+ markerData.second = texture;
+ QPixmap icon = markerFromData( markerData );
+ if( !icon.isNull() ) {
+ int idx = myType->count()-1;
+ myType->blockSignals( true );
+ myType->insertItem( idx, icon, QString() );
+ myType->blockSignals( false );
+ myType->setItemData( idx, VTK::MT_USER, TypeRole );
+ myType->setItemData( idx, id, IdRole );
+ myType->setCurrentIndex( idx );
+ return;
+ }
+ }
}
+ // if user cancelled texture loading or there was an error when loading texture
+ // reset to the previous item
+ myType->setCurrentIndex( myCurrentIdx );
+ return;
+ }
+ else {
+ myCurrentIdx = index;
}
+ int type = myType->itemData( index, TypeRole ).toInt();
+ myScale->setEnabled( type < VTK::MT_USER );
+ myScaleLab->setEnabled( type < VTK::MT_USER );
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+// File : VTKViewer_MarkerWidget.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
#ifndef VTKVIEWER_MARKERWIDGET_H
#define VTKVIEWER_MARKERWIDGET_H
#include <QWidget>
-class QButtonGroup;
-class QStackedWidget;
-
-class QtxComboBox;
+class QComboBox;
+class QLabel;
+class QSpinBox;
/*!
* Class : VTKViewer_MarkerWidget
VTKViewer_MarkerWidget( QWidget* );
virtual ~VTKViewer_MarkerWidget();
- void setCustomMarkerMap( VTK::MarkerMap );
- VTK::MarkerMap getCustomMarkerMap();
+ void setCustomMarkers( const VTK::MarkerMap& );
+ VTK::MarkerMap customMarkers() const;
+ void addMarker( VTK::MarkerType, const QPixmap& );
- void setStandardMarker( VTK::MarkerType, VTK::MarkerScale );
+ void setMarker( VTK::MarkerType, VTK::MarkerScale = VTK::MS_NONE );
void setCustomMarker( int );
- VTK::MarkerType getMarkerType() const;
- VTK::MarkerScale getStandardMarkerScale() const;
- int getCustomMarkerID() const;
- void addExtraStdMarker( VTK::MarkerType, const QPixmap& );
+ VTK::MarkerType markerType() const;
+ VTK::MarkerScale markerScale() const;
+ int markerId() const;
+
+ QLabel* typeLabel();
+ QLabel* scaleLabel();
private:
void init();
- void addTexture( int, bool = false );
QPixmap markerFromData( const VTK::MarkerData& );
private slots:
- void onStdMarkerChanged( int );
- void onBrowse();
+ void onTypeChanged( int );
private:
- QButtonGroup* myTypeGroup;
- QStackedWidget* myWGStack;
- QtxComboBox* myStdTypeCombo;
- QtxComboBox* myStdScaleCombo;
- QtxComboBox* myCustomTypeCombo;
-
- VTK::MarkerMap myCustomMarkerMap;
-
- QList<VTK::MarkerType> myExtraMarkerList;
+ // widgets
+ QLabel* myTypeLab;
+ QComboBox* myType;
+ QLabel* myScaleLab;
+ QSpinBox* myScale;
+ // custom markers data
+ VTK::MarkerMap myCustomMarkers;
+ // current item
+ int myCurrentIdx;
};
#endif
if(VTKViewer_Actor* anActor = VTKViewer_Actor::SafeDownCast(aProp))
if(anActor->IsInfinitive())
continue;
-
vtkFloatingPointType *aBounds = aProp->GetBounds();
+ static vtkFloatingPointType MIN_DISTANCE = 1./VTK_LARGE_FLOAT;
static vtkFloatingPointType MAX_DISTANCE = 0.9*VTK_LARGE_FLOAT;
+
+ if(abs(aBounds[1] - aBounds[0]) < MIN_DISTANCE) {
+ aBounds[0]-=0.001;
+ aBounds[1]+=0.001;
+ }
+
+ if(abs(aBounds[3] - aBounds[2]) < MIN_DISTANCE) {
+ aBounds[2]-=0.001;
+ aBounds[3]+=0.001;
+ }
+
+ if(abs(aBounds[5] - aBounds[4]) < MIN_DISTANCE) {
+ aBounds[4]-=0.001;
+ aBounds[5]+=0.001;
+ }
+
// make sure we haven't got bogus bounds
if ( aBounds != NULL &&
aBounds[0] > -MAX_DISTANCE && aBounds[1] < MAX_DISTANCE &&
aBounds[2] > -MAX_DISTANCE && aBounds[3] < MAX_DISTANCE &&
- aBounds[4] > -MAX_DISTANCE && aBounds[5] < MAX_DISTANCE )
+ aBounds[4] > -MAX_DISTANCE && aBounds[5] < MAX_DISTANCE)
{
aCount++;
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/UseQT4EXT.cmake)
+
+INCLUDE_DIRECTORIES(
+ ${QT_INCLUDE_DIRS}
+ ${CMAKE_CURRENT_SOURCE_DIR}/../Qtx
+)
+SET(GUI_HEADERS ViewerTools_CubeAxesDlgBase.h ViewerTools_DialogBase.h ViewerTools_FontWidgetBase.h)
+QT4_WRAP_CPP(GUI_HEADERS_MOC ${GUI_HEADERS})
+SET(ViewerTools_SOURCES
+ ViewerTools_CubeAxesDlgBase.cxx
+ ViewerTools_DialogBase.cxx
+ ViewerTools_FontWidgetBase.cxx
+)
+
+SET(GUITS_SOURCES
+ resources/ViewerTools_msg_en.ts
+ resources/ViewerTools_msg_fr.ts
+)
+
+ADD_LIBRARY(ViewerTools SHARED ${ViewerTools_SOURCES} ${GUI_HEADERS_MOC})
+SET_TARGET_PROPERTIES(ViewerTools PROPERTIES COMPILE_FLAGS "${QT_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
+TARGET_LINK_LIBRARIES(ViewerTools qtx ${QT_MT_LIBS})
+INSTALL(TARGETS ViewerTools DESTINATION ${GUI_salomelib_LIBS})
+
+FILE(GLOB COMMON_HEADERS_H "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
+INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${GUI_salomeinclude_HEADERS})
+QT4_INSTALL_TS_RESOURCES("${GUITS_SOURCES}" "${GUI_salomeres_DATA}")
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+SET(SUBDIRS
+ vtkEDFOverloads
+ dlgfactory
+)
+FOREACH(dir ${SUBDIRS})
+ ADD_SUBDIRECTORY(${dir})
+ENDFOREACH(dir ${SUBDIRS})
+
--- /dev/null
+# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE_DIRECTORIES(
+ ${VTK_INCLUDE_DIRS}
+)
+
+ADD_LIBRARY(vtkTools SHARED vtkEDFCutter.cxx)
+SET_TARGET_PROPERTIES(vtkTools PROPERTIES COMPILE_FLAGS "${VTK_DEFINITIONS}")
+TARGET_LINK_LIBRARIES(vtkTools ${VTK_LIBS})
+INSTALL(TARGETS vtkTools DESTINATION ${GUI_salomelib_LIBS})
+
+ADD_LIBRARY(vtkEDFOverloads SHARED vtkEDFFactory.cxx)
+SET_TARGET_PROPERTIES(vtkEDFOverloads PROPERTIES COMPILE_FLAGS "${VTK_DEFINITIONS}")
+TARGET_LINK_LIBRARIES(vtkEDFOverloads ${VTK_LIBS} vtkTools)
+INSTALL(TARGETS vtkEDFOverloads DESTINATION ${GUI_paraviewlib_LIBS})
+
+FILE(GLOB COMMON_HEADERS_H "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
+INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${GUI_salomeinclude_HEADERS})